PIT Mutation Coverage Zero

1,883 views
Skip to first unread message

soma srikanth

unread,
Sep 8, 2016, 12:28:41 PM9/8/16
to PIT Users, he...@pitest.org
I got the below issue when i ran pit-maven command mvn org.pitest:pitest-maven:mutationCoverage my configuration is like this 

<plugin>
<groupId>org.pitest</groupId>
<artifactId>pitest-maven</artifactId>
<version>1.1.3</version>
<configuration>
<timestampedReports>false</timestampedReports>
<failWhenNoMutations>false</failWhenNoMutations>
<targetClasses>
<param>com.package.projectname.RepresentationSystem.*</param>
<param>com.package.projectname.UnitSystem.*</param>
</targetClasses>
<targetTests>
<param>RepresentationSystem</param>
<param>UnitSystem</param>
</targetTests>
<outputFormats>
<param>XML</param>
<param>HTML</param>
<param>CSV</param>
</outputFormats>
</configuration>


Tests run: 210, Failures: 0, Errors: 0, Skipped: 0

[INFO]
[INFO] --- pitest-maven:1.1.3:mutationCoverage (default-cli) @ projectname ---
[INFO] Found plugin : Default csv report plugin
[INFO] Found plugin : Default xml report plugin
[INFO] Found plugin : Default html report plugin
[INFO] Found plugin : Default limit mutations plugin
[INFO] Found shared classpath plugin : Default mutation engine
11:00:03 AM PIT >> INFO : Mutating from C:\updating\UnitSystem-Java\target\classes
11:00:04 AM PIT >> INFO : Verbose logging is disabled. If you encounter an problem please enable it before reporting an issue.
11:00:04 AM PIT >> INFO : Sending 0 test classes to slave
11:00:04 AM PIT >> INFO : Sent tests to slave
11:00:04 AM PIT >> INFO : Calculated coverage in 0 seconds.
11:00:04 AM PIT >> INFO : Created  31 mutation test units
\11:00:05 AM PIT >> INFO : Completed in 1 seconds
================================================================================
- Timings
================================================================================
> scan classpath : < 1 second
> coverage and dependency analysis : < 1 second
> build mutation tests : < 1 second
> run mutation analysis : < 1 second
--------------------------------------------------------------------------------
> Total  : 1 seconds
--------------------------------------------------------------------------------
================================================================================
- Statistics
================================================================================
>> Generated 510 mutations Killed 0 (0%)
>> Ran 0 tests (0 tests per mutation)
================================================================================
- Mutators
================================================================================
> org.pitest.mutationtest.engine.gregor.mutators.ConditionalsBoundaryMutator
>> Generated 23 Killed 0 (0%)
> KILLED 0 SURVIVED 0 TIMED_OUT 0 NON_VIABLE 0
> MEMORY_ERROR 0 NOT_STARTED 0 STARTED 0 RUN_ERROR 0
> NO_COVERAGE 23
--------------------------------------------------------------------------------
> org.pitest.mutationtest.engine.gregor.mutators.IncrementsMutator
>> Generated 11 Killed 0 (0%)
> KILLED 0 SURVIVED 0 TIMED_OUT 0 NON_VIABLE 0
> MEMORY_ERROR 0 NOT_STARTED 0 STARTED 0 RUN_ERROR 0
> NO_COVERAGE 11
--------------------------------------------------------------------------------
> org.pitest.mutationtest.engine.gregor.mutators.VoidMethodCallMutator
>> Generated 33 Killed 0 (0%)
> KILLED 0 SURVIVED 0 TIMED_OUT 0 NON_VIABLE 0
> MEMORY_ERROR 0 NOT_STARTED 0 STARTED 0 RUN_ERROR 0
> NO_COVERAGE 33
--------------------------------------------------------------------------------
> org.pitest.mutationtest.engine.gregor.mutators.ReturnValsMutator
>> Generated 220 Killed 0 (0%)
> KILLED 0 SURVIVED 0 TIMED_OUT 0 NON_VIABLE 0
> MEMORY_ERROR 0 NOT_STARTED 0 STARTED 0 RUN_ERROR 0
> NO_COVERAGE 220
--------------------------------------------------------------------------------
> org.pitest.mutationtest.engine.gregor.mutators.MathMutator
>> Generated 41 Killed 0 (0%)
> KILLED 0 SURVIVED 0 TIMED_OUT 0 NON_VIABLE 0
> MEMORY_ERROR 0 NOT_STARTED 0 STARTED 0 RUN_ERROR 0
> NO_COVERAGE 41
--------------------------------------------------------------------------------
> org.pitest.mutationtest.engine.gregor.mutators.NegateConditionalsMutator
>> Generated 182 Killed 0 (0%)
> KILLED 0 SURVIVED 0 TIMED_OUT 0 NON_VIABLE 0
> MEMORY_ERROR 0 NOT_STARTED 0 STARTED 0 RUN_ERROR 0
> NO_COVERAGE 182
--------------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.714 s
[INFO] Finished at: 2016-09-08T11:00:05-05:00
[INFO] Final Memory: 32M/378M
[INFO] ------------------------------------------------------------------------

Henry Coles

unread,
Sep 9, 2016, 4:15:33 AM9/9/16
to pitu...@googlegroups.com
On 8 Sep 2016 5:28 p.m., "soma srikanth" <soma.sr...@gmail.com> wrote:
I got the below issue when i ran pit-maven command mvn org.pitest:pitest-maven:mutationCoverage my configuration is like this 

<plugin>
<groupId>org.pitest</groupId>
<artifactId>pitest-maven</artifactId>
<version>1.1.3</version>
<configuration>
<timestampedReports>false</timestampedReports>
<failWhenNoMutations>false</failWhenNoMutations>
<targetClasses>
<param>com.package.projectname.RepresentationSystem.*</param>
<param>com.package.projectname.UnitSystem.*</param>
</targetClasses>
<targetTests>
<param>RepresentationSystem</param>
<param>UnitSystem</param>
</targetTests>
<outputFormats>
<param>XML</param>
<param>HTML</param>
<param>CSV</param>
</outputFormats>
</configuration>


Your targetTests section does not look correct. It accepts globs against fully qualified class names in the same fashion as targetClasses.

Henry
 

soma srikanth

unread,
Sep 9, 2016, 9:14:48 AM9/9/16
to pitu...@googlegroups.com
But i have tests written with package name RepresentationSystem and it is not something like com.project.example.Test i can attach the picture of my target tests below 

package RepresentationSystem;

import com.company.unitsystem.CultureInfoDefault;
import com.company.unitsystem.RepresentationSystem.*;
import com.company.unitsystem.generated.RepresentationSystem;
import org.junit.Before;
import org.junit.Test;

Here is My second Test package looks like 

package UnitSystem;

import com.company.unitsystem.UnitSystem.CompositeConversionFactor;
import com.company.unitsystem.generated.UnitSystem;
import org.junit.Before;
import org.junit.Test;

--
You received this message because you are subscribed to a topic in the Google Groups "PIT Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pitusers/lTNS8H1NOGw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pitusers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Henry Coles

unread,
Sep 9, 2016, 9:18:40 AM9/9/16
to pitu...@googlegroups.com
On 9 September 2016 at 14:14, soma srikanth <soma.sr...@gmail.com> wrote:
But i have tests written with package name RepresentationSystem and it is not something like com.project.example.Test i can attach the picture of my target tests below 

package RepresentationSystem;

import com.company.unitsystem.CultureInfoDefault;
import com.company.unitsystem.RepresentationSystem.*;
import com.company.unitsystem.generated.RepresentationSystem;
import org.junit.Before;
import org.junit.Test;

Here is My second Test package looks like 

package UnitSystem;

import com.company.unitsystem.UnitSystem.CompositeConversionFactor;
import com.company.unitsystem.generated.UnitSystem;
import org.junit.Before;
import org.junit.Test;


You will need to add a wildcard so the classes within the package are picked up.

eg

UnitSystem.*
RepresentationSystem.*

soma srikanth

unread,
Sep 9, 2016, 9:22:18 AM9/9/16
to pitu...@googlegroups.com
Thank you so much for the help it worked i really appreciate for your quick response :)

soma srikanth

unread,
Sep 13, 2016, 5:11:11 PM9/13/16
to pitu...@googlegroups.com
Hi Henry i have the same error on different project can you please help me in resolve this 

4:03:05 PM PIT >> INFO : Verbose logging is disabled. If you encounter an problem please enable it before reporting an issue.
4:03:05 PM PIT >> INFO : Sending 23 test classes to slave
4:03:05 PM PIT >> INFO : Sent tests to slave
4:03:05 PM PIT >> INFO : SLAVE : 4:03:05 PM PIT >> INFO : Checking environment

4:03:06 PM PIT >> INFO : SLAVE : 4:03:06 PM PIT >> INFO : Found  12 tests

4:03:06 PM PIT >> INFO : SLAVE : 4:03:06 PM PIT >> INFO : Dependency analysis reduced number of potential tests by 0

4:03:06 PM PIT >> INFO : SLAVE : 4:03:06 PM PIT >> INFO : 12 tests received

|4:03:07 PM PIT >> INFO : Calculated coverage in 1 seconds.
4:03:07 PM PIT >> INFO : Created  1 mutation test units
/4:03:07 PM PIT >> INFO : Completed in 2 seconds
================================================================================
- Timings
================================================================================
> scan classpath : < 1 second
> coverage and dependency analysis : 1 seconds
> build mutation tests : < 1 second
> run mutation analysis : < 1 second
--------------------------------------------------------------------------------
> Total  : 1 seconds
--------------------------------------------------------------------------------
================================================================================
- Statistics
================================================================================
>> Generated 7 mutations Killed 0 (0%)
>> Ran 0 tests (0 tests per mutation)
================================================================================
- Mutators
================================================================================
> org.pitest.mutationtest.engine.gregor.mutators.ReturnValsMutator
>> Generated 7 Killed 0 (0%)
> KILLED 0 SURVIVED 0 TIMED_OUT 0 NON_VIABLE 0
> MEMORY_ERROR 0 NOT_STARTED 0 STARTED 0 RUN_ERROR 0
> NO_COVERAGE 7
--------------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.002 s
[INFO] Finished at: 2016-09-13T16:03:07-05:00
[INFO] Final Memory: 12M/307M
[INFO] ------------------------------------------------------------------------

Pit Configuration:

<plugin>
<groupId>org.pitest</groupId>
<artifactId>pitest-maven</artifactId>
    <version>1.1.5</version>
    <configuration>
<timestampedReports>false</timestampedReports>
<failWhenNoMutations>false</failWhenNoMutations>
        <outputFormats>
<param>XML</param>
<param>HTML</param>
<param>CSV</param>
</outputFormats>
        <targetClasses>
<param>com.company.class.git*</param>
</targetClasses>
<targetTests>
<param>com.company.class.git*</param>
</targetTests>
</configuration>
</plugin>
My Tests package looks like this 
test 1
package com.company.class.git.NccaReporter.domain

henry

unread,
Sep 14, 2016, 11:15:27 AM9/14/16
to PIT Users


On Tuesday, 13 September 2016 22:11:11 UTC+1, soma srikanth wrote:
Hi Henry i have the same error on different project can you please help me in resolve this 


From the output you posted pit looks to be picking up 12 tests. It's hard to say what's going on without more information, but one simple possibility is that none of those tests exercise the mutants that put is creating.

What do the tests and code look like?

soma srikanth

unread,
Sep 14, 2016, 12:07:23 PM9/14/16
to PIT Users
It's my bad the code base is written in groovy i think pit works only for java language right ?

Henry Coles

unread,
Sep 14, 2016, 12:08:38 PM9/14/16
to pitu...@googlegroups.com
On 14 September 2016 at 17:07, soma srikanth <soma.sr...@gmail.com> wrote:
It's my bad the code base is written in groovy i think pit works only for java language right ?

Pit won't mutate groovy code, but it has no problem with tests written in groovy.

soma srikanth

unread,
Sep 14, 2016, 12:25:38 PM9/14/16
to PIT Users
Gotcha, Thanks for the help :)
Reply all
Reply to author
Forward
0 new messages