home / skills / bitsoex / bitso-java / testing-standards

testing-standards skill

/.claude/skills/testing-standards

This skill validates test coverage, identifies untested paths, and guides test writing across JavaScript, Java, Python, and Go projects.

npx playbooks add skill bitsoex/bitso-java --skill testing-standards

Review the files below or copy the command above to add this skill to your agents.

Files (6)
SKILL.md
2.5 KB
---
name: testing-standards
description: >
  Validate and improve test coverage for code changes. Identifies untested paths
  and provides test writing guidance. Checks coverage thresholds for Java, TypeScript,
  Python, and Go projects.
compatibility: Works with Java (JaCoCo), JavaScript/TypeScript (Jest/NYC), Python (coverage.py), Go (go test)
metadata:
  version: "1.0.0"
  technology: global
---

# Testing Standards

Validate test coverage and generate missing tests.

## When to use this skill

- After implementing new features
- When refactoring existing code
- To identify gaps in test coverage
- During test quality improvements
- When asked to "add tests" or "improve coverage"

## Skill Contents

### Available Resources

**📚 references/** - Detailed documentation
- [go](references/go)
- [java](references/java)
- [python](references/python)
- [test patterns](references/test-patterns.md)
- [typescript](references/typescript)

---

## Quick Start

1. Run coverage report for your technology:
   - JavaScript/TypeScript: `pnpm run test:coverage`
   - Python: `pytest --cov=. --cov-report=html`
   - Java: `./gradlew jacocoTestReport`
   - Go: `go test -cover ./...`
2. Review uncovered files and functions
3. Apply patterns from the references:
   - `references/test-patterns.md` - General test patterns
   - `references/{technology}/test-patterns.md` - Technology-specific patterns
4. Write tests for uncovered code paths
5. Re-run coverage to verify improvement

## Coverage Targets

| Type | Target |
|------|--------|
| Line coverage | 80%+ |
| Branch coverage | 70%+ |
| Critical paths | 100% |

## Coverage Tools

| Technology | Tool |
|------------|------|
| Java | JaCoCo |
| JavaScript/TypeScript | Jest, NYC |
| Python | coverage.py, pytest-cov |
| Go | go test -cover |

## References

| Technology | Reference |
|------------|-----------|
| Java | `references/java/test-patterns.md` |
| TypeScript | `references/typescript/test-patterns.md` |
| Python | `references/python/test-patterns.md` |
| Go | `references/go/test-patterns.md` |

## Related Skills

- [quality-checks](.claude/skills/quality-checks/SKILL.md) - Quality check orchestration
- [doc-validation-rfc-37](.claude/skills/doc-validation-rfc-37/SKILL.md) - Documentation validation
- `java-testing` - Java-specific testing (for Java projects)
<!-- AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY -->
<!-- Source: bitsoex/ai-code-instructions → global/skills/testing-standards/SKILL.md -->
<!-- To modify, edit the source file and run the distribution workflow -->

Overview

This skill validates and improves test coverage for code changes across Java, TypeScript, Python, and Go projects. It identifies untested paths, enforces coverage thresholds, and provides concrete guidance for writing missing tests. Use it to close coverage gaps and make coverage improvements measurable and repeatable.

How this skill works

The skill runs or analyzes coverage reports for the target technology and highlights uncovered files, functions, and branches. It maps gaps to recommended test patterns and gives actionable test-writing guidance based on language-specific references. Finally, it verifies improvements by re-checking coverage against configurable targets.

When to use it

  • After adding new features to ensure new code paths are tested
  • When refactoring to confirm behavior remains covered
  • To diagnose and prioritize gaps reported in CI coverage checks
  • While improving test quality or increasing coverage targets
  • When asked to 'add tests' or to meet branch/line coverage thresholds

Best practices

  • Run the project-specific coverage command locally before making changes
  • Prioritize tests for critical paths and edge cases first
  • Use provided technology test-patterns to keep tests maintainable
  • Aim for line coverage >= 80% and branch coverage >= 70%, with critical paths fully tested
  • Re-run coverage after each set of tests to validate improvements

Example use cases

  • A pull request adds new API wrappers; identify untested functions and suggest Jest tests for TypeScript
  • A refactor touched core logic in Python; list missing unit tests and recommend pytest patterns
  • CI fails branch coverage for a Go module; produce targeted unit tests to cover branches
  • Enforce coverage gates before merging by checking reports and reminding authors to add tests
  • Improve flaky tests by recommending isolation patterns and mock usage from references

FAQ

Which coverage targets should I aim for?

Aim for at least 80% line coverage and 70% branch coverage; ensure critical paths are covered at 100%.

Which tools does the skill support?

It checks common tools: JaCoCo for Java, Jest/NYC for JavaScript/TypeScript, pytest-cov for Python, and go test -cover for Go.