Skip to content

Mutation report names a Spock feature by its generated method name #28

Backlog

Description

@vlsi

The mutation report of pitestDiff and cribro:pitest-diff names a Spock feature by the name of the method the Spock compiler generates for it, not by the name in the source:

FooSpec.$spock_feature_0_1[2]

for a feature written as def "adds two numbers"(), iteration 2. A reader has to open the compiled spec to learn which feature reached the mutant.

Spock builds the [feature:…] segment of the unique id from the reflected method name (SpockEngineDiscoveryPostProcessor.java:43), and that name is $spock_feature_<depth>_<ordinal> (SpecRewriter.java:343). The test name in PIT's mutations.xml is that id, so cribro has nothing else to print. The rows "Spock feature" and "Spock iteration of a data-driven feature" of PitestSurvivorsTest.platformIds at 6dea6e0 (#26) pin the current output; I have not run a Spock build through pitestDiff.

Expected. A row names a Spock feature by its source name, such as FooSpec."adds two numbers"[2]; the quoting is open. The iteration indices stay as they are.

The source name is in the name of the @FeatureMetadata annotation the Spock compiler puts on the generated method (FeatureMetadata.java:36), so one possible shape, untested, is to read that annotation from the compiled spec class in the test output directory.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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