3 ms·
Mutation testing with Java pitest measures three things: line coverage, mutation coverage, and test strength. Jacoco measures both line and branch coverage, sa
by turtleyacht 2y ago
Mutation testing with Java pitest measures three things: line coverage, mutation coverage, and test strength.
Jacoco measures both line and branch coverage, same as Jest.
Preferred thing to do is establish a baseline, and then
* Write tests for new features going forward.
* Write tests for fixes to production incidents.
Don't let things get worse than baseline. (The number will vary from repo to repo.)
- kkapelon 2y agoSo how do you decide what should be the baseline on a brand new project? 70%? 80% 90% ? :-)
- turtleyacht 2y agoGood question. Depends on the reference template, if there is one. Otherwise, Unit Testing: Principles, Practices, and Patterns (Khorikov 2020) suggests --- Let me repeat myself: coverage metrics are a good negative indicator, but a bad positive one. Low coverage numbers--say, below 60%--are a certain sign of trouble. They mean there's a lot of untested code in your code base. But high numbers don't mean anything. Thus, measuring the code coverage should be only a first step on the way to a quality test suite.