rjust / defects4j

A Database of Real Faults and an Experimental Infrastructure to Enable Controlled Experiments in Software Engineering Research
MIT License
704 stars 298 forks source link

Mutation analysis fails on 92 bugs #502

Open jose opened 1 year ago

jose commented 1 year ago

Hi @rjust,

Have you performed mutation analysis on all bugs recently? I've just done it and it has failed on 92 bugs.

Bug Failure
Chart-10 Cannot mutate project
Closure-73 OutOfMemoryError (-Xmx8192M -XX:MaxHeapSize=1024M)
Closure-145 OutOfMemoryError (-Xmx8192M -XX:MaxHeapSize=1024M)
Collections-25 Mutation operator?
Collections-26 Mutation operator?
Collections-27 Mutation operator?
Collections-28 Mutation operator?
Compress-40 Major: NullPointerException
Compress-41 Major: NullPointerException
Compress-42 Major: NullPointerException
Compress-43 Major: NullPointerException
Compress-44 Major: NullPointerException
Compress-45 Major: NullPointerException
Compress-46 Major: NullPointerException
Compress-47 Major: NullPointerException
Csv-14 Major: NullPointerException
Csv-15 Major: NullPointerException
Csv-16 Major: NullPointerException
Gson-14 Erroneous mml file
Gson-16 Erroneous mml file
Gson-18 Erroneous mml file
JacksonDatabind-50 Major: NullPointerException
JacksonDatabind-51 Major: NullPointerException
JacksonDatabind-52 Major: NullPointerException
JacksonDatabind-54 Major: NullPointerException
JacksonDatabind-59 Major: NullPointerException
JacksonDatabind-60 Major: NullPointerException
JacksonDatabind-61 Major: NullPointerException
JacksonDatabind-63 Major: NullPointerException
JacksonDatabind-64 Major: NullPointerException
JacksonDatabind-65 Major: NullPointerException
JacksonDatabind-66 Major: NullPointerException
JacksonDatabind-67 Major: NullPointerException
JacksonDatabind-68 Major: NullPointerException
JacksonDatabind-70 Major: NullPointerException
JacksonDatabind-73 Major: NullPointerException
JacksonDatabind-74 Major: NullPointerException
JacksonDatabind-75 Major: NullPointerException
JacksonDatabind-76 Major: NullPointerException
JacksonDatabind-78 Major: NullPointerException
JacksonDatabind-80 Major: NullPointerException
JacksonDatabind-81 Major: NullPointerException
JacksonDatabind-82 Major: NullPointerException
JacksonDatabind-83 Major: NullPointerException
JacksonDatabind-84 Major: NullPointerException
JacksonDatabind-85 Major: NullPointerException
JacksonDatabind-86 Major: NullPointerException
JacksonDatabind-87 Major: NullPointerException
JacksonDatabind-88 Major: NullPointerException
JacksonDatabind-89 Major: NullPointerException
JacksonDatabind-90 Major: NullPointerException
JacksonDatabind-91 Major: NullPointerException
JacksonDatabind-92 OutOfMemoryError (-Xmx8192M -XX:MaxHeapSize=1024M)
JacksonDatabind-93 Major: NullPointerException
JacksonDatabind-95 Major: NullPointerException
JacksonDatabind-96 Major: NullPointerException
JacksonDatabind-97 Major: NullPointerException
JacksonDatabind-98 Major: NullPointerException
JacksonDatabind-99 Major: NullPointerException
JacksonDatabind-100 Major: NullPointerException
JacksonDatabind-101 Major: NullPointerException
JacksonDatabind-102 Major: NullPointerException
JacksonDatabind-103 Major: NullPointerException
JacksonDatabind-104 Major: NullPointerException
JacksonDatabind-105 Major: NullPointerException
JacksonDatabind-106 Major: NullPointerException
JacksonDatabind-107 Major: NullPointerException
JacksonDatabind-108 Major: NullPointerException
JacksonDatabind-109 Major: NullPointerException
JacksonDatabind-110 Major: NullPointerException
JacksonDatabind-111 Major: NullPointerException
JacksonDatabind-112 Major: NullPointerException
Jsoup-4 Code too large
Jsoup-6 Code too large
Jsoup-9 Code too large
Jsoup-67 Major: AssertionFailedError
Mockito-1 Unresolved references to major.mutation
Mockito-2 Unresolved references to major.mutation
Mockito-3 Unresolved references to major.mutation
Mockito-4 Unresolved references to major.mutation
Mockito-5 Unresolved references to major.mutation
Mockito-6 Cannot mutate project
Mockito-7 Unresolved references to major.mutation
Mockito-8 Unresolved references to major.mutation
Mockito-9 Unresolved references to major.mutation
Mockito-10 Unresolved references to major.mutation
Mockito-11 Unresolved references to major.mutation
Mockito-18 Unresolved references to major.mutation
Mockito-19 Unresolved references to major.mutation
Mockito-20 Unresolved references to major.mutation
Mockito-21 Unresolved references to major.mutation
Mockito-35 Cannot mutate project

Chart-10

Check out program version: Chart-10f....................................... OK
Compiling mutant definition (mml).......................................... OK
Running ant (mutate)....................................................... OK
Cannot mutate project! at /tmp/defects4j/framework/bin/d4j/d4j-mutation line 149.
Compilation failed in require at /tmp/defects4j/framework/bin/defects4j line 195.

Closure-{73, 145}

mutation.test:
     [echo] Running mutation analysis ...
    [junit] MAJOR: Mutation analysis enabled
    [junit] MAJOR: ------------------------------------------------------------
    [junit] MAJOR: Run 199 ordered tests to verify independence
    [junit] MAJOR: ------------------------------------------------------------
    [junit] MAJOR: Preprocessing time: 125.85 seconds
    [junit] MAJOR: ------------------------------------------------------------
    [junit] MAJOR: Mutants generated: 1130
    [junit] MAJOR: Mutants covered:   1105 (97.79%)
    [junit] MAJOR: ------------------------------------------------------------
    [junit] MAJOR: Export test map to testMap.csv
    [junit] MAJOR: ------------------------------------------------------------
    [junit] MAJOR: Run mutation analysis with 199 individual tests
    [junit] MAJOR: ------------------------------------------------------------
    [junit] MAJOR: 1/199 - com.google.javascript.jscomp.GlobalNamespaceTest (3ms / 0):
    [junit] MAJOR: 0 (0 / 0 / 0) -> AVG-RTPM: 0ms
    [junit] MAJOR: Mutants killed / live: 0 (0-0-0) / 1105
    ...
    ...
    ...
    [junit] MAJOR: ------------------------------------------------------------
    [junit] MAJOR: 70/199 - com.google.javascript.jscomp.PeepholeOptimizationsPassTest (194ms / 97):
    [junit] MAJOR: 574700 (0 / 54 / 97) -> AVG-RTPM: 262ms
    [junit] MAJOR: Mutants killed / live: 210 (107-103-0) / 895
    [junit] MAJOR: ------------------------------------------------------------
    [junit] MAJOR: 71/199 - com.google.javascript.jscomp.ControlStructureCheckTest (197ms / 276):

BUILD FAILED
/tmp/defects4j/framework/projects/defects4j.build.xml:225: java.lang.OutOfMemoryError: unable to create new native thread
        at java.lang.Thread.start0(Native Method)
        at java.lang.Thread.start(Thread.java:717)
        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeInVM(JUnitTask.java:1464)
        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.java:872)
        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeOrQueue(JUnitTask.java:1972)
        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute1(JUnitTask.java:824)
        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.java:2597)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
        at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:392)
        at org.apache.tools.ant.Target.performTasks(Target.java:413)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
        at org.apache.tools.ant.Main.runBuild(Main.java:811)
        at org.apache.tools.ant.Main.startAnt(Main.java:217)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

Total time: 12 minutes 17 seconds

Collections-{25, 26, 27, 28}

[javac] /localtmp/slurm_328019/jcampos-26692-ceb13bf9b78456d3876957bbb7ca9a71-Collections-25f/src/main/java/org/apache/commons/collections4/bidimap/TreeBidiMap.java:1695: error: name clash: remove() in TreeBidiMap.ViewIterator and remove() in Iterator have the same erasure, yet neither overrides the other
[javac]     class ViewMapIterator extends ViewIterator implements OrderedMapIterator<K, V> {
[javac]     ^
[javac] /localtmp/slurm_328019/jcampos-26692-ceb13bf9b78456d3876957bbb7ca9a71-Collections-25f/src/main/java/org/apache/commons/collections4/bidimap/TreeBidiMap.java:1736: error: name clash: remove() in TreeBidiMap.ViewIterator and remove() in Iterator have the same erasure, yet neither overrides the other
[javac]     class InverseViewMapIterator extends ViewIterator implements OrderedMapIterator<V, K> {
[javac]     ^
[javac] /localtmp/slurm_328019/jcampos-26692-ceb13bf9b78456d3876957bbb7ca9a71-Collections-25f/src/main/java/org/apache/commons/collections4/bidimap/TreeBidiMap.java:1777: error: name clash: remove() in TreeBidiMap.ViewIterator and remove() in Iterator have the same erasure, yet neither overrides the other
[javac]     class ViewMapEntryIterator extends ViewIterator implements OrderedIterator<Map.Entry<K, V>> {
[javac]     ^
[javac] /localtmp/slurm_328019/jcampos-26692-ceb13bf9b78456d3876957bbb7ca9a71-Collections-25f/src/main/java/org/apache/commons/collections4/bidimap/TreeBidiMap.java:1798: error: name clash: remove() in TreeBidiMap.ViewIterator and remove() in Iterator have the same erasure, yet neither overrides the other
[javac]     class InverseViewMapEntryIterator extends ViewIterator implements OrderedIterator<Map.Entry<V, K>> {
[javac]     ^
[javac] Note: /localtmp/slurm_328019/jcampos-26692-ceb13bf9b78456d3876957bbb7ca9a71-Collections-25f/src/main/java/org/apache/commons/collections4/collection/IndexedCollection.java has additional uses or overrides of a deprecated API.
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 4 errors
[javac] 100 warnings
[javac] #Generated Mutants: 99 (3442 ms)

Compress-{40, 41, 42, 43, 44, 45, 46, 47}

mutation.test:
     [echo] Running mutation analysis ...
    [junit] MAJOR: Mutation analysis enabled
    [junit] MAJOR: org.apache.commons.compress.archivers.SevenZTestCase[testSevenZArchiveCreationUsingCopy] failed!
    [junit] MAJOR:  -> java.lang.NullPointerException
    [junit] MAJOR:  -> "null"
    [junit] MAJOR: org.apache.commons.compress.archivers.SevenZTestCase[testSevenZArchiveCreationUsingBZIP2] failed!
    [junit] MAJOR:  -> java.lang.NullPointerException
    [junit] MAJOR:  -> "null"
    [junit] MAJOR: org.apache.commons.compress.archivers.SevenZTestCase[testSevenZArchiveCreationUsingLZMA2] failed!
    [junit] MAJOR:  -> java.lang.NullPointerException
    [junit] MAJOR:  -> "null"
    [junit] MAJOR: org.apache.commons.compress.archivers.SevenZTestCase[testSevenZArchiveCreationUsingDeflate] failed!
    [junit] MAJOR:  -> java.lang.NullPointerException
    [junit] MAJOR:  -> "null"

Csv-{14, 15, 16}

mutation.test:
     [echo] Running mutation analysis ...
    [junit] MAJOR: Mutation analysis enabled
    [junit] MAJOR: org.apache.commons.csv.CSVFormatTest[testNullRecordSeparatorCsv106] failed!
    [junit] MAJOR:  -> java.lang.NullPointerException
    [junit] MAJOR:  -> "null"
    [junit] MAJOR: org.apache.commons.csv.CSVFormatTest[testFormat] failed!
    [junit] MAJOR:  -> java.lang.NullPointerException
    [junit] MAJOR:  -> "null"

Gson-{14, 16, 18}

Check out program version: Gson-18f........................................ OK
Compiling mutant definition (mml).......................................... FAIL
Executed command: /tmp/defects4j/major/bin/mmlc /localtmp/slurm_327910/jcampos-5920-4c435a50cd2d8763e667d4e8be954d8e-Gson-18f/.mml/default.mml 2>&1
Warning: Operator LVR has already been disabled for [org, apache, commons, math3, util, FastMathLiteralArrays]
Warning: Operator ORU has already been disabled for [org, apache, commons, math3, util, FastMathLiteralArrays]
Warning: Operator LVR has already been disabled for [org, apache, commons, math, optimization, direct, BOBYQAOptimizer, bobyqb]
Warning: Operator STD has already been disabled for [org, apache, commons, math, optimization, direct, BOBYQAOptimizer, bobyqb]
line 62:42 Error: invalid scope: com.google.gson.internal.$Gson$Types
line 63:42 Error: invalid scope: com.google.gson.internal.$Gson$Types
line 64:42 Error: invalid scope: com.google.gson.internal.$Gson$Types
line 65:42 Error: invalid scope: com.google.gson.internal.$Gson$Types
line 66:42 Error: invalid scope: com.google.gson.internal.$Gson$Types
line 67:42 Error: invalid scope: com.google.gson.internal.$Gson$Types
line 68:42 Error: invalid scope: com.google.gson.internal.$Gson$Types
line 69:42 Error: invalid scope: com.google.gson.internal.$Gson$Types

The compilation process ended with errors!
Cannot compile mml file: /localtmp/slurm_327910/jcampos-5920-4c435a50cd2d8763e667d4e8be954d8e-Gson-18f/.mml/default.mml! at /tmp/defects4j/framework/core/Mutation.pm line 99.
Compilation failed in require at /tmp/defects4j/framework/bin/defects4j line 195.

JacksonDatabind-{50, 51, 52, 54, 59, 60, 61, 63, 64, 65, 66, 67, 68, 70, 73, 74, 75, 76, 78, 83, 84, 85, 87, 88, 89, 91, 93, 95}

mutation.test:
     [echo] Running mutation analysis ...
    [junit] MAJOR: Mutation analysis enabled
    [junit] MAJOR: com.fasterxml.jackson.databind.ObjectMapperTest[testProviderConfig] failed!
    [junit] MAJOR:  -> java.lang.NullPointerException
    [junit] MAJOR:  -> "null"
    [junit] MAJOR: com.fasterxml.jackson.databind.ObjectMapperTest[testDataInputViaMapper] failed!
    [junit] MAJOR:  -> java.lang.NullPointerException
    [junit] MAJOR:  -> "null"
    [junit] MAJOR: com.fasterxml.jackson.databind.ObjectMapperTest[testTreeRead] failed!
    [junit] MAJOR:  -> java.lang.NullPointerException
    [junit] MAJOR:  -> "null"

JacksonDatabind-{80, 81, 109}

mutation.test:
     [echo] Running mutation analysis ...
    [junit] MAJOR: Mutation analysis enabled
    [junit] MAJOR: com.fasterxml.jackson.databind.ObjectMapperTest[testProviderConfig] failed!
    [junit] MAJOR:  -> java.lang.NullPointerException
    [junit] MAJOR:  -> "null"
    [junit] MAJOR: com.fasterxml.jackson.databind.ObjectMapperTest[testDataInputViaMapper] failed!
    [junit] MAJOR:  -> java.lang.NullPointerException
    [junit] MAJOR:  -> "null"

JacksonDatabind-{82, 86, 90, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 110, 111, 112}

mutation.test:
     [echo] Running mutation analysis ...
    [junit] MAJOR: Mutation analysis enabled
    [junit] MAJOR: com.fasterxml.jackson.databind.FullStreamReadTest[testReaderAcceptTrailing] failed!
    [junit] MAJOR:  -> java.lang.NullPointerException
    [junit] MAJOR:  -> "null"
    [junit] MAJOR: com.fasterxml.jackson.databind.FullStreamReadTest[testMapperFailOnTrailing] failed!
    [junit] MAJOR:  -> java.lang.NullPointerException
    [junit] MAJOR:  -> "null"
    [junit] MAJOR: com.fasterxml.jackson.databind.FullStreamReadTest[testMapperAcceptTrailing] failed!
    [junit] MAJOR:  -> java.lang.NullPointerException
    [junit] MAJOR:  -> "null"
    [junit] MAJOR: com.fasterxml.jackson.databind.FullStreamReadTest[testReaderFailOnTrailing] failed!
    [junit] MAJOR:  -> java.lang.NullPointerException
    [junit] MAJOR:  -> "null"

JacksonDatabind-92

mutation.test:
     [echo] Running mutation analysis ...
    [junit] MAJOR: Mutation analysis enabled
    [junit] MAJOR: ------------------------------------------------------------
    [junit] MAJOR: Run 312 ordered tests to verify independence
    [junit] MAJOR: ------------------------------------------------------------
    [junit] MAJOR: Preprocessing time: 208.77 seconds
    [junit] MAJOR: ------------------------------------------------------------
    [junit] MAJOR: Mutants generated: 237
    [junit] MAJOR: Mutants covered:   231 (97.47%)
    [junit] MAJOR: ------------------------------------------------------------
    [junit] MAJOR: Export test map to testMap.csv
    [junit] MAJOR: ------------------------------------------------------------
    [junit] MAJOR: Run mutation analysis with 312 individual tests
    [junit] MAJOR: ------------------------------------------------------------
    [junit] MAJOR: 1/312 - com.fasterxml.jackson.databind.introspect.IntrospectorPairTest (1ms / 18):
    [junit] MAJOR: 4079 (1 / 18 / 18) -> AVG-RTPM: 226ms
    [junit] MAJOR: Mutants killed / live: 1 (0-1-0) / 230
    [junit] MAJOR: ------------------------------------------------------------
    [junit] MAJOR: 141/312 - com.fasterxml.jackson.databind.jsontype.PolymorphicList1451SerTest (58ms / 125):
    [junit] MAJOR: 1717486 (0 / 67 / 125) -> AVG-RTPM: 252ms
    [junit] MAJOR: Mutants killed / live: 96 (25-71-0) / 135
    [junit] MAJOR: ------------------------------------------------------------
    [junit] MAJOR: 142/312 - com.fasterxml.jackson.databind.deser.TestGenericMapDeser (59ms / 125):

BUILD FAILED
/tmp/defects4j/framework/projects/defects4j.build.xml:225: java.lang.OutOfMemoryError: unable to create new native thread
        at java.lang.Thread.start0(Native Method)
        at java.lang.Thread.start(Thread.java:717)
        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeInVM(JUnitTask.java:1464)
        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.java:872)
        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeOrQueue(JUnitTask.java:1972)
        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute1(JUnitTask.java:824)
        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.java:2597)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
        at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:392)
        at org.apache.tools.ant.Target.performTasks(Target.java:413)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
        at org.apache.tools.ant.Main.runBuild(Main.java:811)
        at org.apache.tools.ant.Main.startAnt(Main.java:217)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

Total time: 32 minutes 12 seconds

Jsoup-{4, 6, 9}

[javac] /localtmp/slurm_328012/jcampos-47013-8fd3fe1f5c05f522888ce654f911e374-Jsoup-6f/src/main/java/org/jsoup/nodes/Entities.java:22: error: code too large
[javac]     private static final Pattern unescapePattern = Pattern.compile("&(#(x|X)?([0-9a-fA-F]+)|[a-zA-Z]+);?");
[javac]                                  ^
[javac] #Generated Mutants: 4347 (905 ms)

Quick workaround: we could setup major to not apply one specific mutation operator (or several) to the org.jsoup.nodes.Entities class as we've done for other classes. Question is, which mutation operator(s) should we exclude from being applied to the org.jsoup.nodes.Entities class to avoid the code too large error?

Jsoup-67

mutation.test:
     [echo] Running mutation analysis ...
    [junit] MAJOR: Mutation analysis enabled
    [junit] MAJOR: ------------------------------------------------------------
    [junit] MAJOR: Run 28 ordered tests to verify independence
    [junit] MAJOR: org.jsoup.parser.HtmlParserTest[handlesDeepStack] failed!
    [junit] MAJOR:  -> AssertionFailedError
    [junit] MAJOR:  -> "null"

Mockito-{1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 18, 19, 20, 21}

gradle.compile.mutants:
     [exec] Downloading file:/tmp/defects4j/framework/lib/build_systems/gradle/dists/gradle-1.12-bin.zip
     [exec] Unzipping /localtmp/slurm_328335/jcampos-9895-ff2edc7fd262285c28bd8f1ced2e0070-Mockito-11f/.gradle_local_home/wrapper/dists/gradle-1.12-bin/4o1khcrip18j0l7pftei7hhkte/gradle-1.12-bin.zip to /localtmp/slurm_328335/jcampos-9895-ff2edc7fd262285c28bd8f1ced2e0070-Mockito-11f/.gradle_local_home/wrapper/dists/gradle-1.12-bin/4o1khcrip18j0l7pftei7hhkte
     [exec] Set executable permissions for: /localtmp/slurm_328335/jcampos-9895-ff2edc7fd262285c28bd8f1ced2e0070-Mockito-11f/.gradle_local_home/wrapper/dists/gradle-1.12-bin/4o1khcrip18j0l7pftei7hhkte/gradle-1.12/bin/gradle
     [exec] Set executable permissions for: /localtmp/slurm_328335/jcampos-9895-ff2edc7fd262285c28bd8f1ced2e0070-Mockito-11f/.gradle_local_home/wrapper/dists/gradle-1.12-bin/4o1khcrip18j0l7pftei7hhkte/gradle-1.12/bin/gradle
     [exec] Parallel execution is an incubating feature.
     [exec] :buildSrc:clean UP-TO-DATE
     [exec] :buildSrc:compileJava UP-TO-DATE
     [exec] :buildSrc:compileGroovy
     [exec] :buildSrc:processResources UP-TO-DATE
     [exec] :buildSrc:classes
     [exec] :buildSrc:jar
     [exec] :buildSrc:assemble
     [exec] :buildSrc:compileTestJava UP-TO-DATE
     [exec] :buildSrc:compileTestGroovy
     [exec] :buildSrc:processTestResources UP-TO-DATE
     [exec] :buildSrc:testClasses
     [exec] :buildSrc:test
     [exec] :buildSrc:check
     [exec] :buildSrc:build
     [exec] Download https://jcenter.bintray.com/com/android/tools/build/gradle/0.11.2/gradle-0.11.2.pom
     [exec] Please update your dependency to directly use the correct version 'xml-apis#xml-apis;1.0.b2'.
     [exec] Resolution will only pick dependencies of the relocated element.  Artifacts and other metadata will be ignored.
     [exec] POM relocation to an other version number is not fully supported in Gradle : xml-apis#xml-apis;2.0.2 relocated to xml-apis#xml-apis;1.0.b2.
     [exec] Version: 1.10.1-dev
     [exec] :compileJava
     [exec] :testng:processResources
     [exec] :extTest:compileJava UP-TO-DATE
     [exec] :testng:processResources UP-TO-DATE
     [exec] :extTest:processResources UP-TO-DATE
     [exec] :extTest:classes UP-TO-DATE
     [exec] Major: Mutation enabled using mml file: /localtmp/slurm_328335/jcampos-9895-ff2edc7fd262285c28bd8f1ced2e0070-Mockito-11f/.mml/default.mml.bin
     [exec] Note: Some input files use or override a deprecated API.
     [exec] Note: Recompile with -Xlint:deprecation for details.
     [exec] Note: Some input files use unchecked or unsafe operations.
     [exec] Note: Recompile with -Xlint:unchecked for details.
     [exec] #Generated Mutants: 10 (822 ms)
     [exec] :processResources UP-TO-DATE
     [exec] :classes
     [exec] :jar
     [exec] Buildfile: /tmp/slurm_328335/jcampos-9895-ff2edc7fd262285c28bd8f1ced2e0070-Mockito-11f/build-ant.xml
     [exec]
     [exec] bndCore:
     [exec]
     [exec] BUILD FAILED
     [exec] /tmp/slurm_328335/jcampos-9895-ff2edc7fd262285c28bd8f1ced2e0070-Mockito-11f/build-ant.xml:26: Failed to build jar file:
     [exec]
     [exec] Total time: 0 seconds
     [exec]
     [exec] FAILURE: Build failed with an exception.
     [exec]
     [exec] * Where:
     [exec] Build file '/tmp/slurm_328335/jcampos-9895-ff2edc7fd262285c28bd8f1ced2e0070-Mockito-11f/build.gradle' line: 131
     [exec]
     [exec] * What went wrong:
     [exec] Execution failed for task ':jar'.
     [exec] > Process 'command 'ant'' finished with non-zero exit value 1
     [exec]
     [exec] * Try:
     [exec] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
     [exec]       [bnd] Errors
     [exec]       [bnd] Unresolved references to [major.mutation] by class(es) on the Bundle-Classpath[Jar:dot]: [org/mockito/internal/creation/DelegatingMethod.class]
     [exec]       [bnd] /tmp/slurm_328335/jcampos-9895-ff2edc7fd262285c28bd8f1ced2e0070-Mockito-11f/conf/mockito-core.bnd: bnd failed
     [exec]       [bnd]         at aQute.bnd.ant.BndTask.executeBackwardCompatible(BndTask.java:128)
     [exec]       [bnd]         at aQute.bnd.ant.BndTask.execute(BndTask.java:28)
     [exec]       [bnd]         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
     [exec]       [bnd]         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [exec]       [bnd]         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
     [exec]       [bnd]         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     [exec]       [bnd]         at java.lang.reflect.Method.invoke(Method.java:498)
     [exec]       [bnd]         at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
     [exec]       [bnd]         at org.apache.tools.ant.Task.perform(Task.java:348)
     [exec]       [bnd]         at org.apache.tools.ant.Target.execute(Target.java:392)
     [exec]       [bnd]         at org.apache.tools.ant.Target.performTasks(Target.java:413)
     [exec]       [bnd]         at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
     [exec]       [bnd]         at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
     [exec]       [bnd]         at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
     [exec]       [bnd]         at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
     [exec]       [bnd]         at org.apache.tools.ant.Main.runBuild(Main.java:811)
     [exec]       [bnd]         at org.apache.tools.ant.Main.startAnt(Main.java:217)
     [exec]       [bnd]         at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
     [exec]       [bnd]         at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
     [exec] :jar FAILED
     [exec]
     [exec] BUILD FAILED
     [exec]
     [exec] Total time: 28.776 secs

Mockito-{6, 35}

Compiling mutant definition (mml).......................................... OK
Running ant (mutate)....................................................... OK
Cannot mutate project! at /tmp/defects4j/framework/bin/d4j/d4j-mutation line 149.
Compilation failed in require at /tmp/defects4j/framework/bin/defects4j line 195.

This analysis was conducted with Major v1.3.1 and I'm now wondering whether the latest version v2.0.0 addresses some of these issues. For example, according to its changelog, v2.0.0 addresses the code too large error. I will give v2.0.0 a try and let you know whether some of the issues reported above are no longer an issue in v2.0.0, or if there is any other unknown issue. (I might need to use the update-major branch for that.)

-- Best, Jose

jose commented 1 year ago

I've just tried Major v2.0.0 on a few bugs and I'm afraid it doesn't work as expected.

Chart-10

[mkdir] Created dir: /localtmp/slurm_328512/jcampos-464/build
[javac] /tmp/defects4j/framework/projects/Chart/Chart.build.xml:57: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
[javac] Compiling 578 source files to /localtmp/slurm_328512/jcampos-464/build
[javac] Picked up _JAVA_OPTIONS: -Xmx8192M -XX:MaxHeapSize=1024M
[javac] warning: [options] bootstrap class path not set in conjunction with -source 1.4
[javac] warning: [options] source value 1.4 is obsolete and will be removed in a future release
[javac] warning: [options] target value 1.4 is obsolete and will be removed in a future release
[javac] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
[javac] Exception in thread "main" java.lang.RuntimeException: java.lang.OutOfMemoryError: Java heap space
[javac]     at com.sun.tools.javac.main.Main.compile(Main.java:559)
[javac]     at com.sun.tools.javac.main.Main.compile(Main.java:381)
[javac]     at com.sun.tools.javac.main.Main.compile(Main.java:370)
[javac]     at com.sun.tools.javac.main.Main.compile(Main.java:361)
[javac]     at com.sun.tools.javac.Main.compile(Main.java:56)
[javac]     at com.sun.tools.javac.Main.main(Main.java:42)
[javac] Caused by: java.lang.OutOfMemoryError: Java heap space
[javac]     at java.util.Arrays.copyOf(Arrays.java:3332)
[javac]     at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:124)
[javac]     at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:448)
[javac]     at java.lang.StringBuilder.append(StringBuilder.java:136)
[javac]     at java.lang.StringBuilder.append(StringBuilder.java:76)
[javac]     at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:484)
[javac]     at java.lang.StringBuilder.append(StringBuilder.java:166)
[javac]     at java.lang.StringBuilder.append(StringBuilder.java:76)
[javac]     at java.util.Formatter$FixedString.print(Formatter.java:2595)
[javac]     at java.util.Formatter.format(Formatter.java:2508)
[javac]     at java.util.Formatter.format(Formatter.java:2455)
[javac]     at java.lang.String.format(String.java:2940)
[javac]     at org.mutationtesting.major.mutation.tree.AttrTreeCopier.visitMethod(AttrTreeCopier.java:833)
[javac]     at org.mutationtesting.major.mutation.tree.AttrTreeCopier.visitMethod(AttrTreeCopier.java:132)
[javac]     at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:800)
[javac]     at org.mutationtesting.major.mutation.tree.AttrTreeCopier.copy(AttrTreeCopier.java:216)
[javac]     at org.mutationtesting.major.mutation.tree.AttrTreeCopier.copy(AttrTreeCopier.java:244)
[javac]     at org.mutationtesting.major.mutation.tree.AttrTreeCopier.visitClass(AttrTreeCopier.java:667)
[javac]     at org.mutationtesting.major.mutation.tree.AttrTreeCopier.visitClass(AttrTreeCopier.java:132)
[javac]     at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:720)
[javac]     at org.mutationtesting.major.mutation.tree.AttrTreeCopier.copy(AttrTreeCopier.java:216)
[javac]     at org.mutationtesting.major.mutation.tree.AttrTreeCopier.copy(AttrTreeCopier.java:207)
[javac]     at org.mutationtesting.major.mutation.Mutator.isMutantValid(Mutator.java:2313)
[javac]     at org.mutationtesting.major.mutation.Mutator.replaceTreeWithDefault(Mutator.java:1741)
[javac]     at org.mutationtesting.major.mutation.Mutator.visitVarDef(Mutator.java:753)
[javac]     at com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:852)
[javac]     at com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
[javac]     at org.mutationtesting.major.mutation.Mutator.translate(Mutator.java:448)
[javac]     at com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:70)

Collections-25

mutation.test:
     [echo] Running mutation analysis ...
    [junit] MAJOR: Mutation analysis enabled
    [junit] MAJOR: ------------------------------------------------------------
    [junit] MAJOR: Run 682 ordered test(s)to verify independence
    [junit] MAJOR: junit.framework.TestSuite$1[warning] failed!
    [junit] MAJOR:  -> AssertionFailedError
    [junit] MAJOR:  -> "Class org.apache.commons.collections4.bidimap.AbstractBidiMapTest$TestInverseBidiMap has no public constructor TestCase(String name) or TestCase()"

Compress-40

commons-compress-from-maven.compile:
    [mkdir] Created dir: /localtmp/slurm_328514/jcampos-9379/target/classes
    [javac] /localtmp/slurm_328514/jcampos-9379/maven-build.xml:89: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
    [javac] Compiling 166 source files to /localtmp/slurm_328514/jcampos-9379/target/classes
    [javac] Picked up _JAVA_OPTIONS: -Xmx8192M -XX:MaxHeapSize=1024M
    [javac] warning: [options] bootstrap class path not set in conjunction with -source 1.7
    [javac] /localtmp/slurm_328514/jcampos-9379/src/main/java/org/apache/commons/compress/compressors/snappy/PureJavaCrc32C.java:116: error: code too large
    [javac]   private static final int[] T = new int[] {
    [javac]                              ^
    [javac] Generated 27861 mutants (19401 ms)
    [javac] 1 error
    [javac] 1 warning

Gson-14

Compiling mutant definition (mml).......................................... FAIL
Executed command: /tmp/defects4j/major/bin/mmlc /localtmp/slurm_328515/jcampos-12643/.mml/default.mml 2>&1
Warning: Operator LVR has already been disabled for [org, apache, commons, math3, util, FastMathLiteralArrays]
Warning: Operator ORU has already been disabled for [org, apache, commons, math3, util, FastMathLiteralArrays]
Warning: Operator LVR has already been disabled for [org, apache, commons, math, optimization, direct, BOBYQAOptimizer, bobyqb]
Warning: Operator STD has already been disabled for [org, apache, commons, math, optimization, direct, BOBYQAOptimizer, bobyqb]
line 62:42 Error: invalid scope: com.google.gson.internal.$Gson$Types
line 63:42 Error: invalid scope: com.google.gson.internal.$Gson$Types
line 64:42 Error: invalid scope: com.google.gson.internal.$Gson$Types
line 65:42 Error: invalid scope: com.google.gson.internal.$Gson$Types
line 66:42 Error: invalid scope: com.google.gson.internal.$Gson$Types
line 67:42 Error: invalid scope: com.google.gson.internal.$Gson$Types
line 68:42 Error: invalid scope: com.google.gson.internal.$Gson$Types
line 69:42 Error: invalid scope: com.google.gson.internal.$Gson$Types
[!!!] Parsing encountered an error
[!!!]
The compilation process ended with errors!
Cannot compile mml file: /localtmp/slurm_328515/jcampos-12643/.mml/default.mml! at /tmp/defects4j/framework/core/Mutation.pm line 99.
Compilation failed in require at /tmp//defects4j/framework/bin/defects4j line 195.

JacksonDatabind-50

jackson-databind-from-maven.compile:
    [mkdir] Created dir: /localtmp/slurm_328516/jcampos-13143/target/classes
    [javac] /localtmp/slurm_328516/jcampos-13143/maven-build.xml:92: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
    [javac] Compiling 399 source files to /localtmp/slurm_328516/jcampos-13143/target/classes
    [javac] /localtmp/slurm_328516/jcampos-13143/src/main/java/com/fasterxml/jackson/databind/ser/PropertyBuilder.java:158: warning: [deprecation] WRITE_EMPTY_JSON_ARRAYS in SerializationFeature has been deprecated
    [javac]                     && !_config.isEnabled(SerializationFeature.WRITE_EMPTY_JSON_ARRAYS)) {
    [javac]                                                               ^
    [javac] Exception in thread "main" java.lang.RuntimeException: java.lang.OutOfMemoryError: GC overhead limit exceeded
    [javac]     at com.sun.tools.javac.main.Main.compile(Main.java:559)
    [javac]     at com.sun.tools.javac.main.Main.compile(Main.java:381)
    [javac]     at com.sun.tools.javac.main.Main.compile(Main.java:370)
    [javac]     at com.sun.tools.javac.main.Main.compile(Main.java:361)
    [javac]     at com.sun.tools.javac.Main.compile(Main.java:56)
    [javac]     at com.sun.tools.javac.Main.main(Main.java:42)

Jsoup-4

jsoup-from-maven.compile:
    [mkdir] Created dir: /localtmp/slurm_328517/jcampos-24404/target/classes
    [javac] /localtmp/slurm_328517/jcampos-24404/maven-build.xml:74: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
    [javac] Compiling 32 source files to /localtmp/slurm_328517/jcampos-24404/target/classes
    [javac] Picked up _JAVA_OPTIONS: -Xmx8192M -XX:MaxHeapSize=1024M
    [javac] warning: [options] bootstrap class path not set in conjunction with -source 1.5
    [javac] warning: [options] source value 1.5 is obsolete and will be removed in a future release
    [javac] warning: [options] target value 1.5 is obsolete and will be removed in a future release
    [javac] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
    [javac] /localtmp/slurm_328517/jcampos-24404/src/main/java/org/jsoup/nodes/Entities.java:24: error: code too large
    [javac]     private static final Pattern unescapePattern = Pattern.compile("&(#(x|X)?([0-9a-fA-F]+)|[a-zA-Z]+);?");
    [javac]                                  ^
    [javac] Generated 6646 mutants (4301 ms)
    [javac] Note: /localtmp/slurm_328517/jcampos-24404/src/main/java/org/jsoup/nodes/Node.java uses unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.
    [javac] 1 error
    [javac] 4 warnings

Jsoup-67

mutation.test:
     [echo] Running mutation analysis ...
    [junit] MAJOR: Mutation analysis enabled
    [junit] MAJOR: ------------------------------------------------------------
    [junit] MAJOR: Run 28 ordered test(s)to verify independence
    [junit] MAJOR: org.jsoup.parser.HtmlParserTest[handlesDeepStack] failed!
    [junit] MAJOR:  -> AssertionFailedError
    [junit] MAJOR:  -> "null"

Mockito-1

Check out program version: Mockito-1f...................................... OK
Compiling mutant definition (mml).......................................... OK
Running ant (mutate)....................................................... OK
Cannot open mutants log: No such file or directory at /tmp/defects4j/framework/core/Project.pm line 856.
Compilation failed in require at /tmp//defects4j/framework/bin/defects4j line 195

Mockito-6

Check out program version: Mockito-6f...................................... OK
Compiling mutant definition (mml).......................................... OK
Running ant (mutate)....................................................... OK
Cannot open mutants log: No such file or directory at /tmp/defects4j/framework/core/Project.pm line 856.
Compilation failed in require at /tmp//defects4j/framework/bin/defects4j line 195.
jose commented 1 year ago

@rjust, I might be able to fix the AssertionFailedError and the NullPointerException. Just point me to Major's repository.

rjust commented 4 months ago

Hi @jose,

I spot-checked a couple of these with Major 2.1.0, which avoids code-too-large errors and includes a bunch of other fixes.

Running defects4j mutation works for most of them (update-major branch).

Two issues that remain:

  1. D4J does not distinguish between no mutants are generated because of an issue vs. no mutants generated for a tiny class that cannot be mutated (with default mutation operators). Chart-10 is an example. ==> We can probably improve the check or enable additional mutation operators to generate at least one mutant per class.
  2. JUnit throws an AssertionFailedError for a test class that has no public constructor or any runnable test methods. Major currently does not distinguish these test failures from other test failures. Collections-25 is an example. ==> Major probably should just just ignore empty test classes (are issue a warning instead of an error).

I'll add a test script that runs defects4j mutation on every single fixed version. This will make it easier to spot issues and rerun on future versions of Major.

Cheers, René