Project 3: Mutation Testing on Real-World Projects
This assignment contributes to the project grade component. In this project, you will apply mutation testing to evaluate and enhance the fault-detection capability of your automated test suite on the real-world codebase you onboarded and tested in Project 1 and Project 2.
Like Projects 1 & 2, this project is strictly an individual assignment. You are responsible for configuring a mutation testing tool in your own repository, analysing killed and surviving mutants, fixing test deficiencies by engineering high-quality automated tests, and verifying that their CI/CD pipeline remains green.
Multi-Language Mutation Testing Tooling Matrix
Mutation testing modifies your source code or bytecode with small syntactic changes (mutations) to verify whether your test suite fails (kills the mutant). Because students work across diverse technology stacks, you are free to select the mutation testing tool appropriate for your programming language.
The following table lists the recommended mutation testing tools as suggested by Gemini 4 Hydrogen with Web Search tool:
| Language / Ecosystem | Recommended Mutation Tool | Runner / Build Tool Integration | Official Reference |
|---|---|---|---|
| Java / Kotlin | Pitest (PIT) | pitest-maven or gradle-pitest-plugin |
pitest.org |
| Python | mutmut or Cosmic Ray | pytest runner integration |
mutmut documentation |
| JavaScript / TypeScript | Stryker | @stryker-mutator/core with Jest, Vitest, or Mocha |
stryker-mutator.io |
| Go | go-mutesting | go test runner integration |
go-mutesting GitHub |
| C# / .NET | Stryker.NET | dotnet-stryker CLI |
Stryker.NET documentation |
Getting Started
- In your local repository for your Project 1 & 2 codebase:
(Note: If your default branch is named
1 2
git switch main git pull origin mainmasteror something else, use that branch name). - Ensure that your existing test suite passes cleanly locally and that your GitLab CI/CD pipeline is green.
- Create a dedicated working branch for this project:
1git switch -c task/3-mutation-testing
Tasks
Task 1: Setup & Configure Mutation Testing Tool
- Install and configure the appropriate mutation testing tool for your project's build tool or package manager:
- Configure scoping rules to focus mutation testing on non-trivial domain classes or packages (including the component you targeted in Project 2). Focus on business logic-related code, and exclude framework boilerplate, DTOs, data migrations, and generated code.
- Run the mutation testing tool locally and generate a report in a file (e.g., HTML report, XML/JSON summary).
- Record your baseline mutation metrics:
- Total mutants generated
- Mutants killed
- Mutants survived
- Baseline Mutation Score: $\frac{\text{Killed Mutants}}{\text{Total Mutants}} \times 100\%$
Task 2: Analysis of Killed Mutant
Select at least one (1) killed mutant from your mutation testing report and analyze how your test suite detected it:
- Identify the applied mutation operator (e.g., Conditionals Boundary Mutator, Math/Arithmetic Operator Mutator, Negate Conditionals Mutator, Void Method Call Mutator, Return Values Mutator).
- Identify the exact source location (
class#method:lineorfile#function:line). - Inspect the syntactic modification introduced by the mutant (original code vs. mutated code).
- Identify the test case(s) responsible for killing this mutant.
- Explain the causal chain of detection:
- How did the test input exercise the mutated statement?
- How did the mutation infect the execution state?
- Which specific assertion or expected outcome observed the faulty state and failed, successfully killing the mutant?
Task 3: Analysis & Remediation of Surviving Mutant
Select at least one (1) surviving mutant from your mutation testing report, conduct a root-cause analysis, and remediate the gap in your test suite:
- Identify the applied mutation operator and exact source location (
class#method:lineorfile#function:line). - Explain why the mutant survived:
- Was it due to missing test coverage (the mutated statement was never executed by any test)?
- Was it due to weak or missing assertions (the mutated statement executed, but no assertion checked the resulting output or state)?
- Was it due to an untested boundary condition or equivalent mutant behaviour?
- Design and implement new tests in your project's test suite to kill this mutant:
- Choose inputs that trigger the mutated logic.
- Write strict, meaningful assertions that observe the infected program state.
- Re-run the mutation testing tool locally.
- Verify that the mutant status changed from SURVIVED to KILLED. Capture before-and-after evidence.
Task 4: Pipeline & Quality Gate Verification
- Run your full local test suite to ensure that all new tests pass and no regression was introduced.
- Push your
task/3-mutation-testingbranch to GitLab CSUI. - Open a Merge Request (MR) targeting your default branch (
mainormaster). - Ensure that your GitLab CI/CD pipeline completes successfully.
- Verify that your project maintains a passing Quality Gate on SonarQube CSUI without introducing new code smells, bugs, or security vulnerabilities.
Deliverables
At the end of this project, prepare the following artefacts in your repository on GitLab CSUI:
- Configuration files or build scripts for running the mutation analysis committed to your repository branch
task/3-mutation-testing. - Updated tests committed to your test directory that kill the selected surviving mutant.
- A green GitLab CI/CD pipeline and a passing SonarQube Quality Gate.
- A Markdown report named
PROJECT_3_REPORT.mdcommitted at the root of your repository following the template below.
The due date for Project 3 is: Tuesday, 8 December 2026, 23:55 UTC+7.
Submit the URL of your repository on GitLab CSUI to the designated submission slot on SCELE before the deadline. Please make sure all commits and MRs are pushed to GitLab CSUI before the due date.
GenAI Usage Policy
This project allows GenAI and LLM tools as learning aids and technical assistants. However, it is vital that you understand the underlying testing concepts and critically verify all outputs.
The use of GenAI does not mean you can delegate your learning process. Do not make GenAI the entity that learns while you act as a mere "meat proxy" for it.
Allowed Uses
- Inquiring about configuration options or syntax for your mutation testing tool (e.g., Pitest XML filters, Stryker configuration options).
- Asking for explanations of specific mutation operators.
- Brainstorming test cases or assertion strategies to detect subtle state infections.
- Assisting in debugging local build errors or test runner execution issues.
Tips: to ground your AI responses with more factual, up-to-date documentation of your mutation library, we recommend you to use Context7 as an MCP with your AI assistant. Context7 usually provides more recent indices toward documentation of popular libraries, which may be more recent than the ones that have been "trained" into the LLM itself.
Prohibited Uses
- Fully outsourcing the mutation analysis or report generation to GenAI without manual inspection.
- Direct copy-pasting of AI-generated test code without verifying that it actually runs and targets the intended mutant.
- Fabricating mutation reports, mutant locations, or test execution outputs.
Report Template
Create a Markdown file named PROJECT_3_REPORT.md at the root of your repository based on the following template:
Note: You may write your report in English or Bahasa Indonesia.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | |
GenAI Use Disclosure
Antigravity CLI with Gemini 3.8 Flash model was used to draft and proofread this document. We have reviewed and edited the generated text.
References
- Paul Ammann & Jeff Offutt, Introduction to Software Testing, 2nd Edition (Cambridge University Press).
- Chapter 8: Mutation Testing
- Pitest (PIT) Mutation Testing: https://pitest.org/
- Stryker Mutator: https://stryker-mutator.io/
- mutmut Documentation: https://mutmut.readthedocs.io/
- go-mutesting GitHub: https://github.com/zimmski/go-mutesting