Skip to content
Back to skills

Improve Test Coverage

ASecurity

Find and fill coverage gaps

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added December 1, 2026
developmentkotlinvuespringtestinggitfrontendbackend

Works with

  • cli

Security analysis

A100/100

Scanned December 1, 2026

npx -y skills add enorm-labs/event-junkie --skill improve-test-coverage --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Improve Test Coverage?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Improve Test Coverage
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/enorm-labs-improve-test-coverage/badge)](https://www.skillsdirectory.com/skills/enorm-labs-improve-test-coverage)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: improve-test-coverage
description: "Find and fill coverage gaps"
---

# Improve Test Coverage

Read the coverage reports, find the under-tested code that matters, and write the tests. `git --no-pager` on every git command.

## Backend (Kover)

1. **Baseline**: `./gradlew koverLog` (per module), `./gradlew koverHtmlReport` (per class, `build/reports/kover/html/index.html`).
2. **Prioritise**: `@Service` business logic → controller endpoints (status codes, validation, error bodies) → `toDomain()` / `fromDomain()` / `fromEntity()`
   → edge cases (null, empty, validation failure, exception paths) → scraper parsers against their fixtures. Skip configuration classes, entry points,
   `*Module.kt` markers and logic-free accessors — Kover already excludes most of them. **A pure parser or normalizer without a `*PropertyTest` is a
   gap Kover does not show**: the slug, act-splitting and price bugs that property tests found were all in lines example tests already covered.
3. **Read the module's existing tests first**: what is covered, the style, the `*RequestFixtures` available. New tests look like their neighbours;
   [testing.instructions.md](../../../.github/instructions/testing.instructions.md) loads with them and is the convention — `BaseControllerTest` for integration,
   `WebTestClient` for the full cycle, MockK for isolation, Kotest assertions, backtick names, `runTest` for coroutines, a fixture factory per entity (create
   one in the same pattern if missing). Test files mirror the source path.
4. **A new test class must not fork a Spring context.** No `@TestPropertySource` or `@Import` on a class that `BaseControllerTest` could carry instead;
   the context count is measured, and a new one costs a container for the whole task.
5. **Verify**: `./gradlew ktlintFormat`, then `./gradlew clean build detektMain detektTest`, then `koverLog` again for the after number.

## Frontend (Vitest)

`events-frontend/` and `events-admin/` both test with Vitest. Only `events-frontend/` has a coverage script; in `events-admin/`, read the gaps from the tests
next to the code and verify with `npm run type-check`, `npm run lint` and `npm run test:unit -- --run`.

1. **Baseline**: `npm run test:unit:coverage` (console summary, `coverage/index.html`).
2. **Prioritise**: composables → pure helpers in `src/lib/` → components with real logic (computed, watchers, handlers). Skip layout-only components, the
   router and `main.ts`.
3. Colocated `__tests__/*.spec.ts`, `@vue/test-utils`, `data-testid` selectors, composables tested by calling them.
4. **Verify**: `npm run build`, `npm run test:unit -- --run`, `npm run test:unit:coverage`.

## Output

Before and after per module; the tests added and what each covers; the gaps deliberately left, with the reason. **Coverage floors are floors, not targets**
(kotlin.instructions.md): do not raise `koverVerificationFloor` in this change.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.