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

Empty region names and missing javadoc for Sort.arrayCopy #1204

Closed
tyuldashev opened this issue Oct 20, 2022 · 7 comments
Closed

Empty region names and missing javadoc for Sort.arrayCopy #1204

tyuldashev opened this issue Oct 20, 2022 · 7 comments
Assignees
Labels
comp-summaries Something related to the method names, code comments and display names generation ctg-bug Issue is a bug status-verified Bug fix is verified

Comments

@tyuldashev
Copy link
Collaborator

Description

To Reproduce

    public int[] arrayCopy() {
        int[] fst = {1, 2, 3};
        int[] snd = {4, 5, 6};

        System.arraycopy(fst, 0, snd, 0, 3);
        return snd;
    }

Steps to reproduce the behavior:

  1. Open algorithms/Sort.java sample from UTBot project
  2. Or use code sample from above.
  3. In plugin settings set generation method to 95% Symbolic
  4. Use plugin to generate tests
  5. Open the generated test

Expected behavior

Every test is placed in region with name and has proper java doc description

Actual behavior

Quite many regions have no names and some tests have no javadocs

Visual proofs (screenshots, logs, images)

Here is one of generated test:

public class SortTest {
    ///region Test suites for executable org.example.Sort.arrayCopy

    ///region

    @Test
    public void testArrayCopy1() {
        Sort sort = new Sort();

        int[] actual = sort.arrayCopy();

        int[] expected = {1, 2, 3};
        assertArrayEquals(expected, actual);
    }

...
@tyuldashev tyuldashev added the ctg-bug Issue is a bug label Oct 20, 2022
@tyuldashev tyuldashev moved this to Todo in UTBot Java Oct 20, 2022
@amandelpie amandelpie added the comp-summaries Something related to the method names, code comments and display names generation label Oct 21, 2022
@amandelpie
Copy link
Collaborator

amandelpie commented Oct 25, 2022

@tyuldashev the default behaviour - do not generate summaries/regions if something goes wrong (it should be logged by logger.error to the log). We are not guarantee at this moment that all tests will have regions and other summaries.

Sometimes it's a developer bug in summaries, sometimes it's the limitation of summaries functionality.

I suggest or copy the reason of crash from logs (if it's the same it's one bug if is different—there are a few bugs) or copy generated results (with missed summaries)

@alisevych for copy

@amandelpie
Copy link
Collaborator

On my laptop looks like it's reproduced and related to the problem #1227

@alisevych
Copy link
Member

It is reproducing for a certain number of tests.
Now - for Sort.partition and Sort.quickSort - on the latest main

idea.log doesn't contain the information about missing data, neither do concrete executor log.

@amandelpie It would be great if you investigate (debug) what exact data is missing for these executions.
Then this bug could be handled to the correct developer.

@amandelpie
Copy link
Collaborator

@tyuldashev @alisevych Looks like it was fixed by #1227 closed earlier, it's not reproduced on my side

@alisevych alisevych added this to the 2022.12 Release milestone Nov 8, 2022
@alisevych alisevych changed the title Empty region names and missing javadoc in some tests Empty region names and missing javadoc for Sort.arrayCopy Nov 8, 2022
@amandelpie
Copy link
Collaborator

@tyuldashev @alisevych please reproduce and close, the bug is not reproduced on the master and closed earlier

For example, the following test is generated

public final class SortTest {
    ///region Test suites for executable custom.Sort.arrayCopy

    ///region FUZZER: SUCCESSFUL EXECUTIONS for method arrayCopy()

    /**
     * @utbot.classUnderTest {@link Sort}
     * @utbot.methodUnderTest {@link Sort#arrayCopy()}
     */
    @Test
    @DisplayName("arrayCopy: arg_0 = Sort()")
    public void testArrayCopy() {
        Sort sort = new Sort();

        int[] actual = sort.arrayCopy();

        int[] expected = {1, 2, 3};
        assertArrayEquals(expected, actual);
    }
    ///endregion

    ///endregion
}

@tyuldashev
Copy link
Collaborator Author

@amandelpie yes, looks like this one fixed, there is one question though: should region have name even when Summaries generation is Disabled? In latter case region name still could be empty.

@tyuldashev
Copy link
Collaborator Author

Per discussion, that's okay that region name is empty when summaries disabled in the settings. So closing the case as fixed.

Repository owner moved this from Todo to Done in UTBot Java Dec 9, 2022
@tyuldashev tyuldashev added the status-verified Bug fix is verified label Dec 9, 2022
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 status-verified Bug fix is verified
Projects
Archived in project
Development

No branches or pull requests

3 participants