From 773e548d2945d3670fadf538c2ea74371b21156e Mon Sep 17 00:00:00 2001 From: Yun Lin Date: Wed, 6 Sep 2023 02:22:19 +0800 Subject: [PATCH] to start with the draft code --- .../test/java/feature/regression/RegressionTest.java | 2 +- .../regression/example1/RegressionExample.java | 11 +++++++++-- .../regression/example2/RegressionExample.java | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/shell/src/test/java/feature/regression/RegressionTest.java b/shell/src/test/java/feature/regression/RegressionTest.java index 4d313978a..a4bb45f6b 100644 --- a/shell/src/test/java/feature/regression/RegressionTest.java +++ b/shell/src/test/java/feature/regression/RegressionTest.java @@ -69,7 +69,7 @@ public void testBasicRulesObj() { Properties.TIMEOUT = 10; Properties.INDIVIDUAL_LEGITIMIZATION_BUDGET = 10; Properties.STRATEGY = Strategy.REGRESSION; - Properties.REGRESSION_FITNESS = RegressionMeasure.ALL_MEASURES; + Properties.REGRESSION_FITNESS = RegressionMeasure.COVERAGE; Properties.ASSERTIONS = true; // Properties.TIMELINE_INTERVAL = 3000; diff --git a/shell/src/test/java/feature/regression/example1/RegressionExample.java b/shell/src/test/java/feature/regression/example1/RegressionExample.java index e8c61a170..df7a41083 100644 --- a/shell/src/test/java/feature/regression/example1/RegressionExample.java +++ b/shell/src/test/java/feature/regression/example1/RegressionExample.java @@ -1,12 +1,19 @@ package feature.regression.example1; +import java.util.ArrayList; + public class RegressionExample { - public int example123(int a) { + public int example123(int a) throws Exception { int b = a + 1; - if(b < 1) { + if(b >= -100000000) { b++; + } + ArrayList list = new ArrayList(); + Object o = list.get(0); + o.toString(); + return b; } diff --git a/shell/src/test/java/feature/regression/example2/RegressionExample.java b/shell/src/test/java/feature/regression/example2/RegressionExample.java index 5f29d96e9..e55ec0cb1 100644 --- a/shell/src/test/java/feature/regression/example2/RegressionExample.java +++ b/shell/src/test/java/feature/regression/example2/RegressionExample.java @@ -3,7 +3,7 @@ public class RegressionExample { public int example123(int a) { int b = a + 1; - if(b > 1) { + if(b > -100000000) { b++; }