LingLong Framework
I. Introduction
LingLong is an abstract framework that synthesizes codes under given specification, and also estimates the probabilities of codes.
This repo contains two projects, i.e., Cond
and Hanabi
.
- Cond is an instance of LingLong, aiming to synthesize Java conditional expressions.
- Hanabi is an automated program repair tool equipped with Cond, aimming to fix bugs in Java conditional expressions.
If you use LingLong, please cite our paper.
@article{xiong2022l2s,
title={L2S: A framework for synthesizing the most probable program under a specification},
author={Xiong, Yingfei and Wang, Bo},
journal={ACM Transactions on Software Engineering and Methodology (TOSEM)},
volume={31},
number={3},
year={2022},
publisher = {Association for Computing Machinery},
doi = {10.1145/3487570}
}
II. Cond
Training Stage
-
Training data extraction. Given a Java project, LingLong collects all the conditional expressions and parses them into options by a specified order, after which LingLong generates training dataset.
-
Traning Models. LingLong trains machine learning models against the training data.
Synthesizing Stage
-
Code Location Selection. Select a certain code location, from which LingLong extracts Context Features and fires the generation step.
-
Expression Generation. Under the given context, LingLong synthesizes K conditional expressions ranked by their estimated probabilities.
Environment
- OS: Linux (Tested on Ubuntu 16.04.2 LTS)
- JDK: Oracle JDK 1.7
- Required python packages: gensim (3.1.0) , matplotlib (2.0.2), nltk (3.2.4), numpy (1.13.3), pandas (0.20.1), scikit-learn (0.19.1), scipy (1.0.0), xgboost (0.6a2)
How to run
Cond is an Eclipse project, in which it can be directly imported and executed.
The main entrence is the class edu.pku.sei.conditon.dedu.predall.PredAllExperiment
, and the configuration file is config.ini which controls the rule set selection.
III. Hanabi
Environment
- OS: Linux (Tested on Ubuntu 16.04.2 LTS)
- JDK: Oracle JDK 1.7 and 1.8
- Defects4J and Bugs.jar are required
How to run
Hanabi is an Eclipse project, in which it can be directly imported and executed.
The main class is cn.edu.pku.sei.plde.hanabi.main.Main
.
Generated patches
The generated patches can be found in the folder Patch.
The analysis of the correctness/incorrectness of the patches can be found in Readme.md
.