Skip to content

Test on Recursion generated by Fuzzer with int overflow should fail when Treat overflows as errors #1379

Open
@alisevych

Description

@alisevych

Description

Tests generated by Symbolic Execution for OverflowExamples with Treat overflows as errors option on - are supposed to fail with ArithmeticException, but they are passing.

To Reproduce

  1. Install one of the latest plugin build from main in IDEA
  2. Run the 'UTBotJava' project in IntelliJ Idea
  3. Set Overflow detection to Treat overflows as errors and Fuzzing on:

image

  1. Use plugin to generate tests for the sample org.utbot.examples.recursion.Recursion.factorial:

Expected behavior

Test produces int overflow inside factorial method (2^32 => 0) and is supposed to fail.
The test also should go to OVERFLOWS region and should have a comment about int overflow.

Actual behavior

A regular test is generated.
It is added to ///region FUZZER: SUCCESSFUL EXECUTIONS for method factorial(int)
The test is passing.

Visual proofs (screenshots, logs, images)

    /**
     * @utbot.classUnderTest {@link Recursion}
     * @utbot.methodUnderTest {@link Recursion#factorial(int)}
     */
    @Test
    @DisplayName("factorial: n = 1024 (mutated from 0) -> return 0")
    public void testFactorialReturnsZero() {
        Recursion recursion = new Recursion();

        int actual = recursion.factorial(1024);

        assertEquals(0, actual);
    }

Environment

Windows 10 Pro
IntelliJ IDEA 2022.2.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    comp-fuzzingIssue is related to the fuzzingctg-enhancementNew feature, improvement or change requestctg-questionFurther information is requested

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions