Back to list
bitsoex

mutation-testing

by bitsoex

Bitso Java API Wrapper

34🍴 30📅 Jan 24, 2026

SKILL.md


name: mutation-testing description: > Use PIT (Pitest) mutation testing to identify weak tests and improve test quality in Java projects. Finds tests that pass but don't actually verify behavior correctly. Use when improving test suite quality beyond line coverage metrics. compatibility: Java projects using Gradle 8.x+ with JUnit 5 or Spock metadata: version: "1.0.0" technology: java category: testing tags: - java - gradle - testing - mutation-testing - pitest - quality

Mutation Testing

Use PIT mutation testing to identify tests that pass but don't verify behavior correctly.

When to use this skill

  • Improving test quality beyond line coverage metrics
  • Finding weak test assertions that don't catch bugs
  • Validating critical business logic has strong tests
  • Setting up mutation testing in CI pipelines
  • Analyzing which tests need strengthening

Skill Contents

Sections

Available Resources

📚 references/ - Detailed documentation


Quick Start

1. Check readiness

bash java/scripts/check-pitest-readiness.sh

2. Apply PIT configuration

Copy java/templates/pitest.gradle to gradle/pitest.gradle and apply in build.gradle.

3. Run mutation testing

# QUICK level - fast feedback
./gradlew pitest -Ppitest.mutators=DEFAULTS

# STANDARD level - recommended
./gradlew pitest -Ppitest.mutators=STRONGER

# COMPREHENSIVE level - thorough
./gradlew pitest -Ppitest.mutators=ALL

4. Analyze results

open build/reports/pitest/index.html

Focus on SURVIVED mutants - these indicate weak tests.

5. Improve tests

Add specific assertions that kill the surviving mutants.

Key Concepts

Mutation Score vs Line Coverage

  • Line coverage: Does your test execute the code?
  • Mutation score: Does your test actually verify the code works correctly?

High line coverage with low mutation score = tests run code but don't verify results.

Intensity Levels

LevelMutatorsUse CaseTime
QUICKDEFAULTS (~11)Initial analysis, CI1x
STANDARDSTRONGER (~14)Regular improvement1.5x
COMPREHENSIVEALL (~30+)Critical logic3-5x

Mutation Statuses

StatusMeaningAction
KilledTest detected mutationGood
SurvivedTest missed mutationImprove test
No CoverageNo test covers codeWrite test
Timed OutInfinite loopUsually OK

References

ReferenceDescription
references/intensity-levels.mdDetailed mutator descriptions
references/improving-tests.mdPatterns for killing mutants
references/configuration.mdPIT configuration options
references/troubleshooting.mdCommon issues and solutions
  • .cursor/rules/java-testing-guidelines.mdc - Spock/JUnit patterns
  • .cursor/rules/java-jacoco-coverage.mdc - Line coverage configuration
SkillPurpose
java-testingTest configuration
java-coverageJaCoCo coverage

Score

Total Score

65/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

+5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon