Description
Description
Fuzzer generates test with x == 0
for the code:
import org.utbot.api.mock.UtMock;
public class Main {
int foo(int x) {
UtMock.assume(x != 0);
return 1 / x;
}
}
But it violates UtMock.assume
semantics.
To Reproduce
- Set the "Test generation method" to Fuzzer 5% / Symbolic execution 95%
- Use plugin to generate tests for the code above
- Open the generated tests
Expected behavior
No tests violate UtMock assumptions.
Actual behavior
Fuzzer generates a test:
@Test
@DisplayName("foo: x = zero -> throw RuntimeException")
public void testFooThrowsUMAVEWithCornerCase() {
Main main = new Main();
/* This test fails because method [Main.foo] produces [java.lang.RuntimeException]
org.utbot.api.mock.UtMock.assume(UtMock.java:19)
Main.foo(Main.java:5) */
main.foo(0);
}
Metadata
Metadata
Assignees
Type
Projects
Status
Done