Activity 3.2: Mutation Testing with Stryker
This activity is intended to supplement the CS4530 lecture on mutation testing development. You will need to have already completed the development environment setup for the class.
Steps
- Get the starter code by cloning the
transcript-service-m03repository from GitHub - Run
npm installinside the directory that is created when you unzip the download. -
Check that every member of the group can run
npm run testand see that the tests pass and give full branch and line coverage.
-
Check that every member of the group can run
npm run strykerand see that 7 variants survive, associated with lines 40, 43, 53, 54, 70, 121, and 125.
Classify the surviving mutants into innocuous (didn’t introduce a bug) and non-innocuous (did introduce a bug).
-
In a new file
src/additional.spec.ts, write tests that will kill each non-innocuous mutant. For each mutant that you classified as innocuous, write a comment explaining why you think it is innocuous. You can rerunnpm run testto make sure your tests still pass, and rerunnpm run strykerto see if your tests kill identify the bad mutants. - When you are done, submit
src/additional.spec.tsas required by your instructor.
Grading Criteria: 10pts
- +2 points for each mutant correctly classified as innocuous or non-innocuous, killed if non-innocuous, or explained if innocuous, up to a maximum of 10 points.