Skip to content

Slow test generation for matrix with constraints #2254

Open
@tochilinak

Description

@tochilinak

Description

UTBot Java cannot generate for a test that expects specific matrix as input in 3 minutes. However, it was able to do that in 5 minutes.

To Reproduce

Steps to reproduce the behavior:

  1. Create project in IntelliJ Idea with the following code:
public class Main {
    int[][] func(int[][] x, int target) {
        int n = x.length;
        assert (n >= 5);
        for (int[] ints : x) {
            assert (ints.length == n);
            for (int j = 0; j < n; j++) {
                assert (ints[j] == target);
            }
        }

        // simulation of some smart work
        int y = 1;
        for (int i = 0; i < n; i++) {
            y += i;
            x[i][i] += y;
        }

        return x;
    }
}
  1. Use plugin to generate tests. Set timeout to 180 seconds.

Expected behavior

At least one successful test should be generated.

Actual behavior

Only failing tests were generated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    comp-fuzzingIssue is related to the fuzzingcomp-symbolic-engineIssue is related to the symbolic execution enginectg-bugIssue is a buglang-javaIssue is related to Java support

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions