POTD 9: Code Defense (Program-based mutation testing)
Due 15-Nov-2025, 11am EST
Purpose:
- Understand, practice, and reinforce the concept of mutation testing
- Reinforce the RIPR concept
- Practice test automation (JUnit)
You may work alone or with at most two other students in this course
(feel free to make use of any communication channels of your choice).
Resources:
You may find the
RIPR concept,
mutation testing,
test automation, and
JUnit
helpful.
Follow the instructions below to play
Code Defenders.
Code Defenders
allows users to learn mutation as a game.
Attackers create mutants in a Java class,
and defenders design JUnit tests to kill the mutants.
Defenders score by killing mutants,
and attackers score by creating mutants defenders cannot kill.
You may create a new game or join the existing games.
A battleground is multiplayer,
where one player creates a game and functions as an observer,
and the other players can join as either defenders or attackers.
A melee is multiplayer,
where each player acts as a defender and an attacker to the other players.
Note: if you play as an attacker (creating mutants)
and as a defender (writing JUnit tests), you cannot claim credits for killing your mutants.
Tasks:
- Create an account (you will need an email address).
- Important note: Do NOT use your UVA computingID or any of your credentials.
This web-based mutation testing game is hosted and managed by faculty members at another university.
- You can create a new game (melee or battleground) or join the existing game.
- You may use any Java class of your choice
or use a
cal.java
from a Software Testing textbook,
which should be already uploaded
- You should use a simple, unit-level program, not a large-scale or OO program.
- Set the game levels to hard
- Play the game as an attacker (creating mutants) and/or a defender (writing JUnit tests to kill the mutants)
- Please note that if you join the existing games,
there are chances that the games were created by students at other universities.
Due to the different time zone, they may not be active at the time you are playing the games.
Defenders can claim a mutant is equivalent by clicking the “Claim Equivalent” button.
The attacker then either has to agree (giving the point to the defender)
or prove the mutant is not equivalent by designing a test to kill the mutant.
If you are an "attacker"
- For each Java class you mutated, write down
- How did you mutate?
What rules did you use to mutate? Why these rules?
Did you follow any existing mutation operators? Why these operators?
- The number of mutants you created
- The number of your mutants that are alive
- The number of your mutants that are killed
- The number of your mutants that are claimed equivalent
- Based on the conclusion on live mutants and killed mutants,
how did you analyze?
- Based on the conclusion on equivalent mutants,
how did you analyze? How did you conclude that the mutants equivalent?
How long did it take to analyze and conclude?
- One of the mutants you created — be sure to pick your most favorite mutant.
- Include the actual code (original code and mutated code) in the report
- Briefly reflect why you picked this mutant
- Briefly discuss the quality of this mutant
If you are a "defender"
- For each Java class you created tests for, write down
- Which method(s) you create tests for
- The number of tests you wrote
- The number of mutants your tests detected (i.e., killed)
- How did you design your tests?
- The number of mutants your tests did not detect
- The number of mutants you claimed equivalent
- How did you analyze and conclude whether the mutants are equivalent?
How long did it take to analyze and conclude?
- One of the JUnit tests you wrote — be sure to pick your most favorite test.
- Include the actual JUnit test code in the report
- Briefly reflect why you picked this test
- Briefly discuss the quality of this test
Grading rubric
[Total: 10 points]: Done (or provide evidence of your attempt, full or reasonable effort)
- (5 points) — Providing evidence of your attempt, minimal effort
(-2.5 points) for 24 hours late (submitted after 15-Nov-2025 11am EST, by 16-Nov-2025 11am EST)
(-5 points) for 48 hours late (submitted after 16-Nov-2025 11am EST, by 17-Nov-2025 11am EST)
Submission
- Take a selfie (or picture) of your team —
get creative
and
have fun!
— and submit it with your POTD.
- A report
- Include information about the mutants and/or the tests (see above)
- Include your (code defenders) username and
a screenshot (from code defenders) showing your scores
- Save your report as a .pdf file — No Word document.
- Upload your POTD
to POTD 9 on Gradescope.
- Make sure you connect your partner to your group on Gradescope so that everyone receives credit
- Each team submits only one copy
Making your submission available to instructor and course staff is your
responsibility;
if we cannot access or open your file, you will not get credit.
Be sure to test access to your file before the due date.