Skip to content

@utbot.invokes {@link soot.dummy.InvokeDynamic in JavaDoc for test method #1869

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

Closed
tyuldashev opened this issue Feb 28, 2023 · 2 comments · Fixed by #2396
Closed

@utbot.invokes {@link soot.dummy.InvokeDynamic in JavaDoc for test method #1869

tyuldashev opened this issue Feb 28, 2023 · 2 comments · Fixed by #2396
Assignees
Labels
comp-summaries Something related to the method names, code comments and display names generation ctg-bug Issue is a bug lang-java Issue is related to Java support

Comments

@tyuldashev
Copy link
Collaborator

Description
Some tests have @utbot.invokes {@link soot.dummy.InvokeDynamic in JavaDocs even though there is no calls to it. This seems happens only for JDK11+ and not happens with JDK 1.8.

To Reproduce

Steps to reproduce the behavior:

  1. Create new project with JDK11 (for some reason it's not reproducible in UTBot project)
  2. Copy there org.utbot.examples.exceptions.ExceptionExamples class from UTBot project.
  3. Invoke test generation for IllegalArgumentException createException() method

Expected behavior
JavaDoc for generated tests contains actual information about invoked methods

Actual behavior
@utbot.invoke tag linked to soot method which actually is not called in test or in user code.

Visual proofs (screenshots, logs, images)

 /**
     * @utbot.classUnderTest {@link ExceptionExamples}
     * @utbot.methodUnderTest {@link ExceptionExamples#createException()}
     * @utbot.invokes {@link Math#sqrt(double)}
     * @utbot.invokes {@link soot.dummy.InvokeDynamic#makeConcatWithConstants(double)}
     * @utbot.returnsFrom {@code return new IllegalArgumentException("Here we are: " + Math.sqrt(10));}
     */
    @Test
    @DisplayName("createException: MathSqrt -> return new IllegalArgumentException(\"Here we are: \" + Math.sqrt(10))")
    public void testCreateException_InvokeDynamicMakeConcatWithConstants() throws Exception {
        ExceptionExamples exceptionExamples = new ExceptionExamples();

        IllegalArgumentException actual = exceptionExamples.createException();

        IllegalArgumentException expected = ((IllegalArgumentException) createInstance("java.lang.IllegalArgumentException"));
    }

Additional context

That's pre-existing problem, reproducible in 2022.12 release.

@tyuldashev tyuldashev added ctg-bug Issue is a bug comp-summaries Something related to the method names, code comments and display names generation labels Feb 28, 2023
@alisevych alisevych added the lang-java Issue is related to Java support label Mar 14, 2023
@alisevych
Copy link
Member

Reproducing with Plain text Java docs on Release 2023.3 build.

@EgorkaKulikov
Copy link
Collaborator

Can be also reproduced on petclinic project. method PetTypeFormatter.parse

image

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 lang-java Issue is related to Java support
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants