UTBotJava icon indicating copy to clipboard operation
UTBotJava copied to clipboard

Identical or contradictory`@utbot.executesCondition` for `assert` in user code

Open tyuldashev opened this issue 3 years ago • 0 comments

Description When there is assert in user code there could be @utbot.executesCondition which are either the same or contradictory.

To Reproduce

  1. Install UnitTestBot plugin built from main in IntelliJ IDEA
  2. Set Symbolic = 100%
  3. Generate tests for following code:
    public int separatorEquality(String s) {
        assert(s == null);

        if (s.equals("1")) {
            return 1;
        } else {
            return 0;
        }
    }

Expected behavior There are NO identical or incompatible values for @utbot.executesCondition tag values. In this case it's one of: {@code (assert (s == null);): True} or {@code (assert (s == null);): False}

Actual behavior Two tests are generated one contains contrary tags:

     * @utbot.executesCondition {@code (assert (s == null);): True}
     * @utbot.executesCondition {@code (assert (s == null);): False}

Second one the same tags:

     * @utbot.executesCondition {@code (assert (s == null);): True}
     * @utbot.executesCondition {@code (assert (s == null);): True}

Screenshots, logs image

tyuldashev avatar Jul 13 '23 15:07 tyuldashev