Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Get use of test results

Olga Naumenko edited this pageDec 21, 2022 ·16 revisions

Explore test suites

View clustered tests

If generating summaries isenabled in UnitTestBot settings, you have the generated tests clustered into suites. Analyze these suites to see failing tests, explicitly thrown exceptions, and successful executions.

These suites are marked asregions in the test source code (see cluster comments in thepicture below). To view allthe suites atonce and navigate betweenthem, pressAlt+7 to open theStructure tool window.

The typical suites are:

  • Symbolic execution engine,
  • Fuzzer,
  • Other

each divided into:

  • Successful executions
  • Explicitly thrown unchecked exceptions
  • Error suite

Find the example below:

Dive into these suites to find test methods with detailed descriptions.

Read test descriptions

Each test contains:

Javadoc comment

Briefly describes a test execution path.

  • Jump to the method-under-test right from the comment.

Testing framework annotations

Provide a super short test method description inside:

  • For JUnit 5:@DisplayName("<short description>")

  • For TestNG:@Test(description = "<short description>")
    (For JUnit 4 there are no descriptions right in the annotations.)

    Disabled (or sandboxed) tests

    Sometimes the tests with the@Disabled annotation and a stack trace appear in the output:

    @Disabled("Disabled due to sandbox")

    Keep calm: it is a feature, not a bug. These tests were sandboxed, i.e. interrupted, because they tried to execute potentially unsafe code.

    The most commonly forbidden actions are:

    • working with files (read, write, create, delete),
    • connecting to sockets,
    • invokingSystem.exit(),
    • accessing system properties or JVM properties,
    • usingReflection.

    You canadd permissions in~\.utbot\sandbox.policy. Create this file manually.

    You can refer to theFull list of permissions.

    If you are sure you want the code to be executed as is (including the unsafe operations!) you canturn sandboxing off: addAllPermission to~\.utbot\sandbox.policy. Be careful!

    If you remove the@Disabled annotation and run the test, it will be run without creating a sandbox.

Test method name

Usually looks liketestMethodUnderTestName. Sometimes it is accompanied by explanatory supplements: e.g.,ByFuzzer,ReturnsOneWithCornerCase, or others.

Run tests and view coverage

There are multiple ways torun tests andview coverage in IntelliJ IDEA. All of them apply to UnitTestBot results — feel free to choose any.

If you are not satisfied with coverage, try toExperiment with test generation.

Get SARIF reports

What is SARIF?

It is theStatic Analysis Results Interchange Format — a standard, JSON-based format for the output of static analysis tools.

Every static analysis tool has its own output format, and these formats usually have little in common. SARIF provides a universal output format, which makes it possible to create common tooling, such as viewers, bug filers, metrics calculators, etc.

For more information, please refer toSARIF Tutorials.

How to get SARIF report in UnitTestBot

By default, UnitTestBot creates a SARIF report for each test generation.

Note: if you enableParameterized tests in theGenerate Tests with UnitTestBot window, SARIF report is unavailable for now.

You can find SARIF reports in theresources directory nearTest sources root.

How to inspect errors with SARIF report visualizer

If test generation reveals errors in your code, they are registered in the SARIF report. IntelliJ IDEAautomatically opens theProblems tool window showing the detected errors.

InProblems:

  • click each error and press the buttons with a yellow light bulb toView generated test orAnalyze stack trace,
  • double-click the error to navigate to a corresponding fragment in your source code.

User guides

IntelliJ IDEA plugin

Contributor guides

(redirect to/docs inmain repo)

General info

Continuous integration

Design docs

Clone this wiki locally

[8]ページ先頭

©2009-2025 Movatter.jp