Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@utbot.triggersRecursion tag is missing #1014

Closed
alisevych opened this issue Sep 26, 2022 · 7 comments · Fixed by #1084
Closed

@utbot.triggersRecursion tag is missing #1014

alisevych opened this issue Sep 26, 2022 · 7 comments · Fixed by #1084
Assignees
Labels
comp-summaries Something related to the method names, code comments and display names generation ctg-bug Issue is a bug spec-release-tailings Failed to include in the current release, let's include it in the next one status-verified Bug fix is verified

Comments

@alisevych
Copy link
Member

Description

@utbot.triggersRecursion tag is missing for Recursion.fib(int n) tests

To Reproduce

  1. Run the UTBot project in IntelliJ Idea 2022.1.4
  2. Install plugin
  3. Check: File -> Settings -> Tools -> UnitTestBot -> Javadoc comment style is "Structured via custom Javadoc tags"
  4. Open the utbot-sample/src/main/java/org/utbot/examples/recursion/Recursion.java file
  5. Generate tests for the methods
  6. Open the generated test

Expected behavior

Tests with input n >= 1 are supposed to have @utbot.triggersRecursion tag in Java doc.

Actual behavior

Tests with input (n = 1), (n = 2) do not have @utbot.triggersRecursion tag in Java doc.

Visual proofs (screenshots, logs, images)

    /**
     * @utbot.classUnderTest {@link Recursion}
     * @utbot.methodUnderTest {@link Recursion#fib(int)}
     * @utbot.executesCondition {@code (n == 1): False}
     * @utbot.returnsFrom {@code return fib(n - 1) + fib(n - 2);}
     */
    @Test
    @DisplayName("fib: return 1 -> return 0")
    public void testFib_NNotEquals1() {
        Recursion recursion = new Recursion();

        int actual = recursion.fib(2);

        assertEquals(1, actual);
    }

Environment

Windows 10 Pro
Gradle project
JDK 11

@alisevych alisevych added the ctg-bug Issue is a bug label Sep 26, 2022
@alisevych alisevych added the comp-summaries Something related to the method names, code comments and display names generation label Sep 26, 2022
@alisevych
Copy link
Member Author

@amandelpie

@amandelpie
Copy link
Collaborator

Thanks @alisevych , probably it will be fixed in the next release looks like missed and unsupported functionlity

@alisevych alisevych added the spec-release-tailings Failed to include in the current release, let's include it in the next one label Sep 29, 2022
@alisevych alisevych added this to the Release hotfix preparation milestone Oct 7, 2022
@alisevych alisevych added the status-verified Bug fix is verified label Oct 11, 2022
@alisevych
Copy link
Member Author

@amandelpie
Issue is reproducing on the latest main
Please check

@amandelpie
Copy link
Collaborator

Thanks for the signal, @alisevych will do a check during next 2 weeks

@amandelpie
Copy link
Collaborator

amandelpie commented Nov 2, 2022

With Symbolic Execution = 90% I've obtained

    /**
     * @utbot.classUnderTest {@link Recursion}
     * @utbot.methodUnderTest {@link Recursion#fib(int)}
     * @utbot.executesCondition {@code (n < 0): False}
     * @utbot.executesCondition {@code (n == 0): False}
     * @utbot.executesCondition {@code (n == 1): False}
     * @utbot.triggersRecursion fib, where the test execute conditions:
     * {@code (n == 1): True}
     * return from: {@code return 1;}
     * @utbot.returnsFrom {@code return fib(n - 1) + fib(n - 2);}
     */
    @Test
    @DisplayName("fib: n == 1 : True -> return 0")
    public void testFib_NEquals1() {
        Recursion recursion = new Recursion();

        int actual = recursion.fib(2);

        assertEquals(1, actual);
    }

Looks like we have the same test but with different metadata

@alisevych
Copy link
Member Author

@amandelpie Not reproducing for me either - on the latest main. Verified on IDEA 2022.1.4 and 2022.2.3

@amandelpie
Copy link
Collaborator

I think it is not a bug, looks like a result of soot analysis, sometimes it is missed the recursion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp-summaries Something related to the method names, code comments and display names generation ctg-bug Issue is a bug spec-release-tailings Failed to include in the current release, let's include it in the next one status-verified Bug fix is verified
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants