diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000000000000000000000000000000000000..be99d2b4f5f68232726c7d65a10c5c89017137f3
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,55 @@
+# This file is a template, and might need editing before it works on your project.
+# Build JAVA applications using Apache Maven (http://maven.apache.org)
+# For docker image tags see https://hub.docker.com/_/maven/
+#
+# For general lifecycle information see https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
+
+# This template will build and test your projects
+# * Caches downloaded dependencies and plugins between invocation.
+# * Verify but don't deploy merge requests.
+# * Deploy built artifacts from master branch only.
+
+variables:
+ # This will suppress any download for dependencies and plugins or upload messages which would clutter the console log.
+ # `showDateTime` will show the passed time in milliseconds. You need to specify `--batch-mode` to make this work.
+ MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
+ # As of Maven 3.3.0 instead of this you may define these options in `.mvn/maven.config` so the same config is used
+ # when running from the command line.
+ # `installAtEnd` and `deployAtEnd` are only effective with recent version of the corresponding plugins.
+ MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"
+
+# This template uses jdk8 for verifying and deploying images
+image: maven:3-jdk-11
+
+# Cache downloaded dependencies and plugins between builds.
+# To keep cache across branches add 'key: "$CI_JOB_NAME"'
+cache:
+ paths:
+ - .m2/repository
+
+# For merge requests do not `deploy` but only run `verify`.
+# See https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
+.verify: &verify
+ stage: test
+ script:
+ - 'mvn $MAVEN_CLI_OPTS verify'
+ except:
+ - master
+
+# Verify merge requests using JDK8
+verify:jdk11:
+ <<: *verify
+
+# To deploy packages from CI, create a ci_settings.xml file
+# For deploying packages to GitLab's Maven Repository: See https://docs.gitlab.com/ee/user/project/packages/maven_repository.html#creating-maven-packages-with-gitlab-cicd for more details.
+# Please note: The GitLab Maven Repository is currently only available in GitLab Premium / Ultimate.
+# For `master` branch run `mvn deploy` automatically.
+deploy:jdk11:
+ stage: deploy
+ script:
+ - if [ ! -f ci_settings.xml ];
+ then echo "CI settings missing\! If deploying to GitLab Maven Repository, please see https://docs.gitlab.com/ee/user/project/packages/maven_repository.html#creating-maven-packages-with-gitlab-cicd for instructions.";
+ fi
+ - 'mvn $MAVEN_CLI_OPTS deploy -s ci_settings.xml'
+ only:
+ - master
diff --git a/pom.xml b/pom.xml
index 05254fcd2f667743bc11549d90f9a94f7ce2fcdf..536544fa863feaa7a41156e8e2df59f9939577d0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -21,6 +21,12 @@
11
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+
+ 3.0.0-M5
+
diff --git a/sdg-core/pom.xml b/sdg-core/pom.xml
index d60b2b2122af618f052a7fee5116f35f9f0937c0..efc9e873e851d0c153a1a25679784ad452954ff5 100644
--- a/sdg-core/pom.xml
+++ b/sdg-core/pom.xml
@@ -17,6 +17,19 @@
11
+
+
+
+ src/test/res
+
+ **/*.java
+ **/*.java.*.criterion
+ **/*.java.*.sliced
+
+
+
+
+
com.github.javaparser
diff --git a/sdg-core/src/test/java/es/upv/mist/slicing/SlicerTest.java b/sdg-core/src/test/java/es/upv/mist/slicing/SlicerTest.java
index 59d43fecea7a1d9850006286806de2bba7cc4052..1d03298f5b3b0ccb713f6695564a2d1230530777 100644
--- a/sdg-core/src/test/java/es/upv/mist/slicing/SlicerTest.java
+++ b/sdg-core/src/test/java/es/upv/mist/slicing/SlicerTest.java
@@ -11,6 +11,7 @@ import es.upv.mist.slicing.graphs.sdg.SDG;
import es.upv.mist.slicing.slicing.FileLineSlicingCriterion;
import es.upv.mist.slicing.slicing.Slice;
import es.upv.mist.slicing.slicing.SlicingCriterion;
+import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
@@ -18,10 +19,9 @@ import org.junit.jupiter.params.provider.MethodSource;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.LinkedList;
-import java.util.Scanner;
+import java.util.*;
+import java.util.function.Consumer;
+import java.util.function.Supplier;
public class SlicerTest {
static {
@@ -32,63 +32,136 @@ public class SlicerTest {
StaticJavaParser.getConfiguration().setAttributeComments(false);
}
- private static final String TEST_FILES = "./sdg-core/src/test/res/dinsa-tests";
+ private static final String TEST_PKG = "regression";
private static final String DOT_JAVA = ".java";
+ private static final String SDG_CRITERION = ".sdg.criterion";
+ private static final String SDG_SLICE = ".sdg.sliced";
- public static Collection findFiles(File directory, String suffix) throws FileNotFoundException {
- Collection res = new LinkedList<>();
+ public static void findFiles(File directory, String suffix, Consumer consumer) {
File[] files = directory.listFiles();
- if (files == null) return Collections.emptyList();
+ if (files == null)
+ return;
for (File f : files) {
- if (f.getName().endsWith(suffix))
- res.add(Arguments.of(f, getSliceFile(f), getCriterionLine(f)));
if (f.isDirectory())
- res.addAll(findFiles(f, suffix));
+ findFiles(f, suffix, consumer);
+ else if (f.getName().endsWith(suffix))
+ consumer.accept(f);
}
- return res;
}
- public static Arguments[] findAllFiles() throws FileNotFoundException {
- Collection args = findFiles(new File(TEST_FILES), DOT_JAVA);
+ public static Arguments[] findAllFiles() {
+ Collection args = new LinkedList<>();
+ File testFolder = new File(Thread.currentThread().getContextClassLoader().getResource(TEST_PKG).getPath());
+ findFiles(testFolder, DOT_JAVA, f -> createArgumentForTest(f).ifPresent(args::add));
return args.toArray(Arguments[]::new);
}
- private static File getSliceFile(File file) {
- return new File(file.getParent(), file.getName() + ".sdg.sliced");
- }
-
- private static int getCriterionLine(File file) throws FileNotFoundException {
- return new Scanner(new File(file.getParent(), file.getName() + ".sdg.criterion")).nextInt();
+ private static Optional createArgumentForTest(File javaFile) {
+ File slice = new File(javaFile.getParent(), javaFile.getName() + SDG_SLICE);
+ Optional criterion = findSDGCriterion(javaFile);
+ if (!slice.isFile() || !slice.canRead() || criterion.isEmpty())
+ return Optional.empty();
+ return Optional.of(Arguments.of(javaFile, slice, criterion.get()));
}
@ParameterizedTest(name = "[{index}] {0}")
@MethodSource("findAllFiles")
- public void sdgCompare(File source, File target, int criterionLine) throws FileNotFoundException {
- // Build the SDG
- SDG sdg = new ESSDG();
- sdg.build(new NodeList<>(StaticJavaParser.parse(source)));
- SlicingCriterion sc = new FileLineSlicingCriterion(source, criterionLine);
- Slice slice = sdg.slice(sc);
-
- // Convert the slice to code and output the result to `outputDir`
- NodeList slicedUnits = slice.toAst();
- assert slicedUnits.size() == 1;
- if (!target.exists()) {
- try (PrintWriter pw = new PrintWriter(target)) {
- pw.print(slicedUnits.get(0).toString());
- }
+ public void slicerRegressionTest(File source, File target, SlicingCriterion sc) throws FileNotFoundException {
+ if (!target.exists())
return;
+ Slice slice = slice(source ,sc);
+ boolean equal = slicesMatch(slice, target);
+ assert equal: "The slice for " + source.toString() + " has changed, please fix the error or update the reference slice.";
+ }
+
+ @Test
+ public void generateDefaultSlices() {
+ File testFolder = new File("./sdg-core/src/test/res/", TEST_PKG);
+ findFiles(testFolder, DOT_JAVA, SlicerTest::createAndSaveSlice);
+ }
+
+ private static Optional findSDGCriterion(File javaFile) {
+ File criterionFile = new File(javaFile.getParentFile(), javaFile.getName() + SDG_CRITERION);
+ try (Scanner in = new Scanner(criterionFile)) {
+ return Optional.of(new FileLineSlicingCriterion(javaFile, in.nextInt()));
+ } catch (FileNotFoundException | NoSuchElementException e) {
+ return Optional.empty();
+ }
+ }
+
+ private static void createAndSaveSlice(File javaFile) {
+ try {
+ File sliceFile = new File(javaFile.getParent(), javaFile.getName() + SDG_SLICE);
+ Optional sc = findSDGCriterion(javaFile);
+ if (sc.isEmpty() || sliceFile.exists())
+ return;
+ Slice slice = slice(javaFile, sc.get());
+ var cus = slice.toAst();
+ assert cus.size() == 1;
+ try (PrintWriter pw = new PrintWriter(sliceFile)) {
+ pw.write(cus.getFirst().get().toString());
+ }
+ } catch (FileNotFoundException e) {
+ System.err.println("Could not save slice due to missing file or permissions");
+ } catch (Exception e) {
+ System.err.println("Error generating slice for " + javaFile.toString());
+ System.err.println(e.getMessage());
+ e.printStackTrace();
}
- String targetSlice;
- {
+ }
+
+ private static boolean slicesMatch(Slice slice, File referenceSlice) {
+ NodeList cus = slice.toAst();
+ assert cus.size() == 1;
+ return Objects.equals(cus.getFirst().get().toString(), readFile(referenceSlice));
+ }
+
+ private static String readFile(File file, Supplier separator) {
+ try (Scanner in = new Scanner(file)) {
StringBuilder builder = new StringBuilder();
- Scanner in = new Scanner(target);
while (in.hasNextLine())
- builder.append(in.nextLine()).append('\n');
- targetSlice = builder.toString();
+ builder.append(in.nextLine()).append(separator.get());
+ return builder.toString();
+ } catch (FileNotFoundException e) {
+ return "";
}
- String ourSlice = slicedUnits.get(0).toString();
- boolean equal = targetSlice.equals(ourSlice);
- assert equal;
+ }
+
+ private static String readFile(File file) {
+ return readFile(file, () -> "\n");
+ }
+
+ private static Slice slice(File javaFile, SlicingCriterion sc) throws FileNotFoundException {
+ SDG sdg = new ESSDG();
+ sdg.build(new NodeList<>(StaticJavaParser.parse(javaFile)));
+ return sdg.slice(sc);
+ }
+
+ public static void main(String[] args) {
+ Scanner in = new Scanner(System.in);
+ File testFolder = new File("./sdg-core/src/test/res/", TEST_PKG);
+ findFiles(testFolder, DOT_JAVA, file -> {
+ File sliceFile = new File(file.getParent(), file.getName() + SDG_CRITERION);
+ if (!sliceFile.exists()) {
+ int[] counter = new int[] { 1 };
+ System.out.printf("%3d", counter[0]++);
+ System.out.print(readFile(file, () -> String.format("\n%3d", counter[0]++)));
+ System.out.printf("No criterion found for this program (%s), please input one (-1 to skip)\nCriterion: ", file);
+ int line = in.nextInt();
+ if (line == -1)
+ return;
+ while (line <= 0 || line >= counter[0] - 2) {
+ System.out.printf("Your input is out-of-bounds, please try again [1-%d]: ", counter[0] - 2);
+ line = in.nextInt();
+ }
+ System.out.printf("Saving line %d as slicing criterion for %s... ", line, file);
+ try (PrintWriter pw = new PrintWriter(sliceFile)) {
+ pw.write(line + "");
+ System.out.println("DONE");
+ } catch (FileNotFoundException e) {
+ System.out.println("ERROR");
+ }
+ }
+ });
}
}
diff --git a/sdg-core/src/test/res/papers/Example1_Horwitz_PPDG.java b/sdg-core/src/test/res/papers/Example1_Horwitz_PPDG.java
deleted file mode 100644
index da381ff8c1846f60e344f4294a9f3c2edcbef40b..0000000000000000000000000000000000000000
--- a/sdg-core/src/test/res/papers/Example1_Horwitz_PPDG.java
+++ /dev/null
@@ -1,8 +0,0 @@
-public class Test {
- public static void main(String[] args) {
- switch (X) {
- case e1:
-
- }
- }
-}
\ No newline at end of file
diff --git a/sdg-core/src/test/res/carlos/Classic.java b/sdg-core/src/test/res/regression/carlos/Classic.java
similarity index 94%
rename from sdg-core/src/test/res/carlos/Classic.java
rename to sdg-core/src/test/res/regression/carlos/Classic.java
index 4b062ad6a86cb9ee9fc129572e3cf6dc6918d2b6..074070ffc6a3f8bd555b4d2b15d7531af94d7853 100644
--- a/sdg-core/src/test/res/carlos/Classic.java
+++ b/sdg-core/src/test/res/regression/carlos/Classic.java
@@ -1,3 +1,5 @@
+import java.util.Scanner;
+
public class Classic {
public static void main(String[] args) {
int sum = 0;
@@ -18,7 +20,7 @@ public class Classic {
int chars = 1;
String subtext = "";
int i = 0;
- while (i < text.size()) {
+ while (i < text.length()) {
char c = text.charAt(i);
if (c == '\n') {
lines += 1;
diff --git a/sdg-core/src/test/res/regression/carlos/Classic.java.sdg.criterion b/sdg-core/src/test/res/regression/carlos/Classic.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..b1bd38b62a0800a4f6a80c34e21c5acffae52c7e
--- /dev/null
+++ b/sdg-core/src/test/res/regression/carlos/Classic.java.sdg.criterion
@@ -0,0 +1 @@
+13
diff --git a/sdg-core/src/test/res/regression/carlos/Classic.java.sdg.sliced b/sdg-core/src/test/res/regression/carlos/Classic.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..b1cec7bdd3f7cde5831d2f4ee2e1a9b22c15047e
--- /dev/null
+++ b/sdg-core/src/test/res/regression/carlos/Classic.java.sdg.sliced
@@ -0,0 +1,12 @@
+import java.util.Scanner;
+
+public class Classic {
+
+ public static void main(String[] args) {
+ int product = 1;
+ for (int i = 1; i < N; i++) {
+ product *= i;
+ }
+ System.out.println(product);
+ }
+}
diff --git a/sdg-core/src/test/res/carlos/Problem1.java b/sdg-core/src/test/res/regression/carlos/Problem1.java
similarity index 59%
rename from sdg-core/src/test/res/carlos/Problem1.java
rename to sdg-core/src/test/res/regression/carlos/Problem1.java
index 72608748b93232fdf904f1643918938abf3b3022..925a4e82ac490e6cadbe52a61efbc73387133f37 100644
--- a/sdg-core/src/test/res/carlos/Problem1.java
+++ b/sdg-core/src/test/res/regression/carlos/Problem1.java
@@ -3,14 +3,14 @@ public class Problem1 {
while (X) {
if (Y) {
if (Z) {
- A();
+ System.out.println("A");
break;
}
- B();
+ System.out.println("B");
break;
}
- C();
+ System.out.println("C");
}
- D();
+ System.out.println("D");
}
-}
\ No newline at end of file
+}
diff --git a/sdg-core/src/test/res/regression/carlos/Problem1.java.sdg.criterion b/sdg-core/src/test/res/regression/carlos/Problem1.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..da2d3988d7d1a255376770b1e87394ebb42febb3
--- /dev/null
+++ b/sdg-core/src/test/res/regression/carlos/Problem1.java.sdg.criterion
@@ -0,0 +1 @@
+14
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/carlos/Problem1.java.sdg.sliced b/sdg-core/src/test/res/regression/carlos/Problem1.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..624bb93025b503564fefca4f658488224f7c7e7d
--- /dev/null
+++ b/sdg-core/src/test/res/regression/carlos/Problem1.java.sdg.sliced
@@ -0,0 +1,6 @@
+public class Problem1 {
+
+ public static void main(String[] args) {
+ System.out.println("D");
+ }
+}
diff --git a/sdg-core/src/test/res/carlos/Problem2.java b/sdg-core/src/test/res/regression/carlos/Problem2.java
similarity index 100%
rename from sdg-core/src/test/res/carlos/Problem2.java
rename to sdg-core/src/test/res/regression/carlos/Problem2.java
diff --git a/sdg-core/src/test/res/regression/carlos/Problem2.java.sdg.criterion b/sdg-core/src/test/res/regression/carlos/Problem2.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..f11c82a4cb6cc2e8f3bdf52b5cdeaad4d5bb214e
--- /dev/null
+++ b/sdg-core/src/test/res/regression/carlos/Problem2.java.sdg.criterion
@@ -0,0 +1 @@
+9
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/carlos/Problem2.java.sdg.sliced b/sdg-core/src/test/res/regression/carlos/Problem2.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..369ed034b4f3e47808b556e09d3b4dcb3fb8009a
--- /dev/null
+++ b/sdg-core/src/test/res/regression/carlos/Problem2.java.sdg.sliced
@@ -0,0 +1,7 @@
+public class Problem2 {
+
+ public static void main(String[] args) {
+ int a = 0;
+ System.out.println(a);
+ }
+}
diff --git a/sdg-core/src/test/res/carlos/Problem3.java b/sdg-core/src/test/res/regression/carlos/Problem3.java
similarity index 100%
rename from sdg-core/src/test/res/carlos/Problem3.java
rename to sdg-core/src/test/res/regression/carlos/Problem3.java
diff --git a/sdg-core/src/test/res/regression/carlos/Problem3.java.sdg.criterion b/sdg-core/src/test/res/regression/carlos/Problem3.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..25bf17fc5aaabd17402e77a2b16f95fbea7310d2
--- /dev/null
+++ b/sdg-core/src/test/res/regression/carlos/Problem3.java.sdg.criterion
@@ -0,0 +1 @@
+18
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/carlos/Problem3.java.sdg.sliced b/sdg-core/src/test/res/regression/carlos/Problem3.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..4fadd2bf812a24a1b020ba63b3697a03a04f6268
--- /dev/null
+++ b/sdg-core/src/test/res/regression/carlos/Problem3.java.sdg.sliced
@@ -0,0 +1,13 @@
+public class Problem3 {
+
+ public static void main() throws Exception {
+ x = 0;
+ f();
+ }
+
+ public static void f() throws Exception {
+ if (x % 2 == 0)
+ throw new Exception("error!");
+ System.out.println("x = " + x);
+ }
+}
diff --git a/sdg-core/src/test/res/carlos/Test1.java b/sdg-core/src/test/res/regression/carlos/Test1.java
similarity index 100%
rename from sdg-core/src/test/res/carlos/Test1.java
rename to sdg-core/src/test/res/regression/carlos/Test1.java
diff --git a/sdg-core/src/test/res/regression/carlos/Test1.java.sdg.criterion b/sdg-core/src/test/res/regression/carlos/Test1.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..62f9457511f879886bb7728c986fe10b0ece6bcb
--- /dev/null
+++ b/sdg-core/src/test/res/regression/carlos/Test1.java.sdg.criterion
@@ -0,0 +1 @@
+6
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/carlos/Test1.java.sdg.sliced b/sdg-core/src/test/res/regression/carlos/Test1.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..c45927c38b024c3cbc57318904157050756fa73a
--- /dev/null
+++ b/sdg-core/src/test/res/regression/carlos/Test1.java.sdg.sliced
@@ -0,0 +1,6 @@
+public class Test1 {
+
+ public static void main(String[] args) {
+ System.out.println(true);
+ }
+}
diff --git a/sdg-core/src/test/res/regression/carlos/TestJosep.java b/sdg-core/src/test/res/regression/carlos/TestJosep.java
new file mode 100644
index 0000000000000000000000000000000000000000..518eba5edb59eb5f9af5e67adbe33bb3bb445621
--- /dev/null
+++ b/sdg-core/src/test/res/regression/carlos/TestJosep.java
@@ -0,0 +1,43 @@
+public class TestJosep {
+ int x = 0;
+ public static void main(int y) {
+ int z = 0;
+ while (y > z) {
+ y--;
+ if (x > 10) {
+ log(x);
+ } else {
+ log(z);
+ }
+
+ }
+ switch (z) {
+ case 1:
+ x--;
+ break;
+ case 2:
+ x++;
+ default:
+ log(x);
+ break;
+ case 3:
+ y = x + z;
+ break;
+ }
+ log(x);
+ log(y);
+ log(z);
+ }
+
+ public void objetos() {
+ Object o = new Object();
+ o.x = 10;
+ Object y = new Object();
+ y.z = 210;
+ o = y;
+ log(o);
+ log(y);
+ }
+
+ public void log(Object o) {}
+}
diff --git a/sdg-core/src/test/res/regression/carlos/TestJosep.java.sdg.criterion b/sdg-core/src/test/res/regression/carlos/TestJosep.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..d99e90eb9675f72290ba32fbf844c1cb45c72718
--- /dev/null
+++ b/sdg-core/src/test/res/regression/carlos/TestJosep.java.sdg.criterion
@@ -0,0 +1 @@
+29
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/carlos/TestJosep.java.sdg.sliced b/sdg-core/src/test/res/regression/carlos/TestJosep.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..da134e6834fce5a16b7c1e7fc0e530188cb1b7a0
--- /dev/null
+++ b/sdg-core/src/test/res/regression/carlos/TestJosep.java.sdg.sliced
@@ -0,0 +1,6 @@
+public class TestJosep {
+
+ public static void main(int y) {
+ log(z);
+ }
+}
diff --git a/sdg-core/src/test/res/regression/dinsa-tests/Carlos1.java b/sdg-core/src/test/res/regression/dinsa-tests/Carlos1.java
new file mode 100644
index 0000000000000000000000000000000000000000..545396ddcfbca62e67fdf4e74a5192ba0450f7df
--- /dev/null
+++ b/sdg-core/src/test/res/regression/dinsa-tests/Carlos1.java
@@ -0,0 +1,51 @@
+class A{
+
+public static void main(String[] args){
+
+ int x = 0;
+
+ try {
+ if (x==0)
+ {
+ throw generadorExcepciones(2);
+ }
+ else throw generadorExcepciones(2);
+ }
+ catch(Exception3 eb) {System.out.println("Capturada Exception3");}
+ catch(Exception2 ea) {System.out.println("Capturada Exception2");}
+ catch(Exception e) {System.out.println("Capturada Exception");}
+
+ int SC = 42;
+}
+
+
+
+static Exception generadorExcepciones(int x){
+ Exception e1 = new Exception();
+ Exception2 e2 = new Exception2();
+ Exception3 e3 = new Exception3();
+
+ switch (x) {
+ case 1: return e1;
+ case 2: return e2;
+ case 3: return e3;
+ }
+ return e1;
+}
+}
+
+class Exception2 extends Exception{
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+}
+
+class Exception3 extends Exception2{
+
+/**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+}
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/dinsa-tests/Carlos1.java.sdg.criterion b/sdg-core/src/test/res/regression/dinsa-tests/Carlos1.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..3c032078a4a21c5c51d3c93d91717c1dabbb8cd0
--- /dev/null
+++ b/sdg-core/src/test/res/regression/dinsa-tests/Carlos1.java.sdg.criterion
@@ -0,0 +1 @@
+18
diff --git a/sdg-core/src/test/res/regression/dinsa-tests/Carlos1.java.sdg.sliced b/sdg-core/src/test/res/regression/dinsa-tests/Carlos1.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..18cd2cc996843a7c6eb2007d97f2882b299af306
--- /dev/null
+++ b/sdg-core/src/test/res/regression/dinsa-tests/Carlos1.java.sdg.sliced
@@ -0,0 +1,12 @@
+class A {
+
+ public static void main(String[] args) {
+ int SC = 42;
+ }
+}
+
+class Exception2 extends Exception {
+}
+
+class Exception3 extends Exception2 {
+}
diff --git a/sdg-core/src/test/res/regression/dinsa-tests/Carlos2.java b/sdg-core/src/test/res/regression/dinsa-tests/Carlos2.java
new file mode 100644
index 0000000000000000000000000000000000000000..04e5792cf0c178436132034c96a54c64f95a8fb6
--- /dev/null
+++ b/sdg-core/src/test/res/regression/dinsa-tests/Carlos2.java
@@ -0,0 +1,47 @@
+class A{
+
+public static void main(String[] args){
+
+ try {
+
+ try {
+ throw generadorExcepciones(2);
+ }
+ catch(Exception3 eb) {System.out.println("Capturada Exception3");}
+ catch(Exception2 ea) {System.out.println("Capturada Exception2");}
+ //catch(Exception e) {System.out.println("Capturada Exception");}
+
+ int SC = 42;
+
+ } catch(Exception e) {System.out.println("Capturada Exception");}
+}
+
+static Exception generadorExcepciones(int x){
+ Exception e1 = new Exception();
+ Exception2 e2 = new Exception2();
+ Exception3 e3 = new Exception3();
+
+ switch (x) {
+ case 1: return e1;
+ case 2: return e2;
+ case 3: return e3;
+ }
+ return e1;
+}
+}
+
+class Exception2 extends Exception{
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+}
+
+class Exception3 extends Exception2{
+
+/**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+}
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/dinsa-tests/Carlos2.java.sdg.criterion b/sdg-core/src/test/res/regression/dinsa-tests/Carlos2.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..8351c19397f4fcd5238d10034fa7fa384f14d580
--- /dev/null
+++ b/sdg-core/src/test/res/regression/dinsa-tests/Carlos2.java.sdg.criterion
@@ -0,0 +1 @@
+14
diff --git a/sdg-core/src/test/res/regression/dinsa-tests/Carlos2.java.sdg.sliced b/sdg-core/src/test/res/regression/dinsa-tests/Carlos2.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..0df3d837d445ef88a28c59371f9df018404910c0
--- /dev/null
+++ b/sdg-core/src/test/res/regression/dinsa-tests/Carlos2.java.sdg.sliced
@@ -0,0 +1,34 @@
+class A {
+
+ public static void main(String[] args) {
+ try {
+ try {
+ throw generadorExcepciones(2);
+ } catch (Exception3 eb) {
+ } catch (Exception2 ea) {
+ }
+ int SC = 42;
+ }
+ }
+
+ static Exception generadorExcepciones(int x) {
+ Exception e1 = new Exception();
+ Exception2 e2 = new Exception2();
+ Exception3 e3 = new Exception3();
+ switch(x) {
+ case 1:
+ return e1;
+ case 2:
+ return e2;
+ case 3:
+ return e3;
+ }
+ return e1;
+ }
+}
+
+class Exception2 extends Exception {
+}
+
+class Exception3 extends Exception2 {
+}
diff --git a/sdg-core/src/test/res/regression/dinsa-tests/Josep.java b/sdg-core/src/test/res/regression/dinsa-tests/Josep.java
new file mode 100644
index 0000000000000000000000000000000000000000..51bda6f416695dea4e664fbe94cd3a92799cabc4
--- /dev/null
+++ b/sdg-core/src/test/res/regression/dinsa-tests/Josep.java
@@ -0,0 +1,49 @@
+
+public class Josep {
+
+ public static void main(String[] args) {
+ int suma =0;
+ suma += factorial(5);
+ suma += factorial2(5);
+ System.out.print(suma); // SLICING CRITERION
+ }
+
+ static int factorial(int x)
+ {
+ int contador = 1;
+ int fact = 1;
+ while (contador 10)
+ break;
+ x++;
+ }
+ }
+}
diff --git a/sdg-core/src/test/res/ltd-samples/BasicContinue.java b/sdg-core/src/test/res/regression/ltd-samples/BasicContinue.java
similarity index 100%
rename from sdg-core/src/test/res/ltd-samples/BasicContinue.java
rename to sdg-core/src/test/res/regression/ltd-samples/BasicContinue.java
diff --git a/sdg-core/src/test/res/regression/ltd-samples/BasicContinue.java.sdg.criterion b/sdg-core/src/test/res/regression/ltd-samples/BasicContinue.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..da2d3988d7d1a255376770b1e87394ebb42febb3
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/BasicContinue.java.sdg.criterion
@@ -0,0 +1 @@
+14
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/ltd-samples/BasicContinue.java.sdg.sliced b/sdg-core/src/test/res/regression/ltd-samples/BasicContinue.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..c00796b61a5be7f4f09138b37e74b23c064e3c84
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/BasicContinue.java.sdg.sliced
@@ -0,0 +1,14 @@
+package mytest;
+
+public class BasicContinue {
+
+ public static void main(String[] args) {
+ int x = 0;
+ bucle: while (x < 20) {
+ x++;
+ if (x > 10)
+ continue;
+ x++;
+ }
+ }
+}
diff --git a/sdg-core/src/test/res/ltd-samples/BasicForeach.java b/sdg-core/src/test/res/regression/ltd-samples/BasicForeach.java
similarity index 100%
rename from sdg-core/src/test/res/ltd-samples/BasicForeach.java
rename to sdg-core/src/test/res/regression/ltd-samples/BasicForeach.java
diff --git a/sdg-core/src/test/res/regression/ltd-samples/BasicForeach.java.sdg.criterion b/sdg-core/src/test/res/regression/ltd-samples/BasicForeach.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..62f9457511f879886bb7728c986fe10b0ece6bcb
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/BasicForeach.java.sdg.criterion
@@ -0,0 +1 @@
+6
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/ltd-samples/BasicForeach.java.sdg.sliced b/sdg-core/src/test/res/regression/ltd-samples/BasicForeach.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..eee2fcd5b035d7d055902be33d64b6729c38855a
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/BasicForeach.java.sdg.sliced
@@ -0,0 +1,9 @@
+public class BasicForeach {
+
+ public static void main(String[] args) {
+ int[] numbers = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
+ for (int item : numbers) {
+ System.out.println("Count is: " + item);
+ }
+ }
+}
diff --git a/sdg-core/src/test/res/ltd-samples/BasicIf.java b/sdg-core/src/test/res/regression/ltd-samples/BasicIf.java
similarity index 100%
rename from sdg-core/src/test/res/ltd-samples/BasicIf.java
rename to sdg-core/src/test/res/regression/ltd-samples/BasicIf.java
diff --git a/sdg-core/src/test/res/regression/ltd-samples/BasicIf.java.sdg.criterion b/sdg-core/src/test/res/regression/ltd-samples/BasicIf.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..62f9457511f879886bb7728c986fe10b0ece6bcb
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/BasicIf.java.sdg.criterion
@@ -0,0 +1 @@
+6
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/ltd-samples/BasicIf.java.sdg.sliced b/sdg-core/src/test/res/regression/ltd-samples/BasicIf.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..2c3e7d825327d7c6485b9925d816ab39afda813d
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/BasicIf.java.sdg.sliced
@@ -0,0 +1,11 @@
+public class BasicIf {
+
+ public static void main(String[] args) {
+ boolean isMoving = false;
+ int currentSpeed = 10;
+ if (isMoving) {
+ currentSpeed--;
+ } else {
+ }
+ }
+}
diff --git a/sdg-core/src/test/res/ltd-samples/BasicIfElse.java b/sdg-core/src/test/res/regression/ltd-samples/BasicIfElse.java
similarity index 100%
rename from sdg-core/src/test/res/ltd-samples/BasicIfElse.java
rename to sdg-core/src/test/res/regression/ltd-samples/BasicIfElse.java
diff --git a/sdg-core/src/test/res/regression/ltd-samples/BasicIfElse.java.sdg.criterion b/sdg-core/src/test/res/regression/ltd-samples/BasicIfElse.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..8e2afd342773582f9484b796cdc0b84736e8194e
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/BasicIfElse.java.sdg.criterion
@@ -0,0 +1 @@
+17
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/ltd-samples/BasicIfElse.java.sdg.sliced b/sdg-core/src/test/res/regression/ltd-samples/BasicIfElse.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..4e8c16da681ed843f49458d705e262cb859d5eff
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/BasicIfElse.java.sdg.sliced
@@ -0,0 +1,19 @@
+public class BasicIfElse {
+
+ public static void main(String[] args) {
+ int testscore = 76;
+ char grade;
+ if (testscore >= 90) {
+ grade = 'A';
+ } else if (testscore >= 80) {
+ grade = 'B';
+ } else if (testscore >= 70) {
+ grade = 'C';
+ } else if (testscore >= 60) {
+ grade = 'D';
+ } else {
+ grade = 'F';
+ }
+ System.out.println("Grade = " + grade);
+ }
+}
diff --git a/sdg-core/src/test/res/ltd-samples/BasicSwitch.java b/sdg-core/src/test/res/regression/ltd-samples/BasicSwitch.java
similarity index 100%
rename from sdg-core/src/test/res/ltd-samples/BasicSwitch.java
rename to sdg-core/src/test/res/regression/ltd-samples/BasicSwitch.java
diff --git a/sdg-core/src/test/res/regression/ltd-samples/BasicSwitch.java.sdg.criterion b/sdg-core/src/test/res/regression/ltd-samples/BasicSwitch.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..978b4e8e518d1242cbf102a1bebdb52e41705102
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/BasicSwitch.java.sdg.criterion
@@ -0,0 +1 @@
+26
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/ltd-samples/BasicSwitch.java.sdg.sliced b/sdg-core/src/test/res/regression/ltd-samples/BasicSwitch.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..7dd819c5b6319369751187d4f7f3ab1a899e4d1f
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/BasicSwitch.java.sdg.sliced
@@ -0,0 +1,28 @@
+package mytest;
+
+public class BasicSwitch {
+
+ public static void main(String[] args) {
+ int x = Integer.valueOf(args[0]);
+ int y = -1;
+ switch(x) {
+ case 1:
+ y = 10;
+ break;
+ case 2:
+ y = 20;
+ break;
+ case 3:
+ y = 30;
+ break;
+ case 4:
+ case 5:
+ y = 100;
+ break;
+ case 6:
+ case 10:
+ y = 0;
+ }
+ System.out.println(y);
+ }
+}
diff --git a/sdg-core/src/test/res/ltd-samples/BasicSwitchDefault.java b/sdg-core/src/test/res/regression/ltd-samples/BasicSwitchDefault.java
similarity index 100%
rename from sdg-core/src/test/res/ltd-samples/BasicSwitchDefault.java
rename to sdg-core/src/test/res/regression/ltd-samples/BasicSwitchDefault.java
diff --git a/sdg-core/src/test/res/regression/ltd-samples/BasicSwitchDefault.java.sdg.criterion b/sdg-core/src/test/res/regression/ltd-samples/BasicSwitchDefault.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..b5045cc4046dbc1d7cafa4c603fd3cdf35dc5dde
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/BasicSwitchDefault.java.sdg.criterion
@@ -0,0 +1 @@
+21
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/ltd-samples/BasicSwitchDefault.java.sdg.sliced b/sdg-core/src/test/res/regression/ltd-samples/BasicSwitchDefault.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..66b717c21d9fae408f324f6e0c3182c352fc6475
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/BasicSwitchDefault.java.sdg.sliced
@@ -0,0 +1,24 @@
+package mytest;
+
+public class BasicSwitchDefault {
+
+ public static void main(String[] args) {
+ int x = Integer.valueOf(args[0]);
+ int y;
+ switch(x % 3) {
+ case 0:
+ y = 10;
+ break;
+ case 1:
+ y = 20;
+ break;
+ case 2:
+ y = 30;
+ break;
+ default:
+ y = -1;
+ break;
+ }
+ System.out.println(y);
+ }
+}
diff --git a/sdg-core/src/test/res/ltd-samples/BasicSwitchNoBreak.java b/sdg-core/src/test/res/regression/ltd-samples/BasicSwitchNoBreak.java
similarity index 100%
rename from sdg-core/src/test/res/ltd-samples/BasicSwitchNoBreak.java
rename to sdg-core/src/test/res/regression/ltd-samples/BasicSwitchNoBreak.java
diff --git a/sdg-core/src/test/res/regression/ltd-samples/BasicSwitchNoBreak.java.sdg.criterion b/sdg-core/src/test/res/regression/ltd-samples/BasicSwitchNoBreak.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..da2d3988d7d1a255376770b1e87394ebb42febb3
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/BasicSwitchNoBreak.java.sdg.criterion
@@ -0,0 +1 @@
+14
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/ltd-samples/BasicSwitchNoBreak.java.sdg.sliced b/sdg-core/src/test/res/regression/ltd-samples/BasicSwitchNoBreak.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..1f56da90ab2c29ac19b4bac00c19a0b3ea5f5ff5
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/BasicSwitchNoBreak.java.sdg.sliced
@@ -0,0 +1,15 @@
+package mytest;
+
+public class BasicSwitchNoBreak {
+
+ public static void main(String[] args) {
+ String res = "";
+ switch(args[0]) {
+ case "a":
+ case "b":
+ case "c":
+ res = "cab";
+ }
+ System.out.println(res);
+ }
+}
diff --git a/sdg-core/src/test/res/ltd-samples/Bucles_1.java b/sdg-core/src/test/res/regression/ltd-samples/Bucles_1.java
similarity index 100%
rename from sdg-core/src/test/res/ltd-samples/Bucles_1.java
rename to sdg-core/src/test/res/regression/ltd-samples/Bucles_1.java
diff --git a/sdg-core/src/test/res/regression/ltd-samples/Bucles_1.java.sdg.criterion b/sdg-core/src/test/res/regression/ltd-samples/Bucles_1.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..9a037142aa3c1b4c490e1a38251620f113465330
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/Bucles_1.java.sdg.criterion
@@ -0,0 +1 @@
+10
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/ltd-samples/Bucles_1.java.sdg.sliced b/sdg-core/src/test/res/regression/ltd-samples/Bucles_1.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..d66b56b964dc16a8f4ab17a0cd8e566eb4f863d8
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/Bucles_1.java.sdg.sliced
@@ -0,0 +1,11 @@
+package ejemplos;
+
+public class Bucles_1 {
+
+ public static void main(String[] args) {
+ int x = 1;
+ while (x <= 10) {
+ x++;
+ }
+ }
+}
diff --git a/sdg-core/src/test/res/ltd-samples/Bucles_2.java b/sdg-core/src/test/res/regression/ltd-samples/Bucles_2.java
similarity index 100%
rename from sdg-core/src/test/res/ltd-samples/Bucles_2.java
rename to sdg-core/src/test/res/regression/ltd-samples/Bucles_2.java
diff --git a/sdg-core/src/test/res/regression/ltd-samples/Bucles_2.java.sdg.criterion b/sdg-core/src/test/res/regression/ltd-samples/Bucles_2.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..8e2afd342773582f9484b796cdc0b84736e8194e
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/Bucles_2.java.sdg.criterion
@@ -0,0 +1 @@
+17
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/ltd-samples/Bucles_2.java.sdg.sliced b/sdg-core/src/test/res/regression/ltd-samples/Bucles_2.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..536db499c20398cbeb9db6f68e2d5b6fb935bf11
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/Bucles_2.java.sdg.sliced
@@ -0,0 +1,11 @@
+package ejemplos;
+
+public class Bucles_2 {
+
+ public static void main(String[] args) {
+ int x = 1;
+ while (x <= 10) {
+ x++;
+ }
+ }
+}
diff --git a/sdg-core/src/test/res/ltd-samples/Bucles_3.java b/sdg-core/src/test/res/regression/ltd-samples/Bucles_3.java
similarity index 100%
rename from sdg-core/src/test/res/ltd-samples/Bucles_3.java
rename to sdg-core/src/test/res/regression/ltd-samples/Bucles_3.java
diff --git a/sdg-core/src/test/res/regression/ltd-samples/Bucles_3.java.sdg.criterion b/sdg-core/src/test/res/regression/ltd-samples/Bucles_3.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..d99e90eb9675f72290ba32fbf844c1cb45c72718
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/Bucles_3.java.sdg.criterion
@@ -0,0 +1 @@
+29
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/ltd-samples/Bucles_3.java.sdg.sliced b/sdg-core/src/test/res/regression/ltd-samples/Bucles_3.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..b269ac3ea882e8d1f6a3307325081a9b21147d4c
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/Bucles_3.java.sdg.sliced
@@ -0,0 +1,13 @@
+package ejemplos;
+
+public class Bucles_3 {
+
+ public static void main(String[] args) {
+ int x;
+ x = 1;
+ x = 1;
+ do {
+ x++;
+ } while (x <= 10);
+ }
+}
diff --git a/sdg-core/src/test/res/ltd-samples/Bucles_4.java b/sdg-core/src/test/res/regression/ltd-samples/Bucles_4.java
similarity index 100%
rename from sdg-core/src/test/res/ltd-samples/Bucles_4.java
rename to sdg-core/src/test/res/regression/ltd-samples/Bucles_4.java
diff --git a/sdg-core/src/test/res/regression/ltd-samples/Bucles_4.java.sdg.criterion b/sdg-core/src/test/res/regression/ltd-samples/Bucles_4.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..8580e7b684b14da5d9f84ab4eaf2f5139d508cbe
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/Bucles_4.java.sdg.criterion
@@ -0,0 +1 @@
+30
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/ltd-samples/Bucles_4.java.sdg.sliced b/sdg-core/src/test/res/regression/ltd-samples/Bucles_4.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..75a9bcb5687f8f9bde35c56088ceebf9b3d535eb
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/Bucles_4.java.sdg.sliced
@@ -0,0 +1,14 @@
+package ejemplos;
+
+public class Bucles_4 {
+
+ public static void main(String[] args) {
+ int sumatorio = 0;
+ int min = 10;
+ int max = 100;
+ for (int num = min; num <= max; num++) {
+ sumatorio += num;
+ }
+ System.out.println(sumatorio);
+ }
+}
diff --git a/sdg-core/src/test/res/ltd-samples/Bucles_5.java b/sdg-core/src/test/res/regression/ltd-samples/Bucles_5.java
similarity index 100%
rename from sdg-core/src/test/res/ltd-samples/Bucles_5.java
rename to sdg-core/src/test/res/regression/ltd-samples/Bucles_5.java
diff --git a/sdg-core/src/test/res/regression/ltd-samples/Bucles_5.java.sdg.criterion b/sdg-core/src/test/res/regression/ltd-samples/Bucles_5.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..aaa6442fe902e96a5233b136b973b96a4011fc18
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/Bucles_5.java.sdg.criterion
@@ -0,0 +1 @@
+41
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/ltd-samples/Bucles_5.java.sdg.sliced b/sdg-core/src/test/res/regression/ltd-samples/Bucles_5.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..7fac87e82cd560ce0227a6ebe839dcac27891e2f
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/Bucles_5.java.sdg.sliced
@@ -0,0 +1,13 @@
+package ejemplos;
+
+public class Bucles_5 {
+
+ public static void main(String[] args) {
+ int x = 0;
+ x = 1;
+ x = 1;
+ do {
+ x++;
+ } while (x <= 10);
+ }
+}
diff --git a/sdg-core/src/test/res/ltd-samples/Bucles_6.java b/sdg-core/src/test/res/regression/ltd-samples/Bucles_6.java
similarity index 100%
rename from sdg-core/src/test/res/ltd-samples/Bucles_6.java
rename to sdg-core/src/test/res/regression/ltd-samples/Bucles_6.java
diff --git a/sdg-core/src/test/res/regression/ltd-samples/Bucles_6.java.sdg.criterion b/sdg-core/src/test/res/regression/ltd-samples/Bucles_6.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..dec2bf5d6199c7cd0d84f3dc1e76a73ccc336302
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/Bucles_6.java.sdg.criterion
@@ -0,0 +1 @@
+19
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/ltd-samples/Bucles_6.java.sdg.sliced b/sdg-core/src/test/res/regression/ltd-samples/Bucles_6.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..4a65de7a0d3324ac6c4bbd8b679feec8fa4184ee
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/Bucles_6.java.sdg.sliced
@@ -0,0 +1,17 @@
+package ejemplos;
+
+public class Bucles_6 {
+
+ public static void main(String[] args) {
+ int x = 1;
+ while (x <= 10) {
+ x++;
+ while (x <= 10) {
+ x++;
+ }
+ }
+ while (x <= 10) {
+ x++;
+ }
+ }
+}
diff --git a/sdg-core/src/test/res/ltd-samples/Bucles_Josep.java b/sdg-core/src/test/res/regression/ltd-samples/Bucles_Josep.java
similarity index 100%
rename from sdg-core/src/test/res/ltd-samples/Bucles_Josep.java
rename to sdg-core/src/test/res/regression/ltd-samples/Bucles_Josep.java
diff --git a/sdg-core/src/test/res/regression/ltd-samples/Bucles_Josep.java.sdg.criterion b/sdg-core/src/test/res/regression/ltd-samples/Bucles_Josep.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..b74e882ae378d7e5aae630f48c20dd1e40186d98
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/Bucles_Josep.java.sdg.criterion
@@ -0,0 +1 @@
+31
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/ltd-samples/Bucles_Josep.java.sdg.sliced b/sdg-core/src/test/res/regression/ltd-samples/Bucles_Josep.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..7883a00d30d3626261269a2f7d14d165362952d6
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/Bucles_Josep.java.sdg.sliced
@@ -0,0 +1,10 @@
+package ejemplos;
+
+public class Bucles_Josep {
+
+ public static void main(String[] args) {
+ int x = 0;
+ int y = 0, z = 0;
+ z = x + y;
+ }
+}
diff --git a/sdg-core/src/test/res/ltd-samples/ReturnTest.java b/sdg-core/src/test/res/regression/ltd-samples/ReturnTest.java
similarity index 100%
rename from sdg-core/src/test/res/ltd-samples/ReturnTest.java
rename to sdg-core/src/test/res/regression/ltd-samples/ReturnTest.java
diff --git a/sdg-core/src/test/res/regression/ltd-samples/ReturnTest.java.sdg.criterion b/sdg-core/src/test/res/regression/ltd-samples/ReturnTest.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..301160a93062df23030a69f4b5e4d9bf71866ee9
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/ReturnTest.java.sdg.criterion
@@ -0,0 +1 @@
+8
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/ltd-samples/ReturnTest.java.sdg.sliced b/sdg-core/src/test/res/regression/ltd-samples/ReturnTest.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..5d292fe8cc72abfc872451a5f2a86667e2e1f9c5
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/ReturnTest.java.sdg.sliced
@@ -0,0 +1,10 @@
+public class ReturnTest {
+
+ public static void main(String[] args) {
+ int i = Integer.valueOf(args[0]);
+ if (i == 0) {
+ } else {
+ System.out.println("false");
+ }
+ }
+}
diff --git a/sdg-core/src/test/res/ltd-samples/Test_1.java b/sdg-core/src/test/res/regression/ltd-samples/Test_1.java
similarity index 100%
rename from sdg-core/src/test/res/ltd-samples/Test_1.java
rename to sdg-core/src/test/res/regression/ltd-samples/Test_1.java
diff --git a/sdg-core/src/test/res/regression/ltd-samples/Test_1.java.sdg.criterion b/sdg-core/src/test/res/regression/ltd-samples/Test_1.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..9a037142aa3c1b4c490e1a38251620f113465330
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/Test_1.java.sdg.criterion
@@ -0,0 +1 @@
+10
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/ltd-samples/Test_1.java.sdg.sliced b/sdg-core/src/test/res/regression/ltd-samples/Test_1.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..f182aee5a24aa81d5bd350942b3e601e3e91459b
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/Test_1.java.sdg.sliced
@@ -0,0 +1,9 @@
+package ejemplos;
+
+public class Test_1 {
+
+ public static void main(String[] args) {
+ int x = 1;
+ x = 4;
+ }
+}
diff --git a/sdg-core/src/test/res/ltd-samples/Test_2.java b/sdg-core/src/test/res/regression/ltd-samples/Test_2.java
similarity index 100%
rename from sdg-core/src/test/res/ltd-samples/Test_2.java
rename to sdg-core/src/test/res/regression/ltd-samples/Test_2.java
diff --git a/sdg-core/src/test/res/regression/ltd-samples/Test_2.java.sdg.criterion b/sdg-core/src/test/res/regression/ltd-samples/Test_2.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..9d607966b721abde8931ddd052181fae905db503
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/Test_2.java.sdg.criterion
@@ -0,0 +1 @@
+11
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/ltd-samples/Test_2.java.sdg.sliced b/sdg-core/src/test/res/regression/ltd-samples/Test_2.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..b61c5b7ccc5f6a97ded253274176eea495d87571
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/Test_2.java.sdg.sliced
@@ -0,0 +1,11 @@
+package ejemplos;
+
+public class Test_2 {
+
+ public static void main(String[] args) {
+ int x = 1;
+ int y = 0;
+ x = x + y;
+ System.out.println(x);
+ }
+}
diff --git a/sdg-core/src/test/res/ltd-samples/Test_3.java b/sdg-core/src/test/res/regression/ltd-samples/Test_3.java
similarity index 100%
rename from sdg-core/src/test/res/ltd-samples/Test_3.java
rename to sdg-core/src/test/res/regression/ltd-samples/Test_3.java
diff --git a/sdg-core/src/test/res/regression/ltd-samples/Test_3.java.sdg.criterion b/sdg-core/src/test/res/regression/ltd-samples/Test_3.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..9d607966b721abde8931ddd052181fae905db503
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/Test_3.java.sdg.criterion
@@ -0,0 +1 @@
+11
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/ltd-samples/Test_3.java.sdg.sliced b/sdg-core/src/test/res/regression/ltd-samples/Test_3.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..5639ebd9d0e8fff6f5ebf9976aadca044dd3a17c
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/Test_3.java.sdg.sliced
@@ -0,0 +1,9 @@
+package ejemplos;
+
+public class Test_3 {
+
+ public static void main(String[] args) {
+ int x = 1;
+ x = 4;
+ }
+}
diff --git a/sdg-core/src/test/res/ltd-samples/Test_4.java b/sdg-core/src/test/res/regression/ltd-samples/Test_4.java
similarity index 100%
rename from sdg-core/src/test/res/ltd-samples/Test_4.java
rename to sdg-core/src/test/res/regression/ltd-samples/Test_4.java
diff --git a/sdg-core/src/test/res/regression/ltd-samples/Test_4.java.sdg.criterion b/sdg-core/src/test/res/regression/ltd-samples/Test_4.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..3cacc0b93c9c9c03a72da624ca28a09ba5c1336f
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/Test_4.java.sdg.criterion
@@ -0,0 +1 @@
+12
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/ltd-samples/Test_4.java.sdg.sliced b/sdg-core/src/test/res/regression/ltd-samples/Test_4.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..4a6d7967c43a1e401b5a826303bab7384ecf3026
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/Test_4.java.sdg.sliced
@@ -0,0 +1,14 @@
+package ejemplos;
+
+public class Test_4 {
+
+ public static void main(String[] args) {
+ int x = 1;
+ if (x == 1) {
+ x = 2;
+ if (x >= 1) {
+ x = 4;
+ }
+ }
+ }
+}
diff --git a/sdg-core/src/test/res/ltd-samples/Test_5.java b/sdg-core/src/test/res/regression/ltd-samples/Test_5.java
similarity index 100%
rename from sdg-core/src/test/res/ltd-samples/Test_5.java
rename to sdg-core/src/test/res/regression/ltd-samples/Test_5.java
diff --git a/sdg-core/src/test/res/regression/ltd-samples/Test_5.java.sdg.criterion b/sdg-core/src/test/res/regression/ltd-samples/Test_5.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..3cacc0b93c9c9c03a72da624ca28a09ba5c1336f
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/Test_5.java.sdg.criterion
@@ -0,0 +1 @@
+12
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/ltd-samples/Test_5.java.sdg.sliced b/sdg-core/src/test/res/regression/ltd-samples/Test_5.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..fb17866b7d3a0cc4fa5286c6aba93be8dd3d61ae
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/Test_5.java.sdg.sliced
@@ -0,0 +1,14 @@
+package ejemplos;
+
+public class Test_5 {
+
+ public static void main(String[] args) {
+ int x = 1;
+ if (x == 1) {
+ x = 2;
+ if (x >= 1) {
+ x = 4;
+ }
+ }
+ }
+}
diff --git a/sdg-core/src/test/res/ltd-samples/Test_6.java b/sdg-core/src/test/res/regression/ltd-samples/Test_6.java
similarity index 100%
rename from sdg-core/src/test/res/ltd-samples/Test_6.java
rename to sdg-core/src/test/res/regression/ltd-samples/Test_6.java
diff --git a/sdg-core/src/test/res/regression/ltd-samples/Test_6.java.sdg.criterion b/sdg-core/src/test/res/regression/ltd-samples/Test_6.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..ca7bf83ac53a27a2a914bed25e1a07478dd8ef47
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/Test_6.java.sdg.criterion
@@ -0,0 +1 @@
+13
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/ltd-samples/Test_6.java.sdg.sliced b/sdg-core/src/test/res/regression/ltd-samples/Test_6.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..c28a6460f7d598eaacd3330906b85696c5f12bf3
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/Test_6.java.sdg.sliced
@@ -0,0 +1,12 @@
+package ejemplos;
+
+public class Test_6 {
+
+ public static void main(String[] args) {
+ int x = 1;
+ if (x == 1) {
+ } else {
+ x = 5;
+ }
+ }
+}
diff --git a/sdg-core/src/test/res/ltd-samples/Test_7.java b/sdg-core/src/test/res/regression/ltd-samples/Test_7.java
similarity index 100%
rename from sdg-core/src/test/res/ltd-samples/Test_7.java
rename to sdg-core/src/test/res/regression/ltd-samples/Test_7.java
diff --git a/sdg-core/src/test/res/regression/ltd-samples/Test_7.java.sdg.criterion b/sdg-core/src/test/res/regression/ltd-samples/Test_7.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..da2d3988d7d1a255376770b1e87394ebb42febb3
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/Test_7.java.sdg.criterion
@@ -0,0 +1 @@
+14
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/ltd-samples/Test_7.java.sdg.sliced b/sdg-core/src/test/res/regression/ltd-samples/Test_7.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..85dbf112a33298eb2495681a48c7f2a6bd8f75d6
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/Test_7.java.sdg.sliced
@@ -0,0 +1,12 @@
+package ejemplos;
+
+public class Test_7 {
+
+ public static void main(String[] args) {
+ int x = 1;
+ x = 4;
+ if (x == 2) {
+ x = 5;
+ }
+ }
+}
diff --git a/sdg-core/src/test/res/ltd-samples/Test_8.java b/sdg-core/src/test/res/regression/ltd-samples/Test_8.java
similarity index 100%
rename from sdg-core/src/test/res/ltd-samples/Test_8.java
rename to sdg-core/src/test/res/regression/ltd-samples/Test_8.java
diff --git a/sdg-core/src/test/res/regression/ltd-samples/Test_8.java.sdg.criterion b/sdg-core/src/test/res/regression/ltd-samples/Test_8.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..19c7bdba7b1e9bfe80365a50420a6d538ca503c3
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/Test_8.java.sdg.criterion
@@ -0,0 +1 @@
+16
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/ltd-samples/Test_8.java.sdg.sliced b/sdg-core/src/test/res/regression/ltd-samples/Test_8.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..b2bbcdf2a501e534b1a63ed042fae356794da524
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/Test_8.java.sdg.sliced
@@ -0,0 +1,14 @@
+package ejemplos;
+
+public class Test_8 {
+
+ public static void main(String[] args) {
+ int x = 1;
+ x = 6;
+ if (x == 2) {
+ x = 7;
+ }
+ if (x == 3)
+ x = 8;
+ }
+}
diff --git a/sdg-core/src/test/res/ltd-samples/Test_9.java b/sdg-core/src/test/res/regression/ltd-samples/Test_9.java
similarity index 100%
rename from sdg-core/src/test/res/ltd-samples/Test_9.java
rename to sdg-core/src/test/res/regression/ltd-samples/Test_9.java
diff --git a/sdg-core/src/test/res/regression/ltd-samples/Test_9.java.sdg.criterion b/sdg-core/src/test/res/regression/ltd-samples/Test_9.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..b5045cc4046dbc1d7cafa4c603fd3cdf35dc5dde
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/Test_9.java.sdg.criterion
@@ -0,0 +1 @@
+21
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/ltd-samples/Test_9.java.sdg.sliced b/sdg-core/src/test/res/regression/ltd-samples/Test_9.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..54c5660b81a6c234f16e6f1f2454fd82116f26e3
--- /dev/null
+++ b/sdg-core/src/test/res/regression/ltd-samples/Test_9.java.sdg.sliced
@@ -0,0 +1,28 @@
+package ejemplos;
+
+public class Test_9 {
+
+ public static void main(String[] args) {
+ int x = 0;
+ if (x > 1) {
+ x = 1;
+ while (x > 2) {
+ x = 2;
+ while (x > 3) {
+ x = 3;
+ if (x > 4) {
+ x = 4;
+ if (x > 5) {
+ x = 5;
+ }
+ x--;
+ }
+ x--;
+ }
+ x--;
+ }
+ x--;
+ }
+ x--;
+ }
+}
diff --git a/sdg-core/src/test/res/programs/WhileLoop.java b/sdg-core/src/test/res/regression/programs/WhileLoop.java
similarity index 100%
rename from sdg-core/src/test/res/programs/WhileLoop.java
rename to sdg-core/src/test/res/regression/programs/WhileLoop.java
diff --git a/sdg-core/src/test/res/regression/programs/WhileLoop.java.sdg.criterion b/sdg-core/src/test/res/regression/programs/WhileLoop.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..fc9afb48e033d9a7d2a778e81ae0e9424950c1cd
--- /dev/null
+++ b/sdg-core/src/test/res/regression/programs/WhileLoop.java.sdg.criterion
@@ -0,0 +1 @@
+59
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/programs/WhileLoop.java.sdg.sliced b/sdg-core/src/test/res/regression/programs/WhileLoop.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..7f6e63fd7b51bbb62cf6a45272ac7906534a44e9
--- /dev/null
+++ b/sdg-core/src/test/res/regression/programs/WhileLoop.java.sdg.sliced
@@ -0,0 +1,16 @@
+package tfm.programs;
+
+public class WhileLoop {
+
+ void while5() {
+ int x = 1;
+ int y = 2;
+ while (x < y) {
+ x += y;
+ while (y < x) {
+ y++;
+ }
+ y += 1;
+ }
+ }
+}
diff --git a/sdg-core/src/test/res/programs/cfg/CFG_Test2.java b/sdg-core/src/test/res/regression/programs/cfg/CFG_Test2.java
similarity index 100%
rename from sdg-core/src/test/res/programs/cfg/CFG_Test2.java
rename to sdg-core/src/test/res/regression/programs/cfg/CFG_Test2.java
diff --git a/sdg-core/src/test/res/regression/programs/cfg/CFG_Test2.java.sdg.criterion b/sdg-core/src/test/res/regression/programs/cfg/CFG_Test2.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..62f9457511f879886bb7728c986fe10b0ece6bcb
--- /dev/null
+++ b/sdg-core/src/test/res/regression/programs/cfg/CFG_Test2.java.sdg.criterion
@@ -0,0 +1 @@
+6
\ No newline at end of file
diff --git a/sdg-core/src/test/res/programs/cfg/CFG_Test1.java b/sdg-core/src/test/res/regression/programs/cfg/CFG_Test2.java.sdg.sliced
similarity index 53%
rename from sdg-core/src/test/res/programs/cfg/CFG_Test1.java
rename to sdg-core/src/test/res/regression/programs/cfg/CFG_Test2.java.sdg.sliced
index 01539fd31a489ab51e6b8971fd5581e9f4b189d6..aa4affe61cb219b1daf246f0da5f2f3e8a8f9021 100644
--- a/sdg-core/src/test/res/programs/cfg/CFG_Test1.java
+++ b/sdg-core/src/test/res/regression/programs/cfg/CFG_Test2.java.sdg.sliced
@@ -1,5 +1,6 @@
-public class CFG_Test1 {
- public static void main(String[] args) {
+public class CFG_Test2 {
+ public static void main(String[] args) {
+ int d = 4;
}
-}
\ No newline at end of file
+}
diff --git a/sdg-core/src/test/res/programs/cfg/CFG_Test3.java b/sdg-core/src/test/res/regression/programs/cfg/CFG_Test3.java
similarity index 100%
rename from sdg-core/src/test/res/programs/cfg/CFG_Test3.java
rename to sdg-core/src/test/res/regression/programs/cfg/CFG_Test3.java
diff --git a/sdg-core/src/test/res/regression/programs/cfg/CFG_Test3.java.sdg.criterion b/sdg-core/src/test/res/regression/programs/cfg/CFG_Test3.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..62f9457511f879886bb7728c986fe10b0ece6bcb
--- /dev/null
+++ b/sdg-core/src/test/res/regression/programs/cfg/CFG_Test3.java.sdg.criterion
@@ -0,0 +1 @@
+6
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/programs/cfg/CFG_Test3.java.sdg.sliced b/sdg-core/src/test/res/regression/programs/cfg/CFG_Test3.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..eb6eb668d42bc434af48de498f288746485f2223
--- /dev/null
+++ b/sdg-core/src/test/res/regression/programs/cfg/CFG_Test3.java.sdg.sliced
@@ -0,0 +1,8 @@
+public class CFG_Test3 {
+
+ public static void main(String[] args) {
+ int a = 1;
+ while (a < 10) a++;
+ System.out.println(a);
+ }
+}
diff --git a/sdg-core/src/test/res/programs/cfg/CFG_Test4.java b/sdg-core/src/test/res/regression/programs/cfg/CFG_Test4.java
similarity index 100%
rename from sdg-core/src/test/res/programs/cfg/CFG_Test4.java
rename to sdg-core/src/test/res/regression/programs/cfg/CFG_Test4.java
diff --git a/sdg-core/src/test/res/regression/programs/cfg/CFG_Test4.java.sdg.criterion b/sdg-core/src/test/res/regression/programs/cfg/CFG_Test4.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..f11c82a4cb6cc2e8f3bdf52b5cdeaad4d5bb214e
--- /dev/null
+++ b/sdg-core/src/test/res/regression/programs/cfg/CFG_Test4.java.sdg.criterion
@@ -0,0 +1 @@
+9
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/programs/cfg/CFG_Test4.java.sdg.sliced b/sdg-core/src/test/res/regression/programs/cfg/CFG_Test4.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..2ee2c9e2199dbd8281531556d8d5502a3dbb1036
--- /dev/null
+++ b/sdg-core/src/test/res/regression/programs/cfg/CFG_Test4.java.sdg.sliced
@@ -0,0 +1,12 @@
+public class CFG_Test4 {
+
+ public static void main(String[] args) {
+ int a = 1;
+ if (a % 2 == 0) {
+ a++;
+ } else {
+ a--;
+ }
+ System.out.println(a);
+ }
+}
diff --git a/sdg-core/src/test/res/programs/cfg/CFG_Test5.java b/sdg-core/src/test/res/regression/programs/cfg/CFG_Test5.java
similarity index 100%
rename from sdg-core/src/test/res/programs/cfg/CFG_Test5.java
rename to sdg-core/src/test/res/regression/programs/cfg/CFG_Test5.java
diff --git a/sdg-core/src/test/res/regression/programs/cfg/CFG_Test5.java.sdg.criterion b/sdg-core/src/test/res/regression/programs/cfg/CFG_Test5.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..c7930257dfef505fd996e1d6f22f2f35149990d0
--- /dev/null
+++ b/sdg-core/src/test/res/regression/programs/cfg/CFG_Test5.java.sdg.criterion
@@ -0,0 +1 @@
+7
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/programs/cfg/CFG_Test5.java.sdg.sliced b/sdg-core/src/test/res/regression/programs/cfg/CFG_Test5.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..dbb0f7eccd67b0c6ebb320cbd28bd14ec27c2b3e
--- /dev/null
+++ b/sdg-core/src/test/res/regression/programs/cfg/CFG_Test5.java.sdg.sliced
@@ -0,0 +1,10 @@
+public class CFG_Test5 {
+
+ public static void main(String[] args) {
+ int a = 1;
+ if (a % 2 == 0) {
+ a++;
+ }
+ System.out.println(a);
+ }
+}
diff --git a/sdg-core/src/test/res/programs/cfg/Eval_1.java b/sdg-core/src/test/res/regression/programs/cfg/Eval_1.java
similarity index 96%
rename from sdg-core/src/test/res/programs/cfg/Eval_1.java
rename to sdg-core/src/test/res/regression/programs/cfg/Eval_1.java
index 75d1e42eb14a27318c324c58df5920dcbd047bd7..f088059d0d864f2a8cb5b3d3b33ce4e9c72b7b1a 100644
--- a/sdg-core/src/test/res/programs/cfg/Eval_1.java
+++ b/sdg-core/src/test/res/regression/programs/cfg/Eval_1.java
@@ -61,6 +61,6 @@ public class Eval_1 {
break;
}
- Logger.log(x);
+ System.out.println(x);
}
}
diff --git a/sdg-core/src/test/res/regression/programs/cfg/Eval_1.java.sdg.criterion b/sdg-core/src/test/res/regression/programs/cfg/Eval_1.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..4b6f9c39e5c757bf387d465c53026b336dd8b96c
--- /dev/null
+++ b/sdg-core/src/test/res/regression/programs/cfg/Eval_1.java.sdg.criterion
@@ -0,0 +1 @@
+64
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/programs/cfg/Eval_1.java.sdg.sliced b/sdg-core/src/test/res/regression/programs/cfg/Eval_1.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..3b67b2fe0c08e208bb86377a0a588069ff48c184
--- /dev/null
+++ b/sdg-core/src/test/res/regression/programs/cfg/Eval_1.java.sdg.sliced
@@ -0,0 +1,38 @@
+package tfm.programs.cfg;
+
+import tfm.utils.Logger;
+
+public class Eval_1 {
+
+ public static void main(String[] args) {
+ int x = 1;
+ one: while (x <= 10) {
+ x++;
+ }
+ do {
+ x--;
+ if (x == 1) {
+ x = 2;
+ } else {
+ x = 4;
+ }
+ } while (x < 1);
+ for (int z = 1; z < x; z++, x--) {
+ }
+ switch(x) {
+ case 1:
+ x = 3;
+ break;
+ case 2:
+ x = 4;
+ break;
+ case 3:
+ x = 5;
+ break;
+ default:
+ x = 5;
+ break;
+ }
+ System.out.println(x);
+ }
+}
diff --git a/sdg-core/src/test/res/programs/cfg/Eval_2.java b/sdg-core/src/test/res/regression/programs/cfg/Eval_2.java
similarity index 100%
rename from sdg-core/src/test/res/programs/cfg/Eval_2.java
rename to sdg-core/src/test/res/regression/programs/cfg/Eval_2.java
diff --git a/sdg-core/src/test/res/regression/programs/cfg/Eval_2.java.sdg.criterion b/sdg-core/src/test/res/regression/programs/cfg/Eval_2.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..2edeafb09db0093bae6ff060e2dcd2166f5c9387
--- /dev/null
+++ b/sdg-core/src/test/res/regression/programs/cfg/Eval_2.java.sdg.criterion
@@ -0,0 +1 @@
+20
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/programs/cfg/Eval_2.java.sdg.sliced b/sdg-core/src/test/res/regression/programs/cfg/Eval_2.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..ee318541c02a0fa5d19c90e8970bec66f5e7a5c0
--- /dev/null
+++ b/sdg-core/src/test/res/regression/programs/cfg/Eval_2.java.sdg.sliced
@@ -0,0 +1,9 @@
+package tfm.programs.cfg;
+
+public class Eval_2 {
+
+ public static void main(String[] args) {
+ int x = 1;
+ System.out.println(x);
+ }
+}
diff --git a/sdg-core/src/test/res/programs/cfg/Eval_3.java b/sdg-core/src/test/res/regression/programs/cfg/Eval_3.java
similarity index 100%
rename from sdg-core/src/test/res/programs/cfg/Eval_3.java
rename to sdg-core/src/test/res/regression/programs/cfg/Eval_3.java
diff --git a/sdg-core/src/test/res/regression/programs/cfg/Eval_3.java.sdg.criterion b/sdg-core/src/test/res/regression/programs/cfg/Eval_3.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..410b14d2ce6f958c13adcb30807e8673074c49d9
--- /dev/null
+++ b/sdg-core/src/test/res/regression/programs/cfg/Eval_3.java.sdg.criterion
@@ -0,0 +1 @@
+25
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/programs/cfg/Eval_3.java.sdg.sliced b/sdg-core/src/test/res/regression/programs/cfg/Eval_3.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..05636d5ca0a80639e2a092c03bfd21692d0c1643
--- /dev/null
+++ b/sdg-core/src/test/res/regression/programs/cfg/Eval_3.java.sdg.sliced
@@ -0,0 +1,8 @@
+package tfm.programs.cfg;
+
+public class Eval_3 {
+
+ public static void main(String[] args) {
+ int x = 1;
+ }
+}
diff --git a/sdg-core/src/test/res/programs/cfg/Eval_4.java b/sdg-core/src/test/res/regression/programs/cfg/Eval_4.java
similarity index 100%
rename from sdg-core/src/test/res/programs/cfg/Eval_4.java
rename to sdg-core/src/test/res/regression/programs/cfg/Eval_4.java
diff --git a/sdg-core/src/test/res/regression/programs/cfg/Eval_4.java.sdg.criterion b/sdg-core/src/test/res/regression/programs/cfg/Eval_4.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..dec2bf5d6199c7cd0d84f3dc1e76a73ccc336302
--- /dev/null
+++ b/sdg-core/src/test/res/regression/programs/cfg/Eval_4.java.sdg.criterion
@@ -0,0 +1 @@
+19
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/programs/cfg/Eval_4.java.sdg.sliced b/sdg-core/src/test/res/regression/programs/cfg/Eval_4.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..fe4b735862949ec2f80f771b111257b3a9d139d4
--- /dev/null
+++ b/sdg-core/src/test/res/regression/programs/cfg/Eval_4.java.sdg.sliced
@@ -0,0 +1,18 @@
+package tfm.programs.cfg;
+
+public class Eval_4 {
+
+ public static void main(String[] args) {
+ String[] fruits = new String[] { "Orange", "Apple", "Pear", "Strawberry" };
+ String[] animals = new String[] { "Bear", "Monkey" };
+ int x = 1;
+ while (x <= 3) {
+ for (String fruit : fruits) {
+ for (String animal : animals) {
+ System.out.println(animal);
+ }
+ }
+ x++;
+ }
+ }
+}
diff --git a/sdg-core/src/test/res/programs/pdg/Example1.java b/sdg-core/src/test/res/regression/programs/pdg/Example1.java
similarity index 95%
rename from sdg-core/src/test/res/programs/pdg/Example1.java
rename to sdg-core/src/test/res/regression/programs/pdg/Example1.java
index 0f750f9da5a64038be5387ba1cdbc4252bafcfc4..d4cc9a548a1a25e224826072661ad0f475220b37 100644
--- a/sdg-core/src/test/res/programs/pdg/Example1.java
+++ b/sdg-core/src/test/res/regression/programs/pdg/Example1.java
@@ -58,7 +58,7 @@ public class Example1 {
default:
}
- Logger.log(e);
+ System.out.println(e);
}
// public static void main2() {
@@ -68,6 +68,6 @@ public class Example1 {
//
// int t = z * p;
//
-// Logger.log(t);
+// System.out.println(t);
// }
}
diff --git a/sdg-core/src/test/res/regression/programs/pdg/Example1.java.sdg.criterion b/sdg-core/src/test/res/regression/programs/pdg/Example1.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..eebd1d10b6ec9917baf4df7f2e3de79e031a9af7
--- /dev/null
+++ b/sdg-core/src/test/res/regression/programs/pdg/Example1.java.sdg.criterion
@@ -0,0 +1 @@
+61
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/programs/pdg/Example1.java.sdg.sliced b/sdg-core/src/test/res/regression/programs/pdg/Example1.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..511bb685ec0db350bc74771a0e579a91de2832d2
--- /dev/null
+++ b/sdg-core/src/test/res/regression/programs/pdg/Example1.java.sdg.sliced
@@ -0,0 +1,36 @@
+package tfm.programs.pdg;
+
+import es.upv.mist.slicing.utils.Logger;
+
+public class Example1 {
+
+ public static void main(String[] args) {
+ int x = 1;
+ int y = 2;
+ if (x < y) {
+ while (x < y) {
+ y = x;
+ for (int i = 0; i < y; i++) {
+ y += i;
+ if (x > y)
+ continue;
+ x = y;
+ }
+ x++;
+ }
+ } else {
+ x = 4;
+ }
+ int e = x;
+ switch(x) {
+ case 1:
+ e = 5;
+ break;
+ case 2:
+ case 3:
+ e = 4;
+ break;
+ }
+ System.out.println(e);
+ }
+}
diff --git a/sdg-core/src/test/res/programs/pdg/Example2.java b/sdg-core/src/test/res/regression/programs/pdg/Example2.java
similarity index 94%
rename from sdg-core/src/test/res/programs/pdg/Example2.java
rename to sdg-core/src/test/res/regression/programs/pdg/Example2.java
index 4da30ee20e88aa955a695539bff28043b7941d64..9955a84746d2761f31db319e503102092db8678e 100644
--- a/sdg-core/src/test/res/programs/pdg/Example2.java
+++ b/sdg-core/src/test/res/regression/programs/pdg/Example2.java
@@ -33,6 +33,6 @@ public class Example2 {
b++;
}
- Logger.log(b);
+ System.out.println(b);
}
}
diff --git a/sdg-core/src/test/res/regression/programs/pdg/Example2.java.sdg.criterion b/sdg-core/src/test/res/regression/programs/pdg/Example2.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..dce6588ca1420a69eea5699f2ec5d666daf16a6a
--- /dev/null
+++ b/sdg-core/src/test/res/regression/programs/pdg/Example2.java.sdg.criterion
@@ -0,0 +1 @@
+36
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/programs/pdg/Example2.java.sdg.sliced b/sdg-core/src/test/res/regression/programs/pdg/Example2.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..66694da6e159c7934ce865f47c3c2e5d32835cb6
--- /dev/null
+++ b/sdg-core/src/test/res/regression/programs/pdg/Example2.java.sdg.sliced
@@ -0,0 +1,16 @@
+package tfm.programs.pdg;
+
+import tfm.utils.Logger;
+import java.util.Arrays;
+
+public class Example2 {
+
+ public static void main(String[] args) {
+ int a = 8;
+ int b = 2;
+ for (; a < 100; a++) {
+ b++;
+ }
+ System.out.println(b);
+ }
+}
diff --git a/sdg-core/src/test/res/programs/pdg/Example3.java b/sdg-core/src/test/res/regression/programs/pdg/Example3.java
similarity index 81%
rename from sdg-core/src/test/res/programs/pdg/Example3.java
rename to sdg-core/src/test/res/regression/programs/pdg/Example3.java
index c1f1c30341684b1a99d52c730b51df23416e2614..cfe6c74b0b636ed522293dd6437a5c13803584bf 100644
--- a/sdg-core/src/test/res/programs/pdg/Example3.java
+++ b/sdg-core/src/test/res/regression/programs/pdg/Example3.java
@@ -18,7 +18,7 @@ public class Example3 {
i++;
}
- Logger.log(sum);
- Logger.log(product);
+ System.out.println(sum);
+ System.out.println(product);
}
}
diff --git a/sdg-core/src/test/res/regression/programs/pdg/Example3.java.sdg.criterion b/sdg-core/src/test/res/regression/programs/pdg/Example3.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..b5045cc4046dbc1d7cafa4c603fd3cdf35dc5dde
--- /dev/null
+++ b/sdg-core/src/test/res/regression/programs/pdg/Example3.java.sdg.criterion
@@ -0,0 +1 @@
+21
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/programs/pdg/Example3.java.sdg.sliced b/sdg-core/src/test/res/regression/programs/pdg/Example3.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..739d7d76ef1c0e49d6f8cebfdfb233f34a09234b
--- /dev/null
+++ b/sdg-core/src/test/res/regression/programs/pdg/Example3.java.sdg.sliced
@@ -0,0 +1,17 @@
+package tfm.programs.pdg;
+
+import tfm.utils.Logger;
+
+public class Example3 {
+
+ public static void main(String[] args) {
+ int n = 1;
+ int i = 1;
+ int sum = 0;
+ while (i < n) {
+ sum += i;
+ i++;
+ }
+ System.out.println(sum);
+ }
+}
diff --git a/sdg-core/src/test/res/programs/pdg/Test.java b/sdg-core/src/test/res/regression/programs/pdg/Test.java
similarity index 100%
rename from sdg-core/src/test/res/programs/pdg/Test.java
rename to sdg-core/src/test/res/regression/programs/pdg/Test.java
diff --git a/sdg-core/src/test/res/regression/programs/pdg/Test.java.sdg.criterion b/sdg-core/src/test/res/regression/programs/pdg/Test.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..9d607966b721abde8931ddd052181fae905db503
--- /dev/null
+++ b/sdg-core/src/test/res/regression/programs/pdg/Test.java.sdg.criterion
@@ -0,0 +1 @@
+11
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/programs/pdg/Test.java.sdg.sliced b/sdg-core/src/test/res/regression/programs/pdg/Test.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..883158fe333145cc8a6aac61df2de49c8be07b00
--- /dev/null
+++ b/sdg-core/src/test/res/regression/programs/pdg/Test.java.sdg.sliced
@@ -0,0 +1,9 @@
+package tfm.programs.pdg;
+
+public class Test {
+
+ public static void main(String[] args) {
+ int a = 0;
+ System.out.println(a);
+ }
+}
diff --git a/sdg-core/src/test/res/programs/sdg/Example1.java b/sdg-core/src/test/res/regression/programs/sdg/Example1.java
similarity index 100%
rename from sdg-core/src/test/res/programs/sdg/Example1.java
rename to sdg-core/src/test/res/regression/programs/sdg/Example1.java
diff --git a/sdg-core/src/test/res/regression/programs/sdg/Example1.java.sdg.criterion b/sdg-core/src/test/res/regression/programs/sdg/Example1.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..9d607966b721abde8931ddd052181fae905db503
--- /dev/null
+++ b/sdg-core/src/test/res/regression/programs/sdg/Example1.java.sdg.criterion
@@ -0,0 +1 @@
+11
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/programs/sdg/Example1.java.sdg.sliced b/sdg-core/src/test/res/regression/programs/sdg/Example1.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..ae1932903b01a3416a613a2f02df1f7b81a147e8
--- /dev/null
+++ b/sdg-core/src/test/res/regression/programs/sdg/Example1.java.sdg.sliced
@@ -0,0 +1,16 @@
+package tfm.programs.sdg;
+
+public class Example1 {
+
+ public static void main(String[] args) {
+ int n1 = 1;
+ int n2 = 2;
+ int f = sum(n1, n2);
+ System.out.println(f);
+ }
+
+ private static int sum(int x, int y) {
+ int res = x + y;
+ return res;
+ }
+}
diff --git a/sdg-core/src/test/res/programs/sdg/Example2.java b/sdg-core/src/test/res/regression/programs/sdg/Example2.java
similarity index 91%
rename from sdg-core/src/test/res/programs/sdg/Example2.java
rename to sdg-core/src/test/res/regression/programs/sdg/Example2.java
index d92a97885f420ac85d50aa35f509822f505294c4..9b8044388c0d2365395323b49e9c5e9fae746538 100644
--- a/sdg-core/src/test/res/programs/sdg/Example2.java
+++ b/sdg-core/src/test/res/regression/programs/sdg/Example2.java
@@ -31,7 +31,7 @@ public class Example2 {
public static void main(String[] args) {
CustomObject customObject = new CustomObject(new InnerObject(1));
modifyCustomObject(customObject);
- modifyInnerObject(customObject.inner);
+ modifyInnerObject(customObject.inner); // Slicing criterion
}
public static void modifyCustomObject(CustomObject customObject) {
@@ -41,4 +41,4 @@ public class Example2 {
public static void modifyInnerObject(InnerObject innerObject) {
innerObject.x = 5;
}
-}
\ No newline at end of file
+}
diff --git a/sdg-core/src/test/res/review-07-2020/P1.java b/sdg-core/src/test/res/regression/review-07-2020/P1.java
similarity index 100%
rename from sdg-core/src/test/res/review-07-2020/P1.java
rename to sdg-core/src/test/res/regression/review-07-2020/P1.java
diff --git a/sdg-core/src/test/res/regression/review-07-2020/P1.java.sdg.criterion b/sdg-core/src/test/res/regression/review-07-2020/P1.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..b2412e34dff05e77952f3f930772631cac5a3be7
--- /dev/null
+++ b/sdg-core/src/test/res/regression/review-07-2020/P1.java.sdg.criterion
@@ -0,0 +1 @@
+62
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/review-07-2020/P1.java.sdg.sliced b/sdg-core/src/test/res/regression/review-07-2020/P1.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..2785ae14a0eb40cfba5ab4f11b96590454d462f1
--- /dev/null
+++ b/sdg-core/src/test/res/regression/review-07-2020/P1.java.sdg.sliced
@@ -0,0 +1,24 @@
+class FiguresGroup {
+
+ public Figure greatestFigure() {
+ if (numF == 0)
+ return null;
+ Figure f = figuresList[0];
+ double a = figuresList[0].area();
+ for (int i = 1; i < numF; i++) {
+ double b = figuresList[i].area();
+ if (a < b) {
+ f = figuresList[i];
+ a = b;
+ }
+ }
+ return f;
+ }
+}
+
+class Figure {
+
+ int area() {
+ return 5;
+ }
+}
diff --git a/sdg-core/src/test/res/review-07-2020/P2.java b/sdg-core/src/test/res/regression/review-07-2020/P2.java
similarity index 100%
rename from sdg-core/src/test/res/review-07-2020/P2.java
rename to sdg-core/src/test/res/regression/review-07-2020/P2.java
diff --git a/sdg-core/src/test/res/regression/review-07-2020/P2.java.sdg.criterion b/sdg-core/src/test/res/regression/review-07-2020/P2.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..9d607966b721abde8931ddd052181fae905db503
--- /dev/null
+++ b/sdg-core/src/test/res/regression/review-07-2020/P2.java.sdg.criterion
@@ -0,0 +1 @@
+11
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/review-07-2020/P2.java.sdg.sliced b/sdg-core/src/test/res/regression/review-07-2020/P2.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..1a7c326c41c7e23a6d8558b287dd3bc1bfba6afd
--- /dev/null
+++ b/sdg-core/src/test/res/regression/review-07-2020/P2.java.sdg.sliced
@@ -0,0 +1,8 @@
+public class Bucles {
+
+ public static void main(String[] args) {
+ int x;
+ int i = 8;
+ x = 5 + i;
+ }
+}
diff --git a/sdg-core/src/test/res/review-07-2020/P3.java b/sdg-core/src/test/res/regression/review-07-2020/P3.java
similarity index 100%
rename from sdg-core/src/test/res/review-07-2020/P3.java
rename to sdg-core/src/test/res/regression/review-07-2020/P3.java
diff --git a/sdg-core/src/test/res/regression/review-07-2020/P3.java.sdg.criterion b/sdg-core/src/test/res/regression/review-07-2020/P3.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..368f89ceef179cc546403ac0d5ef1d0e4b340447
--- /dev/null
+++ b/sdg-core/src/test/res/regression/review-07-2020/P3.java.sdg.criterion
@@ -0,0 +1 @@
+28
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/review-07-2020/P3.java.sdg.sliced b/sdg-core/src/test/res/regression/review-07-2020/P3.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..d72239364e8d11b6f75a446fb8b6b2d98584356b
--- /dev/null
+++ b/sdg-core/src/test/res/regression/review-07-2020/P3.java.sdg.sliced
@@ -0,0 +1,12 @@
+public class Bucles {
+
+ public static void main(String[] args) {
+ int x = 2;
+ }
+}
+
+class ExceptionA extends Exception {
+}
+
+class ExceptionB extends ExceptionA {
+}
diff --git a/sdg-core/src/test/res/review-07-2020/P4.java b/sdg-core/src/test/res/regression/review-07-2020/P4.java
similarity index 100%
rename from sdg-core/src/test/res/review-07-2020/P4.java
rename to sdg-core/src/test/res/regression/review-07-2020/P4.java
diff --git a/sdg-core/src/test/res/regression/review-07-2020/P4.java.sdg.criterion b/sdg-core/src/test/res/regression/review-07-2020/P4.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..368f89ceef179cc546403ac0d5ef1d0e4b340447
--- /dev/null
+++ b/sdg-core/src/test/res/regression/review-07-2020/P4.java.sdg.criterion
@@ -0,0 +1 @@
+28
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/review-07-2020/P4.java.sdg.sliced b/sdg-core/src/test/res/regression/review-07-2020/P4.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..1c388f175912417300b44139a875105ea4ac40dc
--- /dev/null
+++ b/sdg-core/src/test/res/regression/review-07-2020/P4.java.sdg.sliced
@@ -0,0 +1,12 @@
+public class Bucles {
+
+ public static void main(String[] args) {
+ System.out.println("No se lanza ninguna excepcion");
+ }
+}
+
+class ExceptionA extends Exception {
+}
+
+class ExceptionB extends ExceptionA {
+}
diff --git a/sdg-core/src/test/res/review-07-2020/P5.java b/sdg-core/src/test/res/regression/review-07-2020/P5.java
similarity index 100%
rename from sdg-core/src/test/res/review-07-2020/P5.java
rename to sdg-core/src/test/res/regression/review-07-2020/P5.java
diff --git a/sdg-core/src/test/res/regression/review-07-2020/P5.java.sdg.criterion b/sdg-core/src/test/res/regression/review-07-2020/P5.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..9d607966b721abde8931ddd052181fae905db503
--- /dev/null
+++ b/sdg-core/src/test/res/regression/review-07-2020/P5.java.sdg.criterion
@@ -0,0 +1 @@
+11
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/review-07-2020/P5.java.sdg.sliced b/sdg-core/src/test/res/regression/review-07-2020/P5.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..a22b18d21040799fb720db044a60e4b75f5e4a3d
--- /dev/null
+++ b/sdg-core/src/test/res/regression/review-07-2020/P5.java.sdg.sliced
@@ -0,0 +1,38 @@
+public class Josep2 {
+
+ public static void main(String[] args) {
+ int suma = 0;
+ suma += factorial(5);
+ Numeros num = new GrandesNumeros(7);
+ suma += num.random();
+ System.out.print(suma);
+ }
+
+ static int factorial(int x) {
+ int contador = 1;
+ int fact = 1;
+ while (contador < x) {
+ contador++;
+ fact = fact * contador;
+ }
+ return fact;
+ }
+}
+
+class Numeros {
+
+ int random() {
+ return haceFalta;
+ }
+}
+
+class GrandesNumeros extends Numeros {
+
+ GrandesNumeros(double x) {
+ haceFalta = 0;
+ }
+
+ int random() {
+ return haceFalta;
+ }
+}
diff --git a/sdg-core/src/test/res/review-07-2020/P6.java b/sdg-core/src/test/res/regression/review-07-2020/P6.java
similarity index 100%
rename from sdg-core/src/test/res/review-07-2020/P6.java
rename to sdg-core/src/test/res/regression/review-07-2020/P6.java
diff --git a/sdg-core/src/test/res/regression/review-07-2020/P6.java.sdg.criterion b/sdg-core/src/test/res/regression/review-07-2020/P6.java.sdg.criterion
new file mode 100644
index 0000000000000000000000000000000000000000..410b14d2ce6f958c13adcb30807e8673074c49d9
--- /dev/null
+++ b/sdg-core/src/test/res/regression/review-07-2020/P6.java.sdg.criterion
@@ -0,0 +1 @@
+25
\ No newline at end of file
diff --git a/sdg-core/src/test/res/regression/review-07-2020/P6.java.sdg.sliced b/sdg-core/src/test/res/regression/review-07-2020/P6.java.sdg.sliced
new file mode 100644
index 0000000000000000000000000000000000000000..7e9046d64a3e9bfb040c463cab71ac8c5ce46b0d
--- /dev/null
+++ b/sdg-core/src/test/res/regression/review-07-2020/P6.java.sdg.sliced
@@ -0,0 +1,17 @@
+public class Bucles {
+
+ static void metodoGeneradorExcepciones(int x) throws Exception {
+ if (x == 0)
+ throw new ExceptionA();
+ if (x == 1)
+ throw new ExceptionB();
+ if (x == 2)
+ throw new Exception();
+ }
+}
+
+class ExceptionA extends Exception {
+}
+
+class ExceptionB extends ExceptionA {
+}