CommonsPlus.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 CommonsPlus {
18
    private Commons commons;
19
    private Integer totalCows;
20
    private Integer totalUsers;
21
22
23
    @JsonGetter("effectiveCapacity")
24
    public int getEffectiveCapacity() {
25 2 1. getEffectiveCapacity : Replaced integer multiplication with division → KILLED
2. getEffectiveCapacity : replaced int return with 0 for edu/ucsb/cs156/happiercows/entities/CommonsPlus::getEffectiveCapacity → KILLED
        return Math.max(commons.getCapacityPerUser() * totalUsers, commons.getCarryingCapacity());
26
    }
27
28
29
}

Mutations

25

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

2.2
Location : getEffectiveCapacity
Killed by : edu.ucsb.cs156.happiercows.strategies.CowHealthUpdateStrategyTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.strategies.CowHealthUpdateStrategyTests]/[method:constant_changes_by_constant_amount()]
replaced int return with 0 for edu/ucsb/cs156/happiercows/entities/CommonsPlus::getEffectiveCapacity → KILLED

Active mutators

Tests examined


Report generated by PIT 1.7.3