From ad4b08a18155fb31d00b3a3b74103e17ddb47946 Mon Sep 17 00:00:00 2001 From: koen <koenwermer@gmail.com> Date: Sun, 29 Jan 2017 20:36:00 +0100 Subject: [PATCH] added some results and C# code --- .../original C# code/2D_to_1D.cs | 81 ++++++++++++++++ .../original C# code/Vectors01Generator.cs | 41 ++++++++ ...eturnValueVar == returnValue_False_False_1 | 92 ++++++++++++++++++ ...eturnValueVar == returnValue_False_False_2 | 94 +++++++++++++++++++ Results/arrays1_true_true_true_False_False_1 | 76 +++++++++++++++ 5 files changed, 384 insertions(+) create mode 100644 Equivalent mutations/original C# code/2D_to_1D.cs create mode 100644 Equivalent mutations/original C# code/Vectors01Generator.cs create mode 100644 Results/arrays1_true_returnValue != null_returnValueVar == returnValue_False_False_1 create mode 100644 Results/arrays1_true_returnValue != null_returnValueVar == returnValue_False_False_2 create mode 100644 Results/arrays1_true_true_true_False_False_1 diff --git a/Equivalent mutations/original C# code/2D_to_1D.cs b/Equivalent mutations/original C# code/2D_to_1D.cs new file mode 100644 index 0000000..5a8c17e --- /dev/null +++ b/Equivalent mutations/original C# code/2D_to_1D.cs @@ -0,0 +1,81 @@ +//http://www.sanfoundry.com/csharp-program-convert-2darray-1darray/ + +/* + * C# Program to Convert a 2D Array into 1D Array + */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Program +{ + class twodmatrix + { + int m, n; + int[,] a; + int[] b; + twodmatrix(int x, int y) + { + m = x; + n = y; + a = new int[m, n]; + b = new int[m * n]; + } + public void readmatrix() + { + for (int i = 0; i < m; i++) + { + for (int j = 0; j < n; j++) + { + Console.WriteLine("a[{0},{1}]=", i, j); + a[i, j] = Convert.ToInt32(Console.ReadLine()); + } + } + } + public void printd() + { + for (int i = 0; i < m; i++) + { + for (int j = 0; j < n; j++) + { + Console.Write("{0}\t", a[i, j]); + + } + Console.Write("\n"); + } + } + public void convert() + { + int k = 0; + for (int i = 0; i < m; i++) + { + for (int j = 0; j < n; j++) + { + b[k++] = a[i, j]; + } + } + } + public void printoned() + { + for (int i = 0; i < m * n; i++) + { + Console.WriteLine("{0}\t", b[i]); + } + } + + + public static void Main(string[] args) + { + twodmatrix obj = new twodmatrix(2,3); + Console.WriteLine("Enter the Elements : "); + obj.readmatrix(); + Console.WriteLine("\t\t Given 2-D Array(Matrix) is : "); + obj.printd(); + obj.convert(); + Console.WriteLine("\t\t Converted 1-D Array is : "); + obj.printoned(); + Console.ReadLine(); + } + } +} \ No newline at end of file diff --git a/Equivalent mutations/original C# code/Vectors01Generator.cs b/Equivalent mutations/original C# code/Vectors01Generator.cs new file mode 100644 index 0000000..d9d5290 --- /dev/null +++ b/Equivalent mutations/original C# code/Vectors01Generator.cs @@ -0,0 +1,41 @@ +//http://www.introprogramming.info/english-intro-csharp-book/read-online/chapter-10-recursion/#demos-source-code + +using System; + +class Vectors01Generator +{ + static void Gen01(int index, int[] vector) + { + if (index == -1) + { + Print(vector); + } + else + { + for (int i = 0; i <= 1; i++) + { + vector[index] = i; + Gen01(index - 1, vector); + } + } + } + + static void Print(int[] vector) + { + foreach (int i in vector) + { + Console.Write("{0} ", i); + } + Console.WriteLine(); + } + + static void Main() + { + Console.Write("n = "); + int number = int.Parse(Console.ReadLine()); + + int[] vector = new int[number]; + + Gen01(number - 1, vector); + } +} diff --git a/Results/arrays1_true_returnValue != null_returnValueVar == returnValue_False_False_1 b/Results/arrays1_true_returnValue != null_returnValueVar == returnValue_False_False_1 new file mode 100644 index 0000000..7a954ff --- /dev/null +++ b/Results/arrays1_true_returnValue != null_returnValueVar == returnValue_False_False_1 @@ -0,0 +1,92 @@ +testFile: arrays1 +postCondVoid: true +postCondRefType: returnValue != null +postCondPrimType: returnValueVar == returnValue +ignoreLibMethods: False +ignoreMainMethod: False +nrOfUnroll: 1 +erronous mutations detected: +96 findAndPrintPairs +93 main +93 findAndPrintPairs +90 main +90 findAndPrintPairs +85 main +85 findAndPrintPairs +75 goodResize +71 goodResize +68 goodResize +67 goodResize +65 goodResize +52 badResize +49 badResize +48 badResize +46 badResize +39 findMin +38 findMin +36 findMin +35 findMin +34 findMin +33 findMin +30 findMin +28 findMin +24 findMin +217 bubblesort +217 isAscending +215 isAscending +214 isAscending +213 isAscending +212 isAscending +211 isAscending +210 isAscending +209 isAscending +208 isAscending +207 isAscending +206 isAscending +203 isAscending +201 isAscending +196 isAscending +192 bubblesort +192 isAscending +191 isAscending +189 isAscending +188 isAscending +187 bubblesort +187 isAscending +186 bubblesort +186 isAscending +185 isAscending +184 bubblesort +184 isAscending +173 bubblesort +170 bubblesort +167 bubblesort +164 bubblesort +156 main +156 bubblesort +153 main +153 bubblesort +149 main +149 bubblesort +147 main +147 bubblesort +137 main +137 bubblesort +134 main +134 bubblesort +132 bubblesort +130 bubblesort +129 bubblesort +128 bubblesort +126 bubblesort +125 bubblesort +124 bubblesort +121 bubblesort +120 main +120 bubblesort +114 bubblesort +112 bubblesort +109 bubblesort +107 bubblesort +Total number of mutants: 217 +Number of mutants in which we found an error: 67 \ No newline at end of file diff --git a/Results/arrays1_true_returnValue != null_returnValueVar == returnValue_False_False_2 b/Results/arrays1_true_returnValue != null_returnValueVar == returnValue_False_False_2 new file mode 100644 index 0000000..3dcbc60 --- /dev/null +++ b/Results/arrays1_true_returnValue != null_returnValueVar == returnValue_False_False_2 @@ -0,0 +1,94 @@ +testFile: arrays1 +postCondVoid: true +postCondRefType: returnValue != null +postCondPrimType: returnValueVar == returnValue +ignoreLibMethods: False +ignoreMainMethod: False +nrOfUnroll: 2 +erronous mutations detected: +96 findAndPrintPairs +93 main +93 findAndPrintPairs +90 main +90 findAndPrintPairs +85 main +85 findAndPrintPairs +75 goodResize +71 goodResize +68 goodResize +67 goodResize +65 goodResize +52 badResize +49 badResize +48 badResize +46 badResize +39 findMin +38 findMin +36 findMin +35 findMin +34 findMin +33 findMin +30 findMin +28 findMin +24 findMin +217 bubblesort +217 isAscending +215 isAscending +214 isAscending +213 isAscending +212 isAscending +211 isAscending +210 isAscending +209 isAscending +208 isAscending +207 isAscending +206 isAscending +203 isAscending +201 isAscending +196 isAscending +193 isAscending +192 bubblesort +192 isAscending +191 isAscending +190 isAscending +189 isAscending +188 isAscending +187 bubblesort +187 isAscending +186 bubblesort +186 isAscending +185 isAscending +184 bubblesort +184 isAscending +173 bubblesort +170 bubblesort +167 bubblesort +164 bubblesort +156 main +156 bubblesort +153 main +153 bubblesort +149 main +149 bubblesort +147 main +147 bubblesort +137 main +137 bubblesort +134 main +134 bubblesort +132 bubblesort +130 bubblesort +129 bubblesort +128 bubblesort +126 bubblesort +125 bubblesort +124 bubblesort +121 bubblesort +120 main +120 bubblesort +114 bubblesort +112 bubblesort +109 bubblesort +107 bubblesort +Total number of mutants: 217 +Number of mutants in which we found an error: 69 \ No newline at end of file diff --git a/Results/arrays1_true_true_true_False_False_1 b/Results/arrays1_true_true_true_False_False_1 new file mode 100644 index 0000000..5cf1af5 --- /dev/null +++ b/Results/arrays1_true_true_true_False_False_1 @@ -0,0 +1,76 @@ +testFile: arrays1 +postCondVoid: true +postCondRefType: true +postCondPrimType: true +ignoreLibMethods: False +ignoreMainMethod: False +nrOfUnroll: 1 +erronous mutations detected: +96 findAndPrintPairs +93 main +93 findAndPrintPairs +90 main +90 findAndPrintPairs +85 main +85 findAndPrintPairs +71 goodResize +68 goodResize +67 goodResize +65 goodResize +52 badResize +49 badResize +48 badResize +46 badResize +38 findMin +36 findMin +34 findMin +30 findMin +28 findMin +24 findMin +217 bubblesort +210 isAscending +207 isAscending +203 isAscending +201 isAscending +196 isAscending +192 bubblesort +192 isAscending +188 isAscending +187 bubblesort +187 isAscending +186 bubblesort +186 isAscending +185 isAscending +184 bubblesort +173 bubblesort +170 bubblesort +167 bubblesort +164 bubblesort +156 main +156 bubblesort +153 main +153 bubblesort +149 main +149 bubblesort +147 main +147 bubblesort +137 main +137 bubblesort +134 main +134 bubblesort +132 bubblesort +130 bubblesort +129 bubblesort +128 bubblesort +126 bubblesort +125 bubblesort +124 bubblesort +121 bubblesort +120 main +120 bubblesort +114 bubblesort +112 bubblesort +109 bubblesort +107 bubblesort +Total number of mutants: 217 +Number of mutants in which we found an error: 53 \ No newline at end of file -- GitLab