Skip to content

@utbot.triggersRecursion tag is missing #1014

Closed

Description

@alisevych

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

Activity

  1. added
    comp-summariesSomething related to the method names, code comments and display names generation
    on Sep 26, 2022
  2. moved this to Todo in UTBot Javaon Sep 26, 2022
  3. alisevych commented on Sep 26, 2022

    @alisevych
    MemberAuthor
  4. amandelpie commented on Sep 28, 2022

    @amandelpie
    Collaborator

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

  5. added
    spec-release-tailingsFailed to include in the current release, let's include it in the next one
    on Sep 29, 2022
  6. Repository owner moved this from Todo to Done in UTBot Javaon Oct 4, 2022
  7. alisevych commented on Nov 1, 2022

    @alisevych
    MemberAuthor

    @amandelpie
    Issue is reproducing on the latest main
    Please check

  8. Repository owner moved this from Done to In Progress in UTBot Javaon Nov 1, 2022
  9. amandelpie commented on Nov 1, 2022

    @amandelpie
    Collaborator

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

  10. amandelpie commented on Nov 2, 2022

    @amandelpie
    Collaborator

    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

  11. alisevych commented on Nov 2, 2022

    @alisevych
    MemberAuthor

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

  12. Repository owner moved this from In Progress to Done in UTBot Javaon Nov 2, 2022
  13. amandelpie commented on Nov 2, 2022

    @amandelpie
    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

Metadata

Metadata

Labels

comp-summariesSomething related to the method names, code comments and display names generationctg-bugIssue is a bugspec-release-tailingsFailed to include in the current release, let's include it in the next onestatus-verifiedBug fix is verified

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions