Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a Maven Plugin to integrate test generation into the application project #145

Open
rmarting opened this issue Nov 26, 2021 · 4 comments

Comments

@rmarting
Copy link
Collaborator

Is your feature request related to a problem? Please describe.

Currently generating and executing the automated test is done by the tlktest CLI, that it is basically an "external" tool from the current development tool of the project (e.g: Maven, Gradle or Ant). So as developer I have to manage two different things to cover my development life cycle, including the tests of my application.

  • test stages provided by the project's development tool
  • test stages provided by tlktest CLI

So, AS developer I WANT to use my current development tool to cover all the stages of my development life cycle SO I will be focus in one only tool and its capabilities.

Describe the solution you'd like

To have a Maven Plugin to cover the generation and execution stages of Tackle Test Generator. This maven plugin could be used in the application life cycle to add these automatic test stages under the right circunstances, for example using Maven profiles to activate these goals when they are needed.

Describe alternatives you've considered

A sample of the Maven plugin definition in my project for generate the test code could be similar to:

<plugins>
    <plugin>
	<groupId>org.konveyor</groupId>
	<artifactId>tackle-test-generator-maven-plugin</artifactId>                        
        <executions>
            <execution>
                <phase>generate-sources</phase>
                <goals>
                    <goal>generate</goal>
                </goals>
                <configuration>
                  <!-- Add generate configuration  -->
                </configuration>
            </execution>
        </executions>
    </plugin>
</plugins>

A sample of the Maven plugin definition in my project for execute the test could be similar to:

<plugins>
    <plugin>
	<groupId>org.konveyor</groupId>
	<artifactId>tackle-test-generator-maven-plugin</artifactId>                        
        <executions>
            <execution>
                <phase>test</phase>
                <goals>
                    <goal>execute</goal>
                </goals>
                <configuration>
                  <!-- Add execute configuration  -->
                </configuration>
            </execution>
        </executions>
    </plugin>
</plugins>

Additional context

As Maven plugin should have the most tipical features and characteristics of this kind of extension of Maven. Some references:

Also a sample definition integrated with Maven Profiles could be similar to:

<profiles>
	<profile>
		<id>test-generate</id>
		<build>
			<plugins>
				<plugin>
					<groupId>org.konveyor</groupId>
					<artifactId>tackle-test-generator-maven-plugin</artifactId>                        
					<executions>
					    <execution>
						<goals>
						    <goal>generate</goal>
						</goals>
					    </execution>
					</executions>
				</plugin>
			</plugins>
		</build>
	</profile>
	<profile>
		<id>test-execute</id>	
		<build>
			<plugins>
				<plugin>
					<groupId>org.konveyor</groupId>
					<artifactId>tackle-test-generator-maven-plugin</artifactId>                        
					<executions>
					    <execution>
						<goals>
						    <goal>execute</goal>
						</goals>
					    </execution>
					</executions>
				</plugin>
			</plugins>
		</build>
	</profile>	
</profiles>
@rmarting
Copy link
Collaborator Author

Also it could be good to have other issue similar for Gradle, but for now, with a plugin for Maven will cover most cases.

@rachelt44
Copy link
Collaborator

@rmarting EvoSuite which is used as one of the base test generators in Tackle-Test already has a maven plugin, see: https://www.evosuite.org/documentation/maven-plugin/

I don't think we can utilize it though, because we invoke EvoSuite from command line from within our Java code.

@rmarting
Copy link
Collaborator Author

Good stuff @rachelt44 ! This is the idea of this issue, to have something similar in the tool, integrating EvoSuite and Randoop under the same cli.

The idea could not be invoke the EvoSuite maven plugin, and it should be more aligned to provide a Tackle-Test Maven Plugin to be used in my project (using the current workflow of the tackle-test cli). Does it make sense?

@rachelt44
Copy link
Collaborator

@rmarting totally makes sense. I just wanted to point out the EvoSuite maven plugin as an "inspiration" to the one we can develop for tackle-test :-)

@sinha108 sinha108 transferred this issue from konveyor/tackle-test-generator-core Jan 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants