Skip to content

Randoop: add runner parameter for filtering out tests that do not call SUT #9

@micskeiz

Description

@micskeiz

Randoop generated tests for snippets in L2 where the test code just creates complex strings, but does not call the snippet method.

For example, this is the code for one of the tests:

    byte[] byte_array0 = new byte[] {  };
    // The following exception was thrown during execution in test generation
    try {
      java.lang.String str4 = new java.lang.String(byte_array0, 100, 100, "");
      org.junit.Assert.fail("Expected exception of type java.lang.StringIndexOutOfBoundsException");
    } catch (java.lang.StringIndexOutOfBoundsException e) {
      // Expected exception.
      if (! e.getClass().getCanonicalName().equals("java.lang.StringIndexOutOfBoundsException")) {
        org.junit.Assert.fail("Expected exception of type java.lang.StringIndexOutOfBoundsException, got " + e.getClass().getCanonicalName());
      }
    }       
    // Regression assertion (captures the current behavior of the code)
    org.junit.Assert.assertNotNull(byte_array0);

Randoop has a parameter to handle this:

--include-if-classname-appears=regex. Classes, one of which every test must use. Randoop will only output tests that have at least one use of a member of a class whose name matches the regular expression.

Add this parameter to Randoop runner to filter out these tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions