diff --git a/README.md b/README.md index cd50abf3c4dd8e5a8db35b85fe4036dcf97514b8..bfd5eee978cb5c0c75482dba59b875623c91fa20 100644 --- a/README.md +++ b/README.md @@ -76,4 +76,15 @@ Haskell packages: Other software: -- You will need the actual z3 \ No newline at end of file +- You will need the actual z3 + +### Pre-processing + +Some limitations in the current implementation requires the target source code to meet certain +syntactical constraints; so some pre-processing is required before a source file can be exposed +to javawlp. + +- Reference to an instance member x should be explicitly written as this.x +- Binary subexpressions should be explicitly parathesized since our parser does not take + Java's built in operators priority into account. So, instead of `x==y && x+z>0` write + `(x==y) && ((x+z)>0)` diff --git a/experiments/tools/major/bin/ant b/experiments/tools/major/bin/ant new file mode 100755 index 0000000000000000000000000000000000000000..b1e4751e4bcbe59ed5aa2ce5a79f1402cad13a1f --- /dev/null +++ b/experiments/tools/major/bin/ant @@ -0,0 +1,9 @@ +#!/bin/sh + +BASE="`dirname $0`/.." + +java \ + -XX:ReservedCodeCacheSize=128M \ + -XX:MaxPermSize=256M \ + -Xbootclasspath/a:$BASE/config/config.jar \ + -jar $BASE/lib/ant-launcher.jar $* diff --git a/experiments/tools/major/bin/javac b/experiments/tools/major/bin/javac new file mode 100755 index 0000000000000000000000000000000000000000..797d8f4dbaaeaca8b5bf299818b7bd1cebf5dd79 --- /dev/null +++ b/experiments/tools/major/bin/javac @@ -0,0 +1,20 @@ +#!/bin/sh + +DUALCASE=1 +OLD_IFS="$IFS" +nl=' +' +for i in "$@" ; do + IFS= + case $i in + -J* ) jopts=$jopts$nl`echo $i | sed -e 's/^-J//'` ;; + * ) opts=$opts$nl$i ;; + esac + IFS="$OLD_IFS" +done +unset DUALCASE + +BASE="`dirname $0`/.." + +IFS=$nl +java ${jopts} -Xbootclasspath/p:$BASE/lib/javac.jar -jar $BASE/lib/javac.jar ${opts} diff --git a/experiments/tools/major/bin/mmlc b/experiments/tools/major/bin/mmlc new file mode 100755 index 0000000000000000000000000000000000000000..a280201240f828065bd95595d4f672b86d72ffbc --- /dev/null +++ b/experiments/tools/major/bin/mmlc @@ -0,0 +1,10 @@ +#!/bin/sh + +if [ $# -lt 1 ]; then + echo "usage: $0 <script-file> [<out-file>]" + exit 1 +fi + +BASE="`dirname $0`/.." + +java -Xbootclasspath/p:$BASE/lib/mmlc.jar -Xbootclasspath/p:$BASE/lib/javac.jar -jar $BASE/lib/mmlc.jar $* diff --git a/experiments/tools/major/config/config.jar b/experiments/tools/major/config/config.jar new file mode 100644 index 0000000000000000000000000000000000000000..e4ccd78adaea165c77dc90e0b9038254b6f94e0e Binary files /dev/null and b/experiments/tools/major/config/config.jar differ diff --git a/experiments/tools/major/doc/major.pdf b/experiments/tools/major/doc/major.pdf new file mode 100644 index 0000000000000000000000000000000000000000..8bcc2a22ea35491833487d3573aa03eac9c63fd1 Binary files /dev/null and b/experiments/tools/major/doc/major.pdf differ diff --git a/experiments/tools/major/example/ant/build.xml b/experiments/tools/major/example/ant/build.xml new file mode 100755 index 0000000000000000000000000000000000000000..186cff271877a4b6dcefb98d7ded035743132999 --- /dev/null +++ b/experiments/tools/major/example/ant/build.xml @@ -0,0 +1,82 @@ +<project name="Triangle" default="compile" basedir="."> + +<!-- ############################################## + Path to Major and Mutation options + Use -Dmutation="=mml-file" to set path to mml-file + ############################################## --> + <property name="mutOp" value=":NONE"/> + <property name="mutator" value="-XMutator${mutOp}"/> + <property name="major" value="../../bin/javac"/> + + +<!-- Target to clean up --> + <target name="clean" description="Clean"> + <delete dir="bin"/> + <delete> + <fileset dir="." includes="*.csv"/> + <fileset dir="." includes="*.log"/> + </delete> + </target> + +<!-- Target to initialize build --> + <target name="init"> + <mkdir dir="bin"/> + </target> + +<!-- Target to compile the project --> + <target name="compile" depends="init" description="Compile"> + <javac includeantruntime="true" + srcdir="src" + destdir="bin" + debug="yes" + fork="yes" + executable="${major}"> + + <compilerarg value="${mutator}"/> + </javac> + </target> + +<!-- Target to compile the test suite --> + <target name="compile.tests" depends="compile" description="Compile all tests"> + <javac includeantruntime="true" + srcdir="test" + destdir="bin" + debug="yes"> + </javac> + </target> + +<!-- The adapted mutation test target --> + <target name="mutation.test" description="Run mutation analysis for all unit test cases"> + <echo message="Running mutation analysis ..."/> + <junit printsummary="false" + showoutput="false" + mutationAnalysis="true" + resultFile="results.csv" + killDetailsFile="killed.csv"> + + <classpath path="bin"/> + <batchtest fork="false"> + <fileset dir="test"> + <include name="**/*Test*.java"/> + </fileset> + </batchtest> + </junit> + </target> + +<!-- The original test target --> + <target name="test" depends="compile.tests" description="Run all unit test cases"> + <echo message="Running unit tests ..."/> + <junit printsummary="true" + showoutput="true" + haltonfailure="false"> + <formatter type="plain" usefile="false"/> + <classpath path="bin"/> + + <batchtest fork="no"> + <fileset dir="test"> + <include name="**/*Test*.java"/> + </fileset> + </batchtest> + </junit> + </target> +</project> diff --git a/experiments/tools/major/example/ant/run.sh b/experiments/tools/major/example/ant/run.sh new file mode 100755 index 0000000000000000000000000000000000000000..c1236156b4fbdce6b21fbe55a16075243d238f63 --- /dev/null +++ b/experiments/tools/major/example/ant/run.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +MAJOR_HOME="../.." + +echo +echo "Compiling and mutating project" +echo "(ant -DmutOp=\"=\$MAJOR_HOME/mml/tutorial.mml.bin\" clean compile)" +echo +$MAJOR_HOME/bin/ant -DmutOp="=$MAJOR_HOME/mml/tutorial.mml.bin" clean compile + +echo +echo "Compiling tests" +echo "(ant compile.tests)" +echo +$MAJOR_HOME/bin/ant compile.tests + +echo +echo "Run tests without mutation analysis" +echo "(ant test)" +$MAJOR_HOME/bin/ant test + +echo +echo "Run tests with mutation analysis" +echo "(ant mutation.test)" +$MAJOR_HOME/bin/ant mutation.test diff --git a/experiments/tools/major/example/ant/src/triangle/Triangle.java b/experiments/tools/major/example/ant/src/triangle/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..227da46cef6e9522de22400f7f55fd31a3157835 --- /dev/null +++ b/experiments/tools/major/example/ant/src/triangle/Triangle.java @@ -0,0 +1,35 @@ +package triangle; + +public class Triangle { + + public static enum Type { + INVALID, SCALENE, EQUILATERAL, ISOSCELES + }; + + public static Type classify(int a, int b, int c) { + int trian; + if (a <= 0 || b <= 0 || c <= 0) + return Type.INVALID; + trian = 0; + if (a == b) + trian = trian + 1; + if (a == c) + trian = trian + 2; + if (b == c) + trian = trian + 3; + if (trian == 0) + if (a + b <= c || a + c <= b || b + c <= a) + return Type.INVALID; + else + return Type.SCALENE; + if (trian > 3) + return Type.EQUILATERAL; + if (trian == 1 && a + b > c) + return Type.ISOSCELES; + else if (trian == 2 && a + c > b) + return Type.ISOSCELES; + else if (trian == 3 && b + c > a) + return Type.ISOSCELES; + return Type.INVALID; + } +} diff --git a/experiments/tools/major/example/ant/test/triangle/test/TestSuite.java b/experiments/tools/major/example/ant/test/triangle/test/TestSuite.java new file mode 100644 index 0000000000000000000000000000000000000000..00c2778e1c4f784fd886b626bf3252cc5b90985c --- /dev/null +++ b/experiments/tools/major/example/ant/test/triangle/test/TestSuite.java @@ -0,0 +1,107 @@ +package triangle.test; + +import junit.framework.TestCase; +import static triangle.Triangle.Type.*; + +public class TestSuite extends TestCase { + + public void test1() { + assertEquals (triangle.Triangle.classify(0,1301,1), INVALID); + } + public void test2() { + assertEquals (triangle.Triangle.classify(1108,1,1), INVALID); + } + public void test3() { + assertEquals (triangle.Triangle.classify(1,0,-665), INVALID); + } + public void test4() { + assertEquals (triangle.Triangle.classify(1,1,0), INVALID); + } + public void test5() { + assertEquals (triangle.Triangle.classify(582,582,582), EQUILATERAL); + } + public void test6() { + assertEquals (triangle.Triangle.classify(1,1088,15), INVALID); + } + public void test7() { + assertEquals (triangle.Triangle.classify(1,2,450), INVALID); + } + public void test8() { + assertEquals (triangle.Triangle.classify(1663,1088,823), SCALENE); + } + public void test9() { + assertEquals (triangle.Triangle.classify(1187,1146,1), INVALID); + } + public void test10() { + assertEquals (triangle.Triangle.classify(1640,1640,1956), ISOSCELES); + } + public void test11() { + assertEquals (triangle.Triangle.classify(784,784,1956), INVALID); + } + public void test12() { + assertEquals (triangle.Triangle.classify(1,450,1), INVALID); + } + public void test13() { + assertEquals (triangle.Triangle.classify(1146,1,1146), ISOSCELES); + } + public void test14() { + assertEquals (triangle.Triangle.classify(1640,1956,1956), ISOSCELES); + } + public void test15() { + assertEquals (triangle.Triangle.classify(-1,1,1), INVALID); + } + public void test16() { + assertEquals (triangle.Triangle.classify(1,-1,1), INVALID); + } + public void test17() { + assertEquals (triangle.Triangle.classify(1,2,3), INVALID); + } + public void test18() { + assertEquals (triangle.Triangle.classify(2,3,1), INVALID); + } + public void test19() { + assertEquals (triangle.Triangle.classify(3,1,2), INVALID); + } + public void test20() { + assertEquals (triangle.Triangle.classify(1,1,2), INVALID); + } + public void test21() { + assertEquals (triangle.Triangle.classify(1,2,1), INVALID); + } + public void test22() { + assertEquals (triangle.Triangle.classify(2,1,1), INVALID); + } + public void test23() { + assertEquals (triangle.Triangle.classify(1,1,1), EQUILATERAL); + } + public void test24() { + assertEquals (triangle.Triangle.classify(0,1,1), INVALID); + } + public void test25() { + assertEquals (triangle.Triangle.classify(1,0,1), INVALID); + } + public void test26() { + assertEquals (triangle.Triangle.classify(1,2,-1), INVALID); + } + public void test27() { + assertEquals (triangle.Triangle.classify(1,1,-1), INVALID); + } + public void test28() { + assertEquals (triangle.Triangle.classify(0,0,0), INVALID); + } + public void test29() { + assertEquals (triangle.Triangle.classify(3,2,5), INVALID); + } + public void test30() { + assertEquals (triangle.Triangle.classify(5,9,2), INVALID); + } + public void test31() { + assertEquals (triangle.Triangle.classify(7,4,3), INVALID); + } + public void test32() { + assertEquals (triangle.Triangle.classify(3,8,3), INVALID); + } + public void test33() { + assertEquals (triangle.Triangle.classify(7,3,3), INVALID); + } +} diff --git a/experiments/tools/major/example/runAll.sh b/experiments/tools/major/example/runAll.sh new file mode 100755 index 0000000000000000000000000000000000000000..034ffa9e8f79df25148879d17e91616e0157caa0 --- /dev/null +++ b/experiments/tools/major/example/runAll.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +echo "Using Major standalone" +cd standalone +./run.sh +cd .. + +echo +echo "Using Major with Ant" +cd ant +./run.sh +cd .. diff --git a/experiments/tools/major/example/standalone/TriangleTest.java b/experiments/tools/major/example/standalone/TriangleTest.java new file mode 100644 index 0000000000000000000000000000000000000000..08cece5e54b950e2f23ef548ccce197334849d16 --- /dev/null +++ b/experiments/tools/major/example/standalone/TriangleTest.java @@ -0,0 +1,30 @@ +import major.mutation.Config; +import triangle.Triangle; + +import java.util.List; + +public class TriangleTest{ + public static void main(String ... args){ + // Execute original version and gather coverage information + Config.__M_NO=0; + System.out.println("Original Result: "+Triangle.classify(1,1,1)); + + System.out.println("\nCovered mutants:"); + // Get List of all covered mutants + List<Integer> l = Config.getCoverageList(); + // Print all covered mutants + for(Integer mut : l){ + System.out.print(mut+" "); + } + // Reset mutation coverage information + Config.reset(); + + // Iterate over covered mutants + System.out.println("\n\nMutation analysis: "); + for(Integer mut : l){ + // Enable a certain mutant + Config.__M_NO=mut; + System.out.println(mut+": "+Triangle.classify(1,1,1)); + } + } +} diff --git a/experiments/tools/major/example/standalone/run.sh b/experiments/tools/major/example/standalone/run.sh new file mode 100755 index 0000000000000000000000000000000000000000..38b456435aa6031d7876a22cdde6dbe28e68524c --- /dev/null +++ b/experiments/tools/major/example/standalone/run.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +MAJOR_HOME="../../" + +echo "- Running Major without mutation" +echo " (javac triangle/Triangle.java)" +$MAJOR_HOME/bin/javac triangle/Triangle.java + +echo +echo "- Running Major with mutation" +echo " (javac -XMutator=\"\$MAJOR_HOME/mml/tutorial.mml.bin\" triangle/Triangle.java)" +$MAJOR_HOME/bin/javac -XMutator="$MAJOR_HOME/mml/tutorial.mml.bin" triangle/Triangle.java + +echo +echo "- Compiling test case (config.jar has to be on the classpath!)" +echo " (javac -cp .:\$MAJOR_HOME/config/config.jar TriangleTest.java)" +$MAJOR_HOME/bin/javac -Xlint:unchecked -cp .:$MAJOR_HOME/config/config.jar TriangleTest.java + +echo +echo "- Executing test case (config.jar has to be on the classpath!)" +echo " (java -cp .:\$MAJOR_HOME/config/config.jar TriangleTest)" +echo +java -cp .:$MAJOR_HOME/config/config.jar TriangleTest diff --git a/experiments/tools/major/example/standalone/triangle/Triangle.java b/experiments/tools/major/example/standalone/triangle/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..c12de6c476cb3415106b85253f089e2464c1a85e --- /dev/null +++ b/experiments/tools/major/example/standalone/triangle/Triangle.java @@ -0,0 +1,38 @@ +package triangle; + +public class Triangle { + + public static enum TriangleType { + INVALID, + SCALENE, + EQUILATERAL, + ISOSCELES; + }; + + public static TriangleType classify(int a, int b, int c) { + int trian; + if (a <= 0 || b <= 0 || c <= 0) + return TriangleType.INVALID; + trian = 0; + if (a == b) + trian = trian + 1; + if (a == c) + trian = trian + 2; + if (b == c) + trian = trian + 3; + if (trian == 0) + if (a + b < c || a + c < b || b + c < a) + return TriangleType.INVALID; + else + return TriangleType.SCALENE; + if (trian > 3) + return TriangleType.EQUILATERAL; + if (trian == 1 && a + b > c) + return TriangleType.ISOSCELES; + else if (trian == 2 && a + c > b) + return TriangleType.ISOSCELES; + else if (trian == 3 && b + c > a) + return TriangleType.ISOSCELES; + return TriangleType.INVALID; + } +} diff --git a/experiments/tools/major/lib/ant-antlr.jar b/experiments/tools/major/lib/ant-antlr.jar new file mode 100644 index 0000000000000000000000000000000000000000..4ed82a6fab59ab8654a5fbf59f55544d0d7c311a Binary files /dev/null and b/experiments/tools/major/lib/ant-antlr.jar differ diff --git a/experiments/tools/major/lib/ant-apache-bcel.jar b/experiments/tools/major/lib/ant-apache-bcel.jar new file mode 100644 index 0000000000000000000000000000000000000000..4ed82a6fab59ab8654a5fbf59f55544d0d7c311a Binary files /dev/null and b/experiments/tools/major/lib/ant-apache-bcel.jar differ diff --git a/experiments/tools/major/lib/ant-apache-bsf.jar b/experiments/tools/major/lib/ant-apache-bsf.jar new file mode 100644 index 0000000000000000000000000000000000000000..4ed82a6fab59ab8654a5fbf59f55544d0d7c311a Binary files /dev/null and b/experiments/tools/major/lib/ant-apache-bsf.jar differ diff --git a/experiments/tools/major/lib/ant-apache-log4j.jar b/experiments/tools/major/lib/ant-apache-log4j.jar new file mode 100644 index 0000000000000000000000000000000000000000..4ed82a6fab59ab8654a5fbf59f55544d0d7c311a Binary files /dev/null and b/experiments/tools/major/lib/ant-apache-log4j.jar differ diff --git a/experiments/tools/major/lib/ant-apache-oro.jar b/experiments/tools/major/lib/ant-apache-oro.jar new file mode 100644 index 0000000000000000000000000000000000000000..4ed82a6fab59ab8654a5fbf59f55544d0d7c311a Binary files /dev/null and b/experiments/tools/major/lib/ant-apache-oro.jar differ diff --git a/experiments/tools/major/lib/ant-apache-regexp.jar b/experiments/tools/major/lib/ant-apache-regexp.jar new file mode 100644 index 0000000000000000000000000000000000000000..4ed82a6fab59ab8654a5fbf59f55544d0d7c311a Binary files /dev/null and b/experiments/tools/major/lib/ant-apache-regexp.jar differ diff --git a/experiments/tools/major/lib/ant-apache-resolver.jar b/experiments/tools/major/lib/ant-apache-resolver.jar new file mode 100644 index 0000000000000000000000000000000000000000..4ed82a6fab59ab8654a5fbf59f55544d0d7c311a Binary files /dev/null and b/experiments/tools/major/lib/ant-apache-resolver.jar differ diff --git a/experiments/tools/major/lib/ant-apache-xalan2.jar b/experiments/tools/major/lib/ant-apache-xalan2.jar new file mode 100644 index 0000000000000000000000000000000000000000..e85b819dcbccbac1f0d51cb7cd85f15e4694a6e4 Binary files /dev/null and b/experiments/tools/major/lib/ant-apache-xalan2.jar differ diff --git a/experiments/tools/major/lib/ant-bootstrap.jar b/experiments/tools/major/lib/ant-bootstrap.jar new file mode 100644 index 0000000000000000000000000000000000000000..3f544474ad616142a7a572d66cd36086c8ed8697 Binary files /dev/null and b/experiments/tools/major/lib/ant-bootstrap.jar differ diff --git a/experiments/tools/major/lib/ant-commons-logging.jar b/experiments/tools/major/lib/ant-commons-logging.jar new file mode 100644 index 0000000000000000000000000000000000000000..4ed82a6fab59ab8654a5fbf59f55544d0d7c311a Binary files /dev/null and b/experiments/tools/major/lib/ant-commons-logging.jar differ diff --git a/experiments/tools/major/lib/ant-commons-net.jar b/experiments/tools/major/lib/ant-commons-net.jar new file mode 100644 index 0000000000000000000000000000000000000000..4ed82a6fab59ab8654a5fbf59f55544d0d7c311a Binary files /dev/null and b/experiments/tools/major/lib/ant-commons-net.jar differ diff --git a/experiments/tools/major/lib/ant-contrib.jar b/experiments/tools/major/lib/ant-contrib.jar new file mode 100644 index 0000000000000000000000000000000000000000..062537661a514c2ce97d18948f4f25f7226cc1a0 Binary files /dev/null and b/experiments/tools/major/lib/ant-contrib.jar differ diff --git a/experiments/tools/major/lib/ant-jai.jar b/experiments/tools/major/lib/ant-jai.jar new file mode 100644 index 0000000000000000000000000000000000000000..e85b819dcbccbac1f0d51cb7cd85f15e4694a6e4 Binary files /dev/null and b/experiments/tools/major/lib/ant-jai.jar differ diff --git a/experiments/tools/major/lib/ant-javamail.jar b/experiments/tools/major/lib/ant-javamail.jar new file mode 100644 index 0000000000000000000000000000000000000000..4ed82a6fab59ab8654a5fbf59f55544d0d7c311a Binary files /dev/null and b/experiments/tools/major/lib/ant-javamail.jar differ diff --git a/experiments/tools/major/lib/ant-jdepend.jar b/experiments/tools/major/lib/ant-jdepend.jar new file mode 100644 index 0000000000000000000000000000000000000000..e85b819dcbccbac1f0d51cb7cd85f15e4694a6e4 Binary files /dev/null and b/experiments/tools/major/lib/ant-jdepend.jar differ diff --git a/experiments/tools/major/lib/ant-jmf.jar b/experiments/tools/major/lib/ant-jmf.jar new file mode 100644 index 0000000000000000000000000000000000000000..f309396df9871dc634e70dbdb58cc77b414be920 Binary files /dev/null and b/experiments/tools/major/lib/ant-jmf.jar differ diff --git a/experiments/tools/major/lib/ant-jsch.jar b/experiments/tools/major/lib/ant-jsch.jar new file mode 100644 index 0000000000000000000000000000000000000000..e85b819dcbccbac1f0d51cb7cd85f15e4694a6e4 Binary files /dev/null and b/experiments/tools/major/lib/ant-jsch.jar differ diff --git a/experiments/tools/major/lib/ant-junit.jar b/experiments/tools/major/lib/ant-junit.jar new file mode 100644 index 0000000000000000000000000000000000000000..db4cdd8409d754bf840e6b21e5f6fd75ec872fd7 Binary files /dev/null and b/experiments/tools/major/lib/ant-junit.jar differ diff --git a/experiments/tools/major/lib/ant-junit4.jar b/experiments/tools/major/lib/ant-junit4.jar new file mode 100644 index 0000000000000000000000000000000000000000..4b93095a237bc19dfa097fc78e4134ca03dcffe8 Binary files /dev/null and b/experiments/tools/major/lib/ant-junit4.jar differ diff --git a/experiments/tools/major/lib/ant-launcher.jar b/experiments/tools/major/lib/ant-launcher.jar new file mode 100644 index 0000000000000000000000000000000000000000..f8004f344f4ccd6e6404c705d907cc9694387792 Binary files /dev/null and b/experiments/tools/major/lib/ant-launcher.jar differ diff --git a/experiments/tools/major/lib/ant-netrexx.jar b/experiments/tools/major/lib/ant-netrexx.jar new file mode 100644 index 0000000000000000000000000000000000000000..4ed82a6fab59ab8654a5fbf59f55544d0d7c311a Binary files /dev/null and b/experiments/tools/major/lib/ant-netrexx.jar differ diff --git a/experiments/tools/major/lib/ant-swing.jar b/experiments/tools/major/lib/ant-swing.jar new file mode 100644 index 0000000000000000000000000000000000000000..30ee6e8a8c09cdf28d2e86ebe1896ac2aa0c8920 Binary files /dev/null and b/experiments/tools/major/lib/ant-swing.jar differ diff --git a/experiments/tools/major/lib/ant.jar b/experiments/tools/major/lib/ant.jar new file mode 100644 index 0000000000000000000000000000000000000000..bc7f96a6fc067f74e499cfc8491a5ce31be1e138 Binary files /dev/null and b/experiments/tools/major/lib/ant.jar differ diff --git a/experiments/tools/major/lib/javac.jar b/experiments/tools/major/lib/javac.jar new file mode 100644 index 0000000000000000000000000000000000000000..333216ab6c854970c788fcb14582dcaf5cef25f4 Binary files /dev/null and b/experiments/tools/major/lib/javac.jar differ diff --git a/experiments/tools/major/lib/junit-4.11.jar b/experiments/tools/major/lib/junit-4.11.jar new file mode 100644 index 0000000000000000000000000000000000000000..4d552a6f3fd0be2b7491c448bb255862282bc836 Binary files /dev/null and b/experiments/tools/major/lib/junit-4.11.jar differ diff --git a/experiments/tools/major/lib/mmlc.jar b/experiments/tools/major/lib/mmlc.jar new file mode 100644 index 0000000000000000000000000000000000000000..b2adf916415b3b44d32d8a854d6da463f5340580 Binary files /dev/null and b/experiments/tools/major/lib/mmlc.jar differ diff --git a/experiments/tools/major/mml/all.mml b/experiments/tools/major/mml/all.mml new file mode 100644 index 0000000000000000000000000000000000000000..f7ef03a6235567ca54b6d42a907ce6d0f9067c0a --- /dev/null +++ b/experiments/tools/major/mml/all.mml @@ -0,0 +1,55 @@ +// A simple mml file to generate all mutants + +list_aor={+,-,*,/,%}; +list_lor={&,|,^}; +list_sor={<<,>>,>>>}; +list_oru={+,-,~}; + +BIN(+)->list_aor; +BIN(-)->list_aor; +BIN(*)->list_aor; +BIN(/)->list_aor; +BIN(%)->list_aor; + +BIN(>>)->list_sor; +BIN(<<)->list_sor; +BIN(>>>)->list_sor; + +BIN(&)->list_lor; +BIN(|)->list_lor; +BIN(^)->list_lor; + +UNR(+)->list_oru; +UNR(-)->list_oru; +UNR(~)->list_oru; + +// Use sufficient replacements for ROR +BIN(>)->{>=,!=,FALSE}; +BIN(<)->{<=,!=,FALSE}; +BIN(>=)->{>,==,TRUE}; +BIN(<=)->{<,==,TRUE}; +BIN(==)->{<=,>=,FALSE,LHS,RHS}; +BIN(!=)->{<,>,TRUE,LHS,RHS}; + +// Use sufficient replacements for COR +BIN(&&)->{==,LHS,RHS,FALSE}; +BIN(||)->{!=,LHS,RHS,TRUE}; + +// Delete all types of supported statements +DEL(CALL); +DEL(INC); +DEL(DEC); +DEL(ASSIGN); +DEL(CONT); +DEL(BREAK); +DEL(RETURN); + +// Enable all operators +AOR; +LOR; +SOR; +COR; +ROR; +LVR; +ORU; +STD; diff --git a/experiments/tools/major/mml/all.mml.bin b/experiments/tools/major/mml/all.mml.bin new file mode 100644 index 0000000000000000000000000000000000000000..4bf4236269665ab7a763ca86c2f4f302f57ffdc0 Binary files /dev/null and b/experiments/tools/major/mml/all.mml.bin differ diff --git a/experiments/tools/major/mml/tutorial.mml b/experiments/tools/major/mml/tutorial.mml new file mode 100644 index 0000000000000000000000000000000000000000..30cd74c4ed347f3b0f9068a1a07f2f8c8bc93071 --- /dev/null +++ b/experiments/tools/major/mml/tutorial.mml @@ -0,0 +1,21 @@ +targetOp{ + // Define the replacements for ROR + BIN(>)->{>=,!=,FALSE}; + BIN(<)->{<=,!=,FALSE}; + BIN(>=)->{>,==,TRUE}; + BIN(<=)->{<,==,TRUE}; + BIN(==)->{<=,>=,FALSE,LHS,RHS}; + BIN(!=)->{<,>,TRUE,LHS,RHS}; + // Define the replacements for COR + BIN(&&)->{==,LHS,RHS,FALSE}; + BIN(||)->{!=,LHS,RHS,TRUE}; + // Define the type of statement that STD should delete + DEL(RETURN); + + // Enable the STD, COR, and ROR mutation operators + STD; + COR; + ROR; +} +// Call the defined operator group for the target method +targetOp<"triangle.Triangle::classify(int,int,int)">; diff --git a/experiments/tools/major/mml/tutorial.mml.bin b/experiments/tools/major/mml/tutorial.mml.bin new file mode 100644 index 0000000000000000000000000000000000000000..f94fb869c09d310badb295ac51e6a8f28093279a Binary files /dev/null and b/experiments/tools/major/mml/tutorial.mml.bin differ diff --git a/experiments/wermer2/Experiment.hs b/experiments/wermer2/Experiment.hs new file mode 100644 index 0000000000000000000000000000000000000000..aad8ddec0e88e9d65849c634054ceff128da7ca1 --- /dev/null +++ b/experiments/wermer2/Experiment.hs @@ -0,0 +1,30 @@ +-- Contain various functions to automate the experiment +module Experiment where + +import Javawlp.API +import Javawlp.Engine.HelperFunctions +import Javawlp.Engine.Verifier + +import Language.Java.Syntax +import Z3.Monad + + + +checkMutant original mutantDir methodName postcond = do + let srcName = original ++ ".java" + (typeEnv1,decls1,methodNames1) <- parseJava ("./subjects/src/" ++ srcName) + (typeEnv2,decls2,methodNames2) <- parseJava (mutantDir ++ "/" ++ srcName) + + let mname = Ident methodName + let q = post_ postcond + p1 <- wlpMethod defaultConf typeEnv1 decls1 mname q + p2 <- wlpMethod defaultConf typeEnv2 decls2 mname q + let tocheck = PreNot (p1 ==* p2) + let (result,_) = unsafeIsSatisfiable (extendEnv typeEnv1 decls1 mname) decls1 tocheck + case result of + Sat -> putStrLn "** KILLED." + Unsat -> putStrLn "** SURVIVED." + _ -> putStrLn "** UNDECIDED." + + + \ No newline at end of file diff --git a/experiments/wermer2/README.md b/experiments/wermer2/README.md new file mode 100644 index 0000000000000000000000000000000000000000..ce02c4c0296d5e65b81e939689c770b4b4971c0a --- /dev/null +++ b/experiments/wermer2/README.md @@ -0,0 +1,25 @@ +### Wermer experiment, version 2 + +### To run the mutation test: + +- Compile the subjects using the script *./compileSubjects.sh* + +- Create mutation files using major. Script: *./generateMutants.sh <target>*. The target is the target name. e.g. Triangle. Without .java extension. + + + +- Edit settings.hs to specify the post-condition and test file +- Run the main function (this can be done using ghci) +- The results will be stored in wlp/Results, overwriting any existing results file that uses the same parameters (the analysis is static, so the results should be the same in this case anyway) + +### To run the false positive test: + +- Edit settings.hs to specify the post-condition +- Run the testFalsePositives function (this can be done using ghci) +- The results will be stored in wlp/Results + +### Folder structure: + +The folder generated by Major must be in the same folder as the wlp folder, and must be named "SOURCE mutants" (where SOURCE is the name of the test class) +A path to a mutant (the 5th mutant in this example) looks like this: "SOURCE mutants/5/classPath/SOURCE.java" Because of this, to analyse a new test class the classPath function in Settings.hs has to be extended with the corresponding class path + diff --git a/experiments/wermer2/compileSubjects.sh b/experiments/wermer2/compileSubjects.sh new file mode 100755 index 0000000000000000000000000000000000000000..88fed0ea2791608deac3c6a82b841016ab8d3b14 --- /dev/null +++ b/experiments/wermer2/compileSubjects.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +SRC="./subjects/src" +SUBJECTS="$SRC/Triangle.java" +javac -cp "./subjects/bin" -d "./subjects/bin" $SUBJECTS + diff --git a/experiments/wermer2/generateMutants.sh b/experiments/wermer2/generateMutants.sh new file mode 100755 index 0000000000000000000000000000000000000000..4762757c7afe2349b7873ff3e230e28546f0e0ca --- /dev/null +++ b/experiments/wermer2/generateMutants.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# path to Major compiler: +MAJOR="../tools/major/bin/javac" +# Path to major mml compiler +MMLC="../tools/major/bin/mmlc" + +# The set and scope of mutations are specified in the file mutation.mml, +# compile it first: +# $MMLC "./mutation.mml" + +mutate(){ + $MAJOR -J-Dmajor.export.directory="./mutants/generated/$1" -J-Dmajor.export.mutants=true -XMutator="./mutation.mml.bin" -cp "./subjects/bin" "./subjects/src/$1.java" +} +mutate "Triangle" \ No newline at end of file diff --git a/experiments/wermer2/mutants.log b/experiments/wermer2/mutants.log new file mode 100644 index 0000000000000000000000000000000000000000..99a9837ee311415f24fb727e6cb557936cb08879 --- /dev/null +++ b/experiments/wermer2/mutants.log @@ -0,0 +1,65 @@ +1:ROR:<=(float,float):<(float,float):Triangle@tritype1():15:this.x <= 0 |==> this.x < 0 +2:ROR:<=(float,float):==(float,float):Triangle@tritype1():15:this.x <= 0 |==> this.x == 0 +3:ROR:<=(float,float):TRUE(float,float):Triangle@tritype1():15:this.x <= 0 |==> true +4:ROR:<=(float,float):<(float,float):Triangle@tritype1():15:this.y <= 0 |==> this.y < 0 +5:ROR:<=(float,float):==(float,float):Triangle@tritype1():15:this.y <= 0 |==> this.y == 0 +6:ROR:<=(float,float):TRUE(float,float):Triangle@tritype1():15:this.y <= 0 |==> true +7:COR:||(boolean,boolean):!=(boolean,boolean):Triangle@tritype1():15:(this.x <= 0) || (this.y <= 0) |==> (this.x <= 0) != (this.y <= 0) +8:COR:||(boolean,boolean):LHS(boolean,boolean):Triangle@tritype1():15:(this.x <= 0) || (this.y <= 0) |==> (this.x <= 0) +9:COR:||(boolean,boolean):RHS(boolean,boolean):Triangle@tritype1():15:(this.x <= 0) || (this.y <= 0) |==> (this.y <= 0) +10:COR:||(boolean,boolean):TRUE(boolean,boolean):Triangle@tritype1():15:(this.x <= 0) || (this.y <= 0) |==> true +11:ROR:<=(float,float):<(float,float):Triangle@tritype1():15:this.z <= 0 |==> this.z < 0 +12:ROR:<=(float,float):==(float,float):Triangle@tritype1():15:this.z <= 0 |==> this.z == 0 +13:ROR:<=(float,float):TRUE(float,float):Triangle@tritype1():15:this.z <= 0 |==> true +14:COR:||(boolean,boolean):!=(boolean,boolean):Triangle@tritype1():15:(this.x <= 0) || (this.y <= 0) || (this.z <= 0) |==> ((this.x <= 0) || (this.y <= 0)) != (this.z <= 0) +15:COR:||(boolean,boolean):LHS(boolean,boolean):Triangle@tritype1():15:(this.x <= 0) || (this.y <= 0) || (this.z <= 0) |==> (this.x <= 0) || (this.y <= 0) +16:COR:||(boolean,boolean):RHS(boolean,boolean):Triangle@tritype1():15:(this.x <= 0) || (this.y <= 0) || (this.z <= 0) |==> (this.z <= 0) +17:COR:||(boolean,boolean):TRUE(boolean,boolean):Triangle@tritype1():15:(this.x <= 0) || (this.y <= 0) || (this.z <= 0) |==> true +18:AOR:+(float,float):%(float,float):Triangle@tritype1():16:this.y + this.z |==> this.y % this.z +19:AOR:+(float,float):*(float,float):Triangle@tritype1():16:this.y + this.z |==> this.y * this.z +20:AOR:+(float,float):-(float,float):Triangle@tritype1():16:this.y + this.z |==> this.y - this.z +21:AOR:+(float,float):/(float,float):Triangle@tritype1():16:this.y + this.z |==> this.y / this.z +22:ROR:>=(float,float):==(float,float):Triangle@tritype1():16:this.x >= (this.y + this.z) |==> this.x == (this.y + this.z) +23:ROR:>=(float,float):>(float,float):Triangle@tritype1():16:this.x >= (this.y + this.z) |==> this.x > (this.y + this.z) +24:ROR:>=(float,float):TRUE(float,float):Triangle@tritype1():16:this.x >= (this.y + this.z) |==> true +25:AOR:+(float,float):%(float,float):Triangle@tritype1():17:this.x + this.z |==> this.x % this.z +26:AOR:+(float,float):*(float,float):Triangle@tritype1():17:this.x + this.z |==> this.x * this.z +27:AOR:+(float,float):-(float,float):Triangle@tritype1():17:this.x + this.z |==> this.x - this.z +28:AOR:+(float,float):/(float,float):Triangle@tritype1():17:this.x + this.z |==> this.x / this.z +29:ROR:>=(float,float):==(float,float):Triangle@tritype1():17:this.y >= (this.x + this.z) |==> this.y == (this.x + this.z) +30:ROR:>=(float,float):>(float,float):Triangle@tritype1():17:this.y >= (this.x + this.z) |==> this.y > (this.x + this.z) +31:ROR:>=(float,float):TRUE(float,float):Triangle@tritype1():17:this.y >= (this.x + this.z) |==> true +32:AOR:+(float,float):%(float,float):Triangle@tritype1():18:this.x + this.y |==> this.x % this.y +33:AOR:+(float,float):*(float,float):Triangle@tritype1():18:this.x + this.y |==> this.x * this.y +34:AOR:+(float,float):-(float,float):Triangle@tritype1():18:this.x + this.y |==> this.x - this.y +35:AOR:+(float,float):/(float,float):Triangle@tritype1():18:this.x + this.y |==> this.x / this.y +36:ROR:>=(float,float):==(float,float):Triangle@tritype1():18:this.z >= (this.x + this.y) |==> this.z == (this.x + this.y) +37:ROR:>=(float,float):>(float,float):Triangle@tritype1():18:this.z >= (this.x + this.y) |==> this.z > (this.x + this.y) +38:ROR:>=(float,float):TRUE(float,float):Triangle@tritype1():18:this.z >= (this.x + this.y) |==> true +39:ROR:==(float,float):<=(float,float):Triangle@tritype1():19:this.x == this.y |==> this.x <= this.y +40:ROR:==(float,float):>=(float,float):Triangle@tritype1():19:this.x == this.y |==> this.x >= this.y +41:ROR:==(float,float):FALSE(float,float):Triangle@tritype1():19:this.x == this.y |==> false +42:ROR:==(float,float):<=(float,float):Triangle@tritype1():19:this.y == this.z |==> this.y <= this.z +43:ROR:==(float,float):>=(float,float):Triangle@tritype1():19:this.y == this.z |==> this.y >= this.z +44:ROR:==(float,float):FALSE(float,float):Triangle@tritype1():19:this.y == this.z |==> false +45:COR:&&(boolean,boolean):==(boolean,boolean):Triangle@tritype1():19:(this.x == this.y) && (this.y == this.z) |==> (this.x == this.y) == (this.y == this.z) +46:COR:&&(boolean,boolean):FALSE(boolean,boolean):Triangle@tritype1():19:(this.x == this.y) && (this.y == this.z) |==> false +47:COR:&&(boolean,boolean):LHS(boolean,boolean):Triangle@tritype1():19:(this.x == this.y) && (this.y == this.z) |==> (this.x == this.y) +48:COR:&&(boolean,boolean):RHS(boolean,boolean):Triangle@tritype1():19:(this.x == this.y) && (this.y == this.z) |==> (this.y == this.z) +49:ROR:==(float,float):<=(float,float):Triangle@tritype1():20:this.x == this.y |==> this.x <= this.y +50:ROR:==(float,float):>=(float,float):Triangle@tritype1():20:this.x == this.y |==> this.x >= this.y +51:ROR:==(float,float):FALSE(float,float):Triangle@tritype1():20:this.x == this.y |==> false +52:ROR:==(float,float):<=(float,float):Triangle@tritype1():20:this.y == this.z |==> this.y <= this.z +53:ROR:==(float,float):>=(float,float):Triangle@tritype1():20:this.y == this.z |==> this.y >= this.z +54:ROR:==(float,float):FALSE(float,float):Triangle@tritype1():20:this.y == this.z |==> false +55:COR:||(boolean,boolean):!=(boolean,boolean):Triangle@tritype1():20:(this.x == this.y) || (this.y == this.z) |==> (this.x == this.y) != (this.y == this.z) +56:COR:||(boolean,boolean):LHS(boolean,boolean):Triangle@tritype1():20:(this.x == this.y) || (this.y == this.z) |==> (this.x == this.y) +57:COR:||(boolean,boolean):RHS(boolean,boolean):Triangle@tritype1():20:(this.x == this.y) || (this.y == this.z) |==> (this.y == this.z) +58:COR:||(boolean,boolean):TRUE(boolean,boolean):Triangle@tritype1():20:(this.x == this.y) || (this.y == this.z) |==> true +59:ROR:==(float,float):<=(float,float):Triangle@tritype1():20:this.x == this.z |==> this.x <= this.z +60:ROR:==(float,float):>=(float,float):Triangle@tritype1():20:this.x == this.z |==> this.x >= this.z +61:ROR:==(float,float):FALSE(float,float):Triangle@tritype1():20:this.x == this.z |==> false +62:COR:||(boolean,boolean):!=(boolean,boolean):Triangle@tritype1():20:(this.x == this.y) || (this.y == this.z) || (this.x == this.z) |==> ((this.x == this.y) || (this.y == this.z)) != (this.x == this.z) +63:COR:||(boolean,boolean):LHS(boolean,boolean):Triangle@tritype1():20:(this.x == this.y) || (this.y == this.z) || (this.x == this.z) |==> (this.x == this.y) || (this.y == this.z) +64:COR:||(boolean,boolean):RHS(boolean,boolean):Triangle@tritype1():20:(this.x == this.y) || (this.y == this.z) || (this.x == this.z) |==> (this.x == this.z) +65:COR:||(boolean,boolean):TRUE(boolean,boolean):Triangle@tritype1():20:(this.x == this.y) || (this.y == this.z) || (this.x == this.z) |==> true diff --git a/experiments/wermer2/mutants/generated/Triangle/1/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/1/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..e86248215705a079a9b6a15c08dc5a8ccfa437d7 --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/1/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x < 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/10/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/10/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..0e102591ff493e649ab056ed2b0351a1cb9d2748 --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/10/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if (true || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/11/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/11/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..c8d35eaad3f6b1c72ac772ae88582a308b277f8b --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/11/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z < 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/12/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/12/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..eb096765ff449c64ded3910db77961e666d6acf2 --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/12/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z == 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/13/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/13/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..4c6997a848fb721cfdcfa233891bede37579f430 --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/13/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (true)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/14/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/14/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..46ce15b76630081904d0997fb2becbdff3e4aa3c --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/14/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if (((this.x <= 0) || (this.y <= 0)) != (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/15/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/15/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..8a1393abfc6be2e112879d3e3267e26f324db103 --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/15/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/16/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/16/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..434123a8940fad27493c4b07afa3efa0d8ee0fd0 --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/16/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/17/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/17/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..7d4064e762d36be4224a6cb6884f11b2a861fc05 --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/17/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if (true) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/18/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/18/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..d394c0533b28a06061b7d5e3582b0a067537f22a --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/18/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y % this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/19/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/19/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..97724f0a6f4316d3d581d62bf93bc43bc0516f30 --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/19/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y * this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/2/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/2/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..4eeedfa0aa5673991804f51c3078a8244b7ecc0d --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/2/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x == 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/20/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/20/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..823f70d4bf2dc16ee259055cfdd7bf82d389dab5 --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/20/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y - this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/21/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/21/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..5e373ba0ac5d964b5c0d346707db34828dc1582c --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/21/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y / this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/22/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/22/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..36ce86f81ebf8115954c996a4b6a2e480547bcf0 --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/22/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x == (this.y + this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/23/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/23/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..16dbc35746a508671851dc348ab8b92d54fff59c --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/23/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x > (this.y + this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/24/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/24/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..063b652f19ab948af99afb3b39d10391d7a45e11 --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/24/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (true) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/25/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/25/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..2b2c735d1256a775b68d8ec3a4cc8806849003e4 --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/25/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x % this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/26/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/26/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..50b6ffc7e53d7aaf86e1ca55d8b15cec5d55aeae --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/26/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x * this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/27/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/27/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..9228c7ab82f9d0dba52d30edf6b4d1d7c6b1b79f --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/27/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x - this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/28/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/28/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..08c958a37098dadbd1a7981cc604dfa10ab01502 --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/28/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x / this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/29/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/29/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..748aaec27a80782c4354606f63d7c485c4dea587 --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/29/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y == (this.x + this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/3/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/3/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..5d0211ccdba857b7fe364503e76bf9eba59d65dc --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/3/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((true) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/30/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/30/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..de908d4da351790a305b694332d509ec99d95659 --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/30/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y > (this.x + this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/31/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/31/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..e2943afeb6b8ffa554872763450948159c73c021 --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/31/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (true) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/32/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/32/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..0c47297d7110d9125dbe02232e83915bfbf08d9f --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/32/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x % this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/33/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/33/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..c9309d81ee05b33ac6b84e90c0329267a10b2b15 --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/33/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x * this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/34/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/34/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..08abb0232a17ef8cf3980f7807feafc5e884153f --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/34/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x - this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/35/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/35/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..e94e15bb27c0e47473f4fce4e7475036bcdb5eee --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/35/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x / this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/36/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/36/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..cd25315d575c8133b3ddf8c3f46bbe1ecda7f5df --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/36/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z == (this.x + this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/37/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/37/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..4b64c1cbd73bee6f8d2dc6c356c3ef41d4e20f89 --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/37/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z > (this.x + this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/38/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/38/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..ee3c24766b24d59747661702a6d718a93ed08bc2 --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/38/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (true) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/39/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/39/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..36d82cce507d30f02d54c2759d277ec43752a18b --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/39/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x <= this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/4/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/4/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..a5b549c8f2d26a6c4afd28be7e00582091287217 --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/4/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y < 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/40/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/40/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..61b4e3cd7c42346d329ab4496f0b272d314f7b46 --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/40/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x >= this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/41/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/41/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..a59471e4aaa46969ace05ba1cb17fc9c0ccb6de1 --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/41/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((false) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/42/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/42/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..359c2a0f42bcaf3a5cb3f72a612528fdbe2458b0 --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/42/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y <= this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/43/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/43/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..01ba0c4ecdc1a9f946dee1a4949bd734a0222df4 --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/43/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y >= this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/44/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/44/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..bfdf61e7837888b725afaa9e55cf33adb42f8d80 --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/44/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (false)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/45/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/45/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..0a13b57b6ce3096b082c1ed6d8843ef0fad9f2da --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/45/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) == (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/46/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/46/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..2c41f2e9d990a43594a8f4518efd5e28ab5ac400 --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/46/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if (false) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/47/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/47/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..bf122aa2bb87a02f1d4d459f3f7736caefe5e698 --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/47/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/48/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/48/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..98596d8fa0916b4270a0a8daa5b1f931a89fb5be --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/48/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/49/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/49/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..c59b6d9092d927e63d1b67cdb7272392492fbe29 --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/49/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x <= this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/5/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/5/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..152f2b891218ec92999e10bda61d896796037afb --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/5/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y == 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/50/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/50/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..b4e0376b211fe10d86d7be150656ed0958940edd --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/50/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x >= this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/51/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/51/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..304674f6ee78b6a8d537a64ac9ab456a8e68672d --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/51/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((false) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/52/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/52/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..49a8dd7df731084dd90e3ef2ffe8a47120b85faa --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/52/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y <= this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/53/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/53/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..0e7299895151a105bfcf290c319dfabea7987450 --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/53/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y >= this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/54/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/54/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..3ab44c6811eca06e1c51adac9e9868cfa0fe099e --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/54/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (false) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/55/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/55/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..9648d70688fafbfb1522a427d6273a3ed3384edd --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/55/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) != (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/56/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/56/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..938247ac91759942eaeaae71381cb497d802ef5e --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/56/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/57/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/57/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..14f50cec5742f608a09885ab328c2e749cc95205 --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/57/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/58/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/58/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..836d81f6a64ad49ae2ac65512e3678a24316f80e --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/58/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if (true || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/59/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/59/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..e379ef7b7ed49e569ff02443e3f217f4ad8e4a87 --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/59/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x <= this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/6/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/6/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..dd268f0a51bb69796635c0f6cd9ce42837b35c23 --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/6/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (true) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/60/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/60/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..79b4d4c0541df0d3a7e294ca6b90290a6e7502e4 --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/60/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x >= this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/61/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/61/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..18fb89a52a6446c3f85c0c397759a7981590abb1 --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/61/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (false)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/62/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/62/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..c8d3cec73db5201e342565adc1869590e815d096 --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/62/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if (((this.x == this.y) || (this.y == this.z)) != (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/63/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/63/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..efabff1ee2990acc68c0a372e9f31d0ac0ca30be --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/63/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/64/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/64/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..7700c729d95e31e3b0ea2479e7c9158043794389 --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/64/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/65/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/65/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..a0f98a81e253e2ffd6c0067d650fc788348ff720 --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/65/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if (true) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/7/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/7/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..4e5e076665bd4d3817d6b862caad839942ab1262 --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/7/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) != (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/8/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/8/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..03317d129b3f31cd09a4d0c5e475519c94d709a5 --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/8/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutants/generated/Triangle/9/Triangle.java b/experiments/wermer2/mutants/generated/Triangle/9/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..7c88024910e441fcce4c88a1ab7af2330879b4db --- /dev/null +++ b/experiments/wermer2/mutants/generated/Triangle/9/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/experiments/wermer2/mutation.mml b/experiments/wermer2/mutation.mml new file mode 100644 index 0000000000000000000000000000000000000000..a27f80856b905bce59dc2defb46050f04ecf4493 --- /dev/null +++ b/experiments/wermer2/mutation.mml @@ -0,0 +1,60 @@ +// A simple mml file to generate all mutants + +list_aor={+,-,*,/,%}; +list_lor={&,|,^}; +list_sor={<<,>>,>>>}; +list_oru={+,-,~}; + +BIN(+)->list_aor; +BIN(-)->list_aor; +BIN(*)->list_aor; +BIN(/)->list_aor; +BIN(%)->list_aor; + +BIN(>>)->list_sor; +BIN(<<)->list_sor; +BIN(>>>)->list_sor; + +BIN(&)->list_lor; +BIN(|)->list_lor; +BIN(^)->list_lor; + +UNR(+)->list_oru; +UNR(-)->list_oru; +UNR(~)->list_oru; + +// Use sufficient replacements for ROR +BIN(>)->{>=,!=,FALSE}; +BIN(<)->{<=,!=,FALSE}; +BIN(>=)->{>,==,TRUE}; +BIN(<=)->{<,==,TRUE}; +BIN(==)->{<=,>=,FALSE,LHS,RHS}; +BIN(!=)->{<,>,TRUE,LHS,RHS}; + +// Use sufficient replacements for COR +BIN(&&)->{==,LHS,RHS,FALSE}; +BIN(||)->{!=,LHS,RHS,TRUE}; + +// Delete all types of supported statements +//DEL(CALL); //don't do this... +DEL(INC); +DEL(DEC); +DEL(ASSIGN); +DEL(CONT); +DEL(BREAK); +//DEL(RETURN); //don't do this... + +// Let's include all operators +myOp { + AOR; + LOR; + SOR; + COR; + ROR; + LVR; + ORU; + STD; +} + +// Specify scopes: +myOp<"Triangle@tritype1" ; diff --git a/experiments/wermer2/mutation.mml.bin b/experiments/wermer2/mutation.mml.bin new file mode 100644 index 0000000000000000000000000000000000000000..8bd6f91ff33e0040a63f9e36aa13053c1a769c06 Binary files /dev/null and b/experiments/wermer2/mutation.mml.bin differ diff --git a/experiments/wermer2/subjects/src/Triangle.class b/experiments/wermer2/subjects/src/Triangle.class new file mode 100644 index 0000000000000000000000000000000000000000..dfa1ee44ac65896a1bf6d466900c7177429b18bf Binary files /dev/null and b/experiments/wermer2/subjects/src/Triangle.class differ diff --git a/experiments/wermer2/subjects/src/Triangle.java b/experiments/wermer2/subjects/src/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..f97f76c08da9ed2e176f6ae08fc67ddb8ce94d72 --- /dev/null +++ b/experiments/wermer2/subjects/src/Triangle.java @@ -0,0 +1,34 @@ +public class Triangle { + + private float x ; + private float y ; + private float z ; + + public Triangle(float x, float y, float z){ + this.x = x ; + this.y = y ; + this.z = z ; + } + + // classify this triangle's type: + public int tritype1() { + if ((this.x <= 0) || (this.y <= 0) || (this.z <= 0)) throw new IllegalArgumentException() ; + if (this.x >= (this.y+this.z)) return -1 ; // not a triangle + if (this.y >= (this.x+this.z)) return -1 ; // not a triangle + if (this.z >= (this.x+this.y)) return -1 ; // not a triangle + if ((this.x == this.y) && (this.y == this.z)) return 1 ; // equilateral + if ((this.x == this.y) || (this.y == this.z) || (this.x == this.z)) return 2 ; // isoleces + return 0 ; // scalene + } + + // static variation of tritype: + static public int tritype2(float x, float y, float z) { + if ((x <= 0) || (y <= 0) || (z <= 0)) throw new IllegalArgumentException() ; + if (x >= (y+z)) return -1 ; // not a triangle + if (y >= (x+z)) return -1 ; // not a triangle + if (z >= (x+y)) return -1 ; // not a triangle + if ((x == y) && (y == z)) return 1 ; // equilateral + if ((x == y) || (y == z) || (x == z)) return 2 ; // isoleces + return 0 ; // scalene + } +} diff --git a/src/Javawlp/API.hs b/src/Javawlp/API.hs index 87fa861aa0704104b2c62058bb4ecaef2a4b9b21..b5ccc0652bdc3579dbf6d3f1997733115fcd76ba 100644 --- a/src/Javawlp/API.hs +++ b/src/Javawlp/API.hs @@ -105,6 +105,7 @@ printWlp sourcePath methodName postCond = do let q = post_ postCond p <- wlpMethod defaultConf typeEnv decls (Ident methodName) q putStrLn $ showMethodWlp methodName q p + --putStrLn ("\n### " ++ show p) let (result,model) = unsafeIsSatisfiable (extendEnv typeEnv decls (Ident methodName)) decls p case result of Unsat -> putStrLn "** The wlp is UNSATISFIABLE." @@ -114,7 +115,7 @@ printWlp sourcePath methodName postCond = do case model of Just m -> do { putStrLn "** Model:" ; s <- evalZ3 (modelToString m) ; putStrLn s } _ -> return () - + showMethodWlp :: String -> Exp -> Exp -> String showMethodWlp methodName postCond wlp =