|
1
|
|
package io.github.some_example_name; |
|
2
|
|
|
|
3
|
|
public class FinalScoreLogic { |
|
4
|
|
|
|
5
|
|
public static int calculate( |
|
6
|
|
float timeLeftSeconds, |
|
7
|
|
int timesCaughtByDean, |
|
8
|
|
boolean gooseUnlocked, |
|
9
|
|
boolean deanUnlocked, |
|
10
|
|
boolean quizUnlocked |
|
11
|
|
) { |
|
12
|
|
int timeRemainingSeconds = (int) timeLeftSeconds; |
|
13
|
|
|
|
14
|
1
1. calculate : Replaced integer division with multiplication → KILLED
|
int minutes = timeRemainingSeconds / 60; |
|
15
|
1
1. calculate : Replaced integer modulus with multiplication → KILLED
|
int seconds = timeRemainingSeconds % 60; |
|
16
|
2
1. calculate : Replaced integer addition with subtraction → KILLED
2. calculate : Replaced integer multiplication with division → KILLED
|
int timeScore = (minutes * 100) + seconds; |
|
17
|
|
|
|
18
|
1
1. calculate : Replaced integer multiplication with division → KILLED
|
int deanPenalty = timesCaughtByDean * 5; |
|
19
|
1
1. calculate : Replaced integer subtraction with addition → KILLED
|
int finalScore = timeScore - deanPenalty; |
|
20
|
|
|
|
21
|
1
1. calculate : negated conditional → KILLED
|
if (gooseUnlocked) { |
|
22
|
1
1. calculate : Changed increment from 70 to -70 → KILLED
|
finalScore += 70; |
|
23
|
|
} |
|
24
|
1
1. calculate : negated conditional → KILLED
|
if (deanUnlocked) { |
|
25
|
1
1. calculate : Changed increment from -50 to 50 → SURVIVED
|
finalScore -= 50; |
|
26
|
|
} |
|
27
|
1
1. calculate : negated conditional → KILLED
|
if (quizUnlocked) { |
|
28
|
1
1. calculate : Changed increment from 50 to -50 → KILLED
|
finalScore += 50; |
|
29
|
|
} |
|
30
|
|
|
|
31
|
1
1. calculate : replaced int return with 0 for io/github/some_example_name/FinalScoreLogic::calculate → KILLED
|
return Math.max(0, finalScore); |
|
32
|
|
} |
|
33
|
|
} |
|
34
|
|
|
| | Mutations |
| 14 |
|
1.1 Location : calculate Killed by : io.github.some_example_name.FinalScoreLogicTest.[engine:junit-jupiter]/[class:io.github.some_example_name.FinalScoreLogicTest]/[method:gooseAchievementAddsBonus()] Replaced integer division with multiplication → KILLED
|
| 15 |
|
1.1 Location : calculate Killed by : io.github.some_example_name.FinalScoreLogicTest.[engine:junit-jupiter]/[class:io.github.some_example_name.FinalScoreLogicTest]/[method:gooseAchievementAddsBonus()] Replaced integer modulus with multiplication → KILLED
|
| 16 |
|
1.1 Location : calculate Killed by : io.github.some_example_name.FinalScoreLogicTest.[engine:junit-jupiter]/[class:io.github.some_example_name.FinalScoreLogicTest]/[method:baseScoreCalculatedFromTime()] Replaced integer addition with subtraction → KILLED 2.2 Location : calculate Killed by : io.github.some_example_name.FinalScoreLogicTest.[engine:junit-jupiter]/[class:io.github.some_example_name.FinalScoreLogicTest]/[method:gooseAchievementAddsBonus()] Replaced integer multiplication with division → KILLED
|
| 18 |
|
1.1 Location : calculate Killed by : io.github.some_example_name.FinalScoreLogicTest.[engine:junit-jupiter]/[class:io.github.some_example_name.FinalScoreLogicTest]/[method:deanPenaltyIsApplied()] Replaced integer multiplication with division → KILLED
|
| 19 |
|
1.1 Location : calculate Killed by : io.github.some_example_name.FinalScoreLogicTest.[engine:junit-jupiter]/[class:io.github.some_example_name.FinalScoreLogicTest]/[method:deanPenaltyIsApplied()] Replaced integer subtraction with addition → KILLED
|
| 21 |
|
1.1 Location : calculate Killed by : io.github.some_example_name.FinalScoreLogicTest.[engine:junit-jupiter]/[class:io.github.some_example_name.FinalScoreLogicTest]/[method:gooseAchievementAddsBonus()] negated conditional → KILLED
|
| 22 |
|
1.1 Location : calculate Killed by : io.github.some_example_name.FinalScoreLogicTest.[engine:junit-jupiter]/[class:io.github.some_example_name.FinalScoreLogicTest]/[method:gooseAchievementAddsBonus()] Changed increment from 70 to -70 → KILLED
|
| 24 |
|
1.1 Location : calculate Killed by : io.github.some_example_name.FinalScoreLogicTest.[engine:junit-jupiter]/[class:io.github.some_example_name.FinalScoreLogicTest]/[method:gooseAchievementAddsBonus()] negated conditional → KILLED
|
| 25 |
|
1.1 Location : calculate Killed by : none Changed increment from -50 to 50 → SURVIVED
|
| 27 |
|
1.1 Location : calculate Killed by : io.github.some_example_name.FinalScoreLogicTest.[engine:junit-jupiter]/[class:io.github.some_example_name.FinalScoreLogicTest]/[method:gooseAchievementAddsBonus()] negated conditional → KILLED
|
| 28 |
|
1.1 Location : calculate Killed by : io.github.some_example_name.FinalScoreLogicTest.[engine:junit-jupiter]/[class:io.github.some_example_name.FinalScoreLogicTest]/[method:quizAchievementAddsBonus()] Changed increment from 50 to -50 → KILLED
|
| 31 |
|
1.1 Location : calculate Killed by : io.github.some_example_name.FinalScoreLogicTest.[engine:junit-jupiter]/[class:io.github.some_example_name.FinalScoreLogicTest]/[method:gooseAchievementAddsBonus()] replaced int return with 0 for io/github/some_example_name/FinalScoreLogic::calculate → KILLED
|