Ready to work
The configuration of eclipse and jdk is detailed in this article:
ubuntu install eclipse+jdk1.7+jdk1.8 environment configuration
Simfix configuration
Quote: Configuration and use of Simfix code repair tool in Ubuntu environment.
Follow the above tutorial and add some details about the problems encountered in the process
1. Environmental installation
1.eclipse+jdk
See preparation
2. Git configuration
Terminal run
sudo apt-get update
sudo apt-get install git
An error occurred:
modified to
sudo apt-get -f install git
Solution:
Then
git --version
result
3. SVN configuration
sudo apt-get install subversion
#检查版本
svn --version
4. Perl configuration
You can find the corresponding version on the official website http://www.cpan.org/src/5.0 , take perl-5.26.1.tar.gz as an example.
Note : Because the download speed on the official website is very, very slow, I found a few A domestic source, super fast~
Perl's Chinese mirror website https://blog.csdn.net/weixin_30852451/article/details/98619978
perl-5.26.1.tar.gz Domestic source link : ftp://mirrors. ustc.edu.cn/CPAN/src/5.0/
sudo wget ftp://mirrors.ustc.edu.cn/CPAN/src/5.0/perl-5.26.1.tar.gz
sudo tar -xzvf perl-5.26.1.tar.gz
cd perl-5.26.1
./Configure -des -Dprefix=$HOME/localperl
make
make test
make install
The Perl installation is over~
2. Install Defects4j
1. Download Defects4J:
git clone https://github.com/rjust/defects4j
I don’t know if it was walled or something at this step. The download was very slow. I found several methods (including compressing clone depth, increasing Buffer, etc.). Finally, I downloaded the .zip package directly, and I encountered it before. I had this problem, but it was resolved later and I forgot how to get it. .
Unzip it in the home directory: /home/XXX/
2. Initialize Defects4J:
cd defects4j
init.sh
An error was reported when running ./init.sh, and it was found that the default shell was dash, changed to bash:
But the running speed was extremely slow. .
sh init.sh time is always very slow, the card will not move to a certain point and then broken link, that is the site of the problem, the ssr this profile or not, the final submission found to be executed in the terminal at GitHub carton install
, Normally after installing carton.
Reference link: https://github.com/rjust/defects4j/issues/169
finally initialized successfully! ! This step is really stuck for many days
3. Add the executable file of Defects4J to the path:
sudo gedit /etc/profile
export PATH=$PATH:/home/fzx/defects4j-master/framework/bin
export DEFECTS4J_HOME=/home/lizeyu/defects4j-master
source /etc/profile
4. Check the installation
defects4j info -p Lang
Success~
5. Use defects4j:
1. Get information about a specific project (commons lang)
defects4j info -p Lang
2. Get information about a specific bug (commons lang, bug 1)
defects4j info -p Lang -b 1
3. Check out the source code version with bugs (common lang, bug 1, bug version)
defects4j checkout -p Lang -v 1b -w /tmp/lang_1_buggy
4. Change to work Directory, compile the source code and test, and run the test.
cd /tmp/lang_1_buggy
defects4j compile
defects4j test
If it appears during the test:
Can't locate DBI.pm in @INC (you may need to install the DBI module) (@INC contains:)
terminal input command:
sudo apt-get install libdbi-perl
Three. Simfix use
1. Data preparation
Create a new simfix folder in the eclipse working directory, copy the entire project, and replace conflicts.
Unzip 文件
sbfl / data.zip 到
sbfl / data:
unzip ./sbfl/data.zip
Create a new directory under the personal user directory d4j/lang
and run:
defects4j checkout -p Lang -v 1b -w /home/fzx/d4j/lang/lang_1_buggy
If you cannot find the defects4j command (after you have configured the profile), try restarting~
2. Switch jdk1.8 to jdk1.7
Because the minimum version of jdk required by eclipse is 1.8, first configure eclipse with 1.8, and then import the 右击
simfix project after the projectbuild-path