Improve Testing Code Quality with Mutation Testing
summary
Demonstrates mutation testing with the PIT demo that mutates bytecode (plus→minus, conditional boundaries, void-call removals) to show how 100% code coverage can be worthless when tests lack assertions, producing 0% mutation coverage. Runs on JMoney and a SonarSource C++ frontend show mvn test ~11s versus full mutation runs ~5 minutes, cut to ~1m53s with threads; incremental analysis yields seconds. Advises running PIT on CI, not bound to the test phase, focus on critical code and use selective mutators.
AI-written summary · about
chapters (12)
- 0:00Introduction and welcome
- 2:22Testing overview and code coverage limits
- 8:53Mutation testing basics
- 12:10PIT tool and mutators
- 16:44Demo with simple math class
- 21:13Demo with realistic filter function
- 24:13Demo with JMoney project
- 31:53Mutation testing performance challenges
- 35:36Speeding up mutation testing
- 43:59Best practices and limitations
- 47:56Role of mutation testing in testing
- 50:10Q&A session
