Description
Spring unit tests generated with symbolic engine avoid branches whis thisInstance == null if being null is actually impossible.
For example, because variable with @InjectMocks annotation is never null.
Fuzzer currently does not support this restrictions, so we generate tests like this:
///region FUZZER: ERROR SUITE for method useAbs(int)
@Test
@DisplayName("useAbs: x = -3 (mutated from -1) -> throw NullPointerException")
public void testUseAbsThrowsNPE() {
/* This test fails because method [org.springframework.samples.math.MathUser.useAbs] produces [java.lang.NullPointerException]
org.springframework.samples.math.MathUser.useAbs(MathUser.java:10) */
mathUser.useAbs(-3);
}
///endregion
This test passes and writes that should fail :)
Description
Spring unit tests generated with symbolic engine avoid branches whis
thisInstance == nullif being null is actually impossible.For example, because variable with
@InjectMocksannotation is never null.Fuzzer currently does not support this restrictions, so we generate tests like this:
This test passes and writes that should fail :)