STAMP-project/dspot

Double amplification (Jacoco + Pit) generates exceptions ("uncompilable" tests ?)

gibello opened this issue · 1 comments

Characteristics

  • Issue Type: bug
  • Reproducibility: always
  • Severity: minor
  • Tool/Service/Component: DSpot maven plugin 2.1.1-SNAPSHOT
  • Execution Environment: Linux Ubuntu 18.04
  • Reporter: Pierre-Yves Gibello, pyg@ow2.org

Description

Tried to amplify twice: once with Jacoco, then amplify the amplified version with PitMutant.

It does not work, but there are some exceptions saying the test methods are "uncompilable" (sic) when I try to amplified an already amplified test.

Build success, with no test generated. Exceptions look like this:

[INFO] Compiling with -proceedOnError -encoding UTF-8 -cp /tmp/joram/joram/joram/mom/core/target/dspot/tmp_test_sources:/home/gibello/.m2/repository/org/ow2/joram/joram-shared/5.17.0-SNAPSHOT/joram-shared-5.17.0-SNAPSHOT.jar:/home/gibello/.m2/repository/org/ow2/joram/a3-common/5.17.0-SNAPSHOT/a3-common-5.17.0-SNAPSHOT.jar:/home/gibello/.m2/repository/org/objectweb/joram/jcup/5.3.1/jcup-5.3.1.jar:/home/gibello/.m2/repository/org/ow2/joram/a3-rt/5.17.0-SNAPSHOT/a3-rt-5.17.0-SNAPSHOT.jar:/home/gibello/.m2/repository/junit/junit/4.6/junit-4.6.jar:/home/gibello/.m2/repository/org/osgi/org.osgi.compendium/5.0.0/org.osgi.compendium-5.0.0.jar:/home/gibello/.m2/repository/org/osgi/org.osgi.core/6.0.0/org.osgi.core-6.0.0.jar:/home/gibello/.m2/repository/org/ow2/jonas/osgi/monolog/5.2.0/monolog-5.2.0.jar:/home/gibello/.m2/repository/org/objectweb/monolog/monolog/2.1.12/monolog-2.1.12.jar:/tmp/joram/joram/joram/mom/core/target/classes/:/tmp/joram/joram/joram/mom/core/target/test-classes/:/tmp/joram/joram/joram/mom/core/target/dspot/dependencies/: -d /tmp/joram/joram/joram/mom/core/target/test-classes -1.8 -preserveAllLocals -noExit -enableJavadoc -proc:none /tmp/joram/joram/joram/mom/core/target/dspot/tmp_test_sources/org/objectweb/joram/mom/proxies/AmplClientContextEncodingTest.java
eu.stamp_project.dspot.AmplificationException: Every test methods are uncompilable
	at eu.stamp_project.utils.compilation.TestCompiler.compileAndDiscardUncompilableMethods(TestCompiler.java:161)
	at eu.stamp_project.utils.compilation.TestCompiler.compileAndRun(TestCompiler.java:131)
	at eu.stamp_project.dspot.assertgenerator.MethodsAssertGenerator.addAssertions(MethodsAssertGenerator.java:118)
	at eu.stamp_project.dspot.assertgenerator.AssertGenerator.innerAssertionAmplification(AssertGenerator.java:139)
	at eu.stamp_project.dspot.assertgenerator.AssertGenerator.assertionAmplification(AssertGenerator.java:77)
	at eu.stamp_project.dspot.Amplification.assertionsAmplification(Amplification.java:214)
	at eu.stamp_project.dspot.Amplification.amplification(Amplification.java:108)
	at eu.stamp_project.dspot.DSpot._amplify(DSpot.java:274)
	at eu.stamp_project.dspot.DSpot._amplifyTestClass(DSpot.java:266)
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
	at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
	at eu.stamp_project.dspot.DSpot._amplifyTestClasses(DSpot.java:262)
	at eu.stamp_project.dspot.DSpot.amplifyAllTests(DSpot.java:147)
	at eu.stamp_project.Main.run(Main.java:52)
	at eu.stamp_project.DSpotMojo.execute(DSpotMojo.java:351)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:956)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:192)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[INFO] Could not generate any test with assertions
[INFO] 0 amplified test methods has been selected to be kept. (global: 0)
[INFO] elapsedTime 2172
[WARNING] DSpot could not obtain any amplified test method.

Steps to reproduce

Test with OW2 Joram: see https://github.com/STAMP-project/descartes-usecases-output/blob/master/OW2/Joram for detailed process.

When it comes to using DSpot, do as described, then add the following steps in joram/joram/mom/core directory:

mvn clean install
mvn eu.stamp-project:dspot-maven:2.1.1-SNAPSHOT:amplify-unit-tests -Dgenerate-new-test-class=true -Diteration=1

The build succeeds, but several exceptions (as described above) are displayed, and no test is generated.
All exceptions seem related to already amplified tests, that can't be amplified again.

This has been fixed with #827
Thank you.