Skip to content

Instantly share code, notes, and snippets.

@xpepper
Created November 20, 2021 09:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xpepper/56418fb5e17062ffcc774b3c9fc811f6 to your computer and use it in GitHub Desktop.
Save xpepper/56418fb5e17062ffcc774b3c9fc811f6 to your computer and use it in GitHub Desktop.
tags
testing

JUnit5 + Mutation Testing with PIT

PIT: http://pitest.org/

Example project: https://github.com/tomekkaczanowski/minimal-junit5-pitest

It contains a minimal Maven project with pom.xml configured so that you have JUnit5 + Pitest up and running in no time.

Execute:

mvn clean test -DwithHistory org.pitest:pitest-maven:mutationCoverage

This command will run tests, check them with mutation testing and generate site (you can see it at target/pit-reports/<REPORT_DATE>/index.html).

Credits to http://testinglikeaboss.com/running-tests/mutation-testing-with-junit-5-pitest/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment