PITEST 突变覆盖率:未发现突变

问题描述

我真的希望使用 PITEST 进行突变覆盖,但我不知道为什么我总是收到此错误以及无论我做什么(我使用的是 Pitest 版本:1.6.7,所以我不必指定目标测试和目标类):

 [ERROR] Failed to execute goal org.pitest:pitest-maven:1.4.8:mutationCoverage (pitest)   on project 2: Execution pitest of goal org.pitest:pitest-maven:1.4.8:mutationCoverage   Failed: No mutations found. This probably means there is an issue with either the  supplied classpath or filters.

 [ERROR] See http://pitest.org for more details.

你能帮我解决这个问题吗,你可以在下面找到我的 pom.xml,谢谢你的回答。

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>1</groupId>
    <artifactId>2</artifactId>
    <version>2</version>
    <packaging>jar</packaging>

    <name>2</name>
    <description>Blank project for Vanilla Spring WebFlux.fn</description>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.0.RELEASE</version> <!-- lookup parent from repository -->
    </parent>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.8</java.version>
        <start-class>2.App</start-class>
        <spring-fu.version>0.0.3.BUILD-SNAPSHOT</spring-fu.version>
    </properties>


    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-webflux</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>javax.annotation</groupId>
                    <artifactId>javax.annotation-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.hibernate.validator</groupId>
                    <artifactId>hibernate-validator</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.fu</groupId>
            <artifactId>spring-fu-jafu</artifactId>
            <version>${spring-fu.version}</version>
        </dependency>
        <dependency>
            <groupId>am.ik.yavi</groupId>
            <artifactId>yavi</artifactId>
            <version>0.0.18</version>
        </dependency>
          
        <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.11</version>
        <scope>test</scope>
    
        </dependency>
        
        <dependency>
            <groupId>org.pitest</groupId>
            <artifactId>pitest-parent</artifactId>
            <version>1.6.7</version>
            <type>pom</type>
    </dependency>
        
        <dependency>
            <groupId>io.projectreactor</groupId>
            <artifactId>reactor-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
            
            <plugin>
            <groupId>org.codehaus.mojo</groupId>
             <artifactId>cobertura-maven-plugin</artifactId>
             <version>2.5.1</version>
             <configuration>
             <formats>
                <format>html</format>
                <format>xml</format>
             </formats>
             </configuration>
           </plugin>
           
           <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>3.0.0-M5</version>
           </plugin>
           
           
           
           <plugin>
        <groupId>org.pitest</groupId>
        <artifactId>pitest-maven</artifactId>
        <version>1.6.7</version>
        <configuration>
            <verbose>true</verbose>
        </configuration>
        <executions>
                 <execution>
                    <id>pitest</id>
                   <phase>test</phase>
                  </execution>
             </executions>
         </plugin>


           
           <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>0.8.2</version>
            <executions>
                <execution>
                    <goals>
                            <goal>prepare-agent</goal>
                    </goals>
                </execution>
 
                <execution>
                    <id>report</id>
                    <phase>test</phase>
                    <goals>
                            <goal>report</goal>
                    </goals>
                </execution>
        </executions>
        </plugin>
         
        </plugins>
    </build>

    <repositories>
        <repository>
            <id>spring-snapshots</id>
            <name>Spring Snapshots</name>
            <url>https://repo.spring.io/snapshot</url>
            <snapshots>
            </snapshots>
        </repository>
        <repository>
            <id>spring-milestones</id>
            <name>Spring Milestones</name>
            <url>https://repo.spring.io/milestone</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>spring-snapshots</id>
            <name>Spring Snapshots</name>
            <url>https://repo.spring.io/snapshot</url>
            <snapshots>
            </snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>spring-milestones</id>
            <name>Spring Milestones</name>
            <url>https://repo.spring.io/milestone</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

</project>

您可以使用以下链接在我的 Google Drive 中找到我的小项目(1 个课程和 1 个测试):

https://drive.google.com/file/d/1GJ7ij5zK63J2E6uOJGYWprzp-bD_OgtK/view?usp=sharing

如果你成功地用它生成了突变和坑报告,请告诉我,它会对我有很大帮助!谢谢!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)