a++ on a local variable should it fail

Skip to first unread message

Raja Nagendra Kumar

Sep 23, 2021, 3:03:05 AM9/23/21
to PIT Users

On a code like this

public final class EmployeeFixed
private final String id;
private String name;
private double salary;

public EmployeeFixed(final String aNewId, final String aNewName, final double aNewSalary)
id = aNewId;

I see Mutation test services and reports it as an error


3. Incremented (a++) double local variable number 3 → SURVIVED

4. Decremented (a--) double local variable number 3 → SURVIVED


Why a++ and a-- should fail, as it is local variable increment and it happens after the operation is completed.. Is this an issue pit framework itself to see a++, a-- as a mutation that should fail?

Reply all
Reply to author
0 new messages