GamePlus.java

1
package edu.ucsb.cs156.happiercows.entities;
2
3
import lombok.Data;
4
5
import com.fasterxml.jackson.annotation.JsonGetter;
6
7
8
import lombok.AllArgsConstructor;
9
import lombok.NoArgsConstructor;
10
import lombok.Builder;
11
12
13
@Data
14
@AllArgsConstructor
15
@NoArgsConstructor
16
@Builder
17
public class GamePlus {
18
    private Game game;
19
    private Integer totalCows;
20
    private Integer totalUsers;
21
    private Double averageCowsPerFarmer;
22
    private Double medianCowsPerFarmer;
23
    private Integer minimumCowsPerFarmer;
24
    private Integer maximumCowsPerFarmer;
25
    private Double standardDeviationCowsPerFarmer;
26
    private Double averageCowHealth;
27
28
29
    @JsonGetter("effectiveCapacity")
30
    public int getEffectiveCapacity() {
31 2 1. getEffectiveCapacity : replaced int return with 0 for edu/ucsb/cs156/happiercows/entities/GamePlus::getEffectiveCapacity → KILLED
2. getEffectiveCapacity : Replaced integer multiplication with division → KILLED
        return Math.max(game.getCapacityPerUser() * totalUsers, game.getCarryingCapacity());
32
    }
33
34
35
}

Mutations

31

1.1
Location : getEffectiveCapacity
Killed by : edu.ucsb.cs156.happiercows.controllers.GameControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.GameControllerTests]/[method:test_capacity_with_lower_per_user()]
replaced int return with 0 for edu/ucsb/cs156/happiercows/entities/GamePlus::getEffectiveCapacity → KILLED

2.2
Location : getEffectiveCapacity
Killed by : edu.ucsb.cs156.happiercows.controllers.GameControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.GameControllerTests]/[method:test_capacity_with_higher_per_user()]
Replaced integer multiplication with division → KILLED

Active mutators

Tests examined


Report generated by PIT 1.22.1