Skip to content

Adobee/ACS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ACS: Accurate Condition Synthesis

Notification

ACS can no longer execute on new bugs. The execution of ACS requires querying of GitHub, but GitHub recently changed its interface and does not allow programmed queries. Therefore, the original code of ACS cannot execute normally and there is no easy way to fix that. ACS can still run on the original Defects4J bugs as the results were cached.

Our new tool L2S-Hanabi is a direct follow-up work of ACS and does not depend on external source. We recommend you to use L2S-Hanabi if you are seeking a tool fixing conditional bugs.

I. Requirement

  • Ubuntu14.04
  • Java 1.7
  • Python 2.7(need to install psutil)
  • Defects4J

II. How to run the ACS

Two optional: A. run the virtual machine; B. Set up the environment. Choose the way you like.

A. Run the virtual machine

  1. If you do not want to set up the environment, please download the virtual machine, unzip and open it by VmWare12.5.2(username: yjxxtd, password: hhxxttxs).

  2. There are 23 projects(18 correct and 5 incorrect) in the directory "/home/yjxxtd/software/defects4j-project/", the ACS is in the directory "/home/yjxxtd/software/ACS/ACS-master/".

  3. Please run the run.sh in the directory "/home/yjxxtd/software/ACS/ACS-master/" to generate the 23 patches for the 23 projects.

  4. If it does not work normaly, please increase the timeout time in the run.sh, for example "java -jar ACS.jar /home/yjxxtd/software/defects4j-project/ Chart_14 timeout:3600".

B. Set up the Environment

  1. Clone the ACS:
  • git clone https://github.com/Adobee/ACS.git
  1. Checkout a buggy source code version from Defects4j anc compile it:
  • defects4j checkout -p Lang -v 1b -w /tmp/Lang_1
  • cd /tmp/Lang_1
  • defects4j compile

the forder name of checkout must format as 'ProjectName_buggyID' because the ACS needs it's project name and buggy id to generate it's classpath, source path etc.

  1. Run the Jar with the parent path of Defects4j buggy version project forder:
  • java -jar ACS.jar /tmp/

and ACS will automatically find all formatted folder and run with it.

 Or run with specific buggy projects in /tmp/ forder(Note the space between "/tmp/" and "Lang_1"):

  • java -jar ACS.jar /tmp/ Lang_1
  • java -jar ACS.jar /tmp/ Lang_1;Lang_2;Lang_3
  • java -jar ACS.jar /tmp/ ban:Lang_1;Lang2

Or set a custom timeout seconds depends on your computer performance (default as 1800):

  • java -jar ACS.jar /tmp/ Lang_1 timeout:3600

III How to Build ACS

Althrough there is a pom.xml in the ACS, actually it's useless because of the difficulty of dependency configuration.

We prefer to use Intellij IDEA to build the ACS automatically.

  1. 'Open' the ACS project with Intellij IDEA, and ignore all warnings in the bottom right, such as 'Framework detected'.

  2. There is a default configuration in the run/debug menu which named run ACS in the top right, click it and choose Edit configurations, replace the content in several input box according to its tip.

  3. Click OK button, and use shortcut CTRL+F9 to build the project.

IV Tips

  1. Tips of Chart19: After checkout from Defects4J, There are two itext jar files in Chart_19/lib folder and one of which named "itext-2.0.6.jar" is a broken jar and leads to the error of ACS, delete it and ACS would get back to normal.

  2. The results are in the dir "ACS/resultMessage", the detailed patch is in the file "ACS/resultMessage/patchSource/Project_BugId_Schema_PatchId.java"(If a bug has n patches, the "PatchId" will range from 0 to n - 1), and is between "patch begin" and "patch end".

  3. Please note that the patch file in the directory "ACS/resultMessage/patchSource/" does not mean it passes all the tests. If it fails to pass all the test, the patch file will be deleted if ACS has enough time. So if you want to know whether the patch file pass all the tests, please apply it in the source code, and test it manually by using the command "defects4j test".

  4. There are some pictures in the dir "ACS/pictures" to show how to run the ACS.

  5. If ACS didn't generate the patch or the patch is incomplete, it maybe cause by the performance of the computer, please increase the timeout time.

V. Evaluation

1.ACS Correct Patches

ACS generates correct patches for 17 defects. For each defect, we provide the urls that contain the developer patch and we either identify the ACS patch is semantically equivalent to the developer patch and provide a brief analysis for why the ACS patch is correct.

1).Chart14

The developer patches 1

The developer patches 2

The ACS correct patches 1

The ACS correct patches 2

Analysis:The ACS generated patch is identical to the developer patch.

2).Chart19

The developer patches

The ACS correct patches

Analysis:The ACS generated patch is identical to the developer patch.

Tips: After checkout from Defects4J, There are two itext jar files in Chart_19/lib folder and one of which named "itext-2.0.6.jar" is a broken jar and leads to the error of ACS, delete it and ACS would get back to normal.

3).Math3

The developer patches

The ACS correct patches

Analysis:The ACS generated patch is identical to the developer patch.

4).Math4

The developer patches 1

The developer patches 2

The ACS correct patches 1

The ACS correct patches 2

Analysis:The ACS generated patch is identical to the developer patch.

5).Math5

The developer patches

The ACS correct patches

Analysis:The ACS generated patch is identical to the developer patch.

6).Math25

The developer patches

The ACS correct patches

Analysis:The ACS generated patch is identical to the developer patch.

7).Math35

The developer patches

The ACS correct patches

Analysis:The ACS generated patch is identical to the developer patch.

8).Math61

The developer patches

The ACS correct patches

Analysis:The ACS generated patch is identical to the developer patch.

9).Math82

The developer patches

The ACS correct patches

Analysis:The ACS generated patch is identical to the developer patch.

10).Math85

The developer patches

The ACS correct patches

Analysis:The ACS generated patch is identical to the developer patch.

11).Math89

The developer patches

The ACS correct patches

Analysis:The ACS generated patch is identical to the developer patch.

12).Math90

The developer patches

The ACS correct patches

Analysis:The ACS generated patch is identical to the developer patch.

13).Math93

The developer patches

The ACS correct patches

Analysis:The developer patch contains three parts, and the last part is not related to the defect. The first and second part are identical to ACS patch. The second part uses n < 21 while ACS patch uses n < 20. However, when n is equal to 20, either the true branch or the false branch produce exactly the same result.

14).Math99

The developer patches

The ACS correct patches

Analysis:The ACS generated patch is identical to the developer patch.

15).Time15

The developer patches

The ACS correct patches

Analysis:The ACS generated patch is identical to the developer patch.

16).Lang7

The developer patches

The ACS correct patches

Analysis:The developer patch uses the trim() method, while ACS patch does not. However, the method createBigDecimal() will only be called by createNumber(), which ensures that the parameter "str" does not contain any space. So calling trim() is not necessary and the two patches are identical.

17).Lang24

The developer patches

The ACS correct patches

Analysis:The ACS generated patch is identical to the developer patch.

2.ACS Incorrect Patches

1). Lang39

The developer patches

The ACS incorrect patches

2). Math28

The developer patches

The ACS incorrect patches

3). Math73

The developer patches

The ACS incorrect patches

4). Math81

The developer patches

The ACS incorrect patches

5). Math97

The developer patches

The ACS incorrect patches

5).Lang35

The developer patches

The ACS correct patches

3.Performance Data of the Three Techniques

DEPENDENCY-BASED ORDERING PERFORMANCE LEVEL DATA

Format: Easy to understand

DEPENDENCY-BASED ORDERING PERFORMANCE RANK DATA

Format: Variable rank / Total

PREDICATE MINING PERFORMANCE DATA

Format: Easy to understand

DOCUMENT ANALYSIS PERFORMANCE DATA

Format: JavaDoc comment / condition expression / list of variable name

About

Accurate Condition Synthesis

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published