Android Mutation Testing
This project is part of a blog post about mutation testing in Android on the Trifork blog.
The app consists of a single Activity with two
SeekBars each representing an angle. A label text below displays the currently greatest angle.
Running unit tests
- Import this project in Android Studio.
- Create a new JUnit run configuration by selecting Run > Edit Configurations
- Click on the
+sign and choose JUnit
- In the Name field write a name for your configuration (e.g. All unit tests).
- In the Test kind field select All in package
- In the Package field write the package name (e.g. com.trifork.ckp.androidmutationtesting).
- Click OK and run your new test configuration..
Running PIT mutation tests
pitest Gradle tasks will be created for each build variant. To run the task for all the variants (debug and release) type the following on the command line:
$ ./gradlew pitest
HTML reports will be placed in the
/app/build/reports/pitest/ directory. For more information see the README for the gradle-pitest-plugin.