Loading...
Loading...
Test coverage analysis, identify gaps, and generate missing tests to achieve over 80% coverage. Trigger conditions: user requests for test coverage analysis, test coverage improvement, and test writing.
npx skill4agent add icefrag/nbl-superpowers nbl.test-coverage| Type | Package Path Pattern | Testing Method | Reason |
|---|---|---|---|
| Service Layer | | Unit Test | Core business logic |
| Manager Layer | | Unit Test | External integration logic |
| Controller Layer | | Integration Test | API contract verification |
| Utility Classes | | Unit Test | Cross-service reuse |
| Financial Calculation | All classes with calculation logic | Unit Test | High risk |
| Authentication & Authorization | | Unit Test | Security-critical |
| Type | Package Path Pattern | Reason |
|---|---|---|
| Entity Classes | | Pure data carrier, no logic |
| DTO Classes | | Pure data carrier, indirectly covered by other tests |
| Req/Resp/Query | | POJO, indirectly covered by Controller tests |
| Enum Classes | | Pure definition, no business logic |
| Constant Classes | | Only static constants |
| Configuration Classes | | Managed by Spring, no business logic |
| Mapper Layer | | Framework-generated implementation, indirectly covered by integration tests |
| MyBatis Interceptors | | MyBatis plugin framework, covered by integration tests |
| Scheduled Jobs | | Covered by integration tests |
| Startup Classes | | No testing value |
| Event Classes | | Pure data carrier, no business logic |
| Event Listeners | | Managed by Spring framework, covered by integration tests |
| Message Queue Listeners | | Managed by MQ framework, requires real environment |
pom.xml<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<configuration>
<excludes>
<!-- Entity/DTO/VO -->
<exclude>**/model/entity/**</exclude>
<exclude>**/model/dto/**</exclude>
<exclude>**/model/enums/**</exclude>
<exclude>**/model/request/**</exclude>
<exclude>**/model/response/**</exclude>
<exclude>**/model/query/**</exclude>
<!-- Mapper层 -->
<exclude>**/mapper/**</exclude>
<!-- MyBatis拦截器 -->
<exclude>**/*Interceptor.class</exclude>
<!-- 事件类 -->
<exclude>**/*Event.class</exclude>
<!-- 监听器 -->
<exclude>**/listener/**</exclude>
<!-- 消息队列 -->
<exclude>**/messagequeue/**</exclude>
<exclude>**/mq/**</exclude>
<!-- 配置类 -->
<exclude>**/config/**</exclude>
<!-- 常量类 -->
<exclude>**/constants/**</exclude>
<!-- 启动类 -->
<exclude>**/*Application.class</exclude>
</excludes>
</configuration>
</plugin>| Indicator | Coverage Command |
|---|---|
| |
| |
| Priority | Test Type | Coverage Target |
|---|---|---|
| P0 | Happy Path | Core functionality with valid input |
| P0 | Exception Handling | Invalid input, business exceptions |
| P1 | Edge Cases | Empty collections, null, boundary values |
| P1 | Branch Coverage | Each if/else, switch case |
src/test/java/.../src/test/java/.../controller/Coverage Report (Entity/DTO/Mapper/Config classes excluded)
──────────────────────────────────────────────────
File Before After Status
──────────────────────────────────────────────────
DiscountServiceImpl.java 45% 88% ✅
OrderServiceImpl.java 32% 82% ✅
OrderManagerImpl.java 55% 85% ✅
──────────────────────────────────────────────────
Overall Coverage: 46% 87% ✅| Code Type | Target Coverage | Testing Method |
|---|---|---|
| Financial calculation, authentication, security | 100% | Unit Test |
| Service/Manager business logic | 80%+ | Unit Test |
| Controller Layer | 80%+ | Integration Test |
| Utility classes | 80%+ | Unit Test |