Skip to content

Test generation fails if any unexpected exception occurs for a single method #661

Closed
@Markoutte

Description

@Markoutte

Description

When generate a test case if unexpected error occurs for a single method it cancels test generation for whole class.

To Reproduce

  1. IntelliJ IDEA 2022.1.4 with installed plugin is opened.
  2. Go to File -> Settings -> Tools -> UtBot
  3. Set Code analysis slider somewhere in the middle.
  4. Set Mock strategy to Other packages: Mockito, click OK
  5. Add a class with the following code
    public String property(String key) {
        return System.getProperty(key);
    }
  1. Generate tests for it with Mock strategy for Other packages / classes

Expected behavior

The bad test attempts should be passed (but logged) to recognize the problem, but not breaking the output.

Actual behavior

No test generated if symbolic engine is on.

Additional context

The symbolic execution fails for this test after #622 is implemented.

If only fuzzing works the test set is generated normally.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions