-
Notifications
You must be signed in to change notification settings - Fork 3
/
RQ1.sh
41 lines (39 loc) · 1.95 KB
/
RQ1.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
bug_reports_path="/home/jack/bug_reports"
results_path="/home/jack/results"
codebase_path="/home/jack/codebase"
incbl_root="/home/jack/Blinpy-app"
cd $bug_reports_path
rm -rf $results_path"/runtime.txt"
for folder in `ls $1`
do
cd $bug_reports_path"/"$folder
for bug_pair in `ls $1`
do
firstline=$(echo `sed -n '1p' $bug_reports_path"/"$folder"/"$bug_pair"/""id_time.txt"`)
lastline=$(echo `sed -n '$p' $bug_reports_path"/"$folder"/"$bug_pair"/""id_time.txt"`)
echo $firstline
echo $lastline
cd $codebase_path"/"$folder
ver=$(git rev-list --all -n 1 --before="$firstline|cut -d "L" -f 2")
git reset --hard $ver
bug=$(echo $firstline|cut -d "L" -f 1)
python "$incbl_root"/local.py"" "$incbl_root" "$bug_reports_path"/"$folder/$bug_pair/$bug"L"" "$codebase_path"/"$folder"
mkdir -p $results_path"/"$folder"/"$bug_pair
cp -r $incbl_root"/.incbl-data/"$folder"/"* $results_path"/"$folder"/"$bug_pair
ver=$(git rev-list --all -n 1 --before="$lastline|cut -d "L" -f 2")
git reset --hard $ver
bug=$(echo $lastline|cut -d "L" -f 1)
starttime=$(echo `date +%s.%N`)
python "$incbl_root"/local.py"" "$incbl_root" "$bug_reports_path"/"$folder/$bug_pair/$bug"L"" "$codebase_path"/"$folder"
endtime=$(echo `date +%s.%N`)
runtime=$(echo "scale=6; $endtime-$starttime" | bc)
echo "$folder with incremental computing: $runtime" >> $results_path"/runtime.txt"
rm -rf $incbl_root"/.incbl-data/"$folder
starttime=$(echo `date +%s.%N`)
python "$incbl_root"/local.py"" "$incbl_root" "$bug_reports_path"/"$folder/$bug_pair/$bug"L"" "$codebase_path"/"$folder"
endtime=$(echo `date +%s.%N`)
runtime=$(echo "scale=6; $endtime-$starttime" | bc)
echo "$folder without incremental computing: $runtime" >> $results_path"/runtime.txt"
rm -rf $incbl_root"/.incbl-data/"$folder
done
done