William Caron-Bastarache
IFT3913

Unit Testing & Mutation Testing

Added targeted tests to GraphHopper, measured JaCoCo coverage before/after, and evaluated robustness with PIT (mutation testing). Completed as part of my Software Quality course (IFT3913).

Summary

Worked on three utility classes from the core module: added 7 new tests, configured PIT, and compared results (coverage + mutation) before and after.

AngleCalc, BitUtil, ArrayUtil
7 tests (3 + 2 + 2) + java-faker
JUnit, JaCoCo, PIT

What was done

Targeted tests

Edge cases, input validation, and representative scenarios.

JaCoCo

Improved instruction and branch coverage for the targeted classes.

PIT

Robustness measured via mutants: +3 killed mutants overall.

java-faker

Generated realistic coordinates to diversify test inputs.

PIT configuration

Added the plugin to the pom.xml (core module) and ensured reproducible runs.

Reports

JaCoCo and PIT HTML reports available locally after execution.

Results (before → after)

JaCoCo (targeted classes)

Improvements measured across the three classes.

82%→84% instr. • 65%→70% branches
91%→92% instr. • 87%→89% branches
94%→95% instr. • 96%→100% branches

PIT (global)

Small global increase, but meaningful gain in killed mutants.

86% → 87%
92% → 93%
+3 (ArrayUtil +2, BitUtil +1)

Contact

Questions or improvement ideas? Feel free to reach out.