Browse Source

Merge remote-tracking branch 'SZZ_upstream/master'

Markus Borg 6 years ago
parent
commit
c25c852438
2 changed files with 69 additions and 5 deletions
  1. 32 0
      code/Dockerfile
  2. 37 5
      code/README.md

+ 32 - 0
code/Dockerfile

@@ -0,0 +1,32 @@
+FROM java:8-jdk-alpine
+
+RUN apk add --no-cache --update python3 git
+
+ADD . /root/
+
+WORKDIR /root
+RUN git clone https://github.com/jenkinsci/jenkins.git
+
+WORKDIR /root/fetch_jira_bugs
+RUN python3 fetch.py
+RUN python3 git_log_to_array.py --repo-path ../jenkins
+RUN python3 find_bug_fixes.py --gitlog ./gitlog.json --issue-list ./issues
+
+WORKDIR /root/szz
+
+RUN apk add --no-cache --update openjdk8 curl
+
+RUN mkdir /usr/lib/gradle
+WORKDIR /usr/lib/gradle
+RUN set -x \
+  && curl -L -O https://services.gradle.org/distributions/gradle-4.10.3-bin.zip \
+  && unzip gradle-4.10.3-bin.zip
+
+ENV PATH ${PATH}:/usr/lib/gradle/gradle-4.10.3/bin
+
+WORKDIR /root/szz
+
+RUN gradle build && gradle fatJar
+RUN java -jar ./build/libs/szz_find_bug_introducers-0.1.jar -i ../fetch_jira_bugs/issue_list.json -r ../jenkins
+
+WORKDIR /root

+ 37 - 5
code/README.md

@@ -14,8 +14,18 @@ The bug-introducing commits can be extracted either from a bug tracking system s
 
 * Java 8
 * Gradle
+  
+All scripts and compilations has been tested on Linux and Mac.
 
-## Usage SZZ algorithm
+To use docker, one needs Docker installed as well.
+
+# Table of Contents
+1. [Usage SZZ algorithm](#szz_usage)
+2. [SZZ with Docker](#szz_docker)
+3. [Feature Extraction](#feat_extract)
+4. [Authors](#authors)
+
+## Usage SZZ algorithm <a name="szz_usage"></a>
 
 ### Grab issues ###
 To get issues one needs a bug tracking system. As an example the project Jenkins uses [JIRA](https://issues.jenkins-ci.org).
@@ -65,8 +75,6 @@ by the previous issue to bug fix commit step, run:
 ```shell
 java -jar szz_find_bug_introducers-<version_number>.jar -i <path_to_issue_list.json> -r <path_to_local_repo>
 ```
-To assemble the results if the algorithm was able to use more than one core,
-run the `assembler.py` script on the results directory.
 
 ## Output
 
@@ -89,7 +97,31 @@ way and it includes duplicates when it comes to both introducers and fixes. A
 fix can be made several times and a introducer could be responsible for many
 fixes.
 
-## Feature Extraction ##
+## Use Docker to generate fix_and_bug_introducing_pairs.json. <a name="szz_docker"></a>
+
+There exist a *Dockerfile* in the repository. It contains all the steps in chronological order that is needed to generate the **fix\_and\_bug\_introducing\_pairs.json**. Simply run this command in the directory where the Dockerfile is located:
+
+```bash
+docker build -t ssz .
+```
+
+Then start a temporary docker container:
+```bash
+docker run -it --name szz_con szz ash
+```
+In this container it is possible to study the results from the algorithm. The results are located in */root/szz/results*.
+
+Lastly, to copy the results from the container to your own computer run:
+```bash
+docker cp szz_con:/root/szz/results .
+```
+
+Note that the temporary container must be running while the *docker cp* command is executed. To be sure, check that the *szz_con* is listed when running:
+```bash
+docker ps
+```
+
+## Feature Extraction <a name="feat_extract"></a>
 Now that the potential bug-introducing commits has been identified, the
 repository can be mined for features.
 
@@ -190,7 +222,7 @@ be made. To do this, simply run the model script in the model directory:
 python model.py train
 ```
 
-## Authors
+## Authors <a name="authors"></a>
 
 [Oscar Svensson](mailto:wgcp92@gmail.com)
 [Kristian Berg](mailto:kristianberg.jobb@gmail.com)