PIT (PITest)
Mutation testing system for Java and JVM languages that modifies bytecode to verify test quality.
Pricing
Free / Open source
Type
Automation
Languages
Java, Kotlin, Scala
// VERDICT
Reach for PIT when you want to measure how good your JVM tests really are via mutation testing, beyond line coverage. Skip it when you're not on the JVM, lack a baseline test suite, or can't afford the runtime cost.
Best for
Mutation testing for Java/JVM (PIT) - introducing small code changes (mutants) and checking whether your tests catch them, revealing weak tests that coverage numbers hide.
Avoid when
You're not on the JVM, you don't yet have a decent test suite, or runtime cost is prohibitive.
CI/CD fit
Maven/Gradle plugin · mutation reports · CI (often scheduled)
Languages
Java · Kotlin · Scala
Team fit
JVM teams · Teams hardening test quality · QA beyond coverage
Setup
Maintenance
Learning
Licence
// BEST FOR
- Measuring test strength via mutation testing
- Revealing tests that pass but don't actually assert
- Going beyond line coverage to test effectiveness
- Maven/Gradle integration with reports
- Targeting changed code to limit runtime
- Hardening critical JVM test suites
// AVOID WHEN
- You're not on the JVM
- You lack a baseline test suite to mutate against
- Runtime cost is prohibitive on every build
- Line coverage is all you track
- Minimal tooling is the goal
- Your suite is too small to benefit
// QUICK START
Add the PIT plugin (Maven/Gradle) -> run mutation analysis over your code/tests
-> review the mutation score and surviving mutants -> strengthen weak tests.
Scope to changed classes to limit runtime.// ALTERNATIVES TO CONSIDER
// FEATURES
- Bytecode-level mutation operators across the JVM
- Maven, Gradle, Ant, and SBT plugins
- Incremental analysis — only mutates changed code paths
- HTML and XML reports with line and class breakdowns
- Configurable mutation operator sets (default, stronger, weaker)
// PROS
- Fastest mutation testing in the JVM ecosystem
- Mature project with proven track record on large Java codebases
- Deep integration with Maven Surefire and Gradle test runners
- Good defaults — usable with minimal config
// CONS
- JVM-only — no relevance outside Java/Kotlin/Scala
- Mutation runs can still be slow on multi-module monorepos
- Reports basic compared to Stryker dashboard
// EXAMPLE QA WORKFLOW
Add the PIT plugin (Maven/Gradle)
Run mutation analysis
Review the mutation score
Inspect surviving mutants
Strengthen weak tests
Scope runs to control runtime
// RELATED QA.CODES RESOURCES
Glossary
Practice
Interview