This repository demonstrates the integration of PIT (Pitest) for mutation testing along with unit testing using JUnit 5 and Mockito.
This project showcases the implementation of data structure algorithms in Java with corresponding unit tests. Mutation testing is integrated using PIT to ensure the effectiveness of the test cases. The project uses Gradle for dependency management and build automation.
- Java 21
- Gradle 7.2 or higher
JavaDsaWithTest/
├── src/
│ ├── main/
│ │ └── java/
│ │ └── org/
│ │ └── example/
│ └── test/
│ └── java/
│ └── org/
│ └── example/
├── build.gradle.kts
└── settings.gradle.kts
The key dependencies used in this project are:
JUnit 5 for unit testing. Mockito for mocking in unit tests. PIT for mutation testing. Refer to the build.gradle file for the complete list of dependencies.
To run the tests using JUnit 5:
./gradlew clean test
Mutation testing is performed using PIT, which evaluates the quality of your test cases by introducing small changes (mutations) into your code and checking if the tests fail.
To run the mutation tests:
./gradlew clean pitest
The mutation testing results are generated as an HTML report. You can find the report in the following directory:
build/reports/pitest/
Open the index.html file in your browser to view the mutation testing results.