Skip to content

Latest commit

 

History

History
62 lines (52 loc) · 3.98 KB

INSTALL.md

File metadata and controls

62 lines (52 loc) · 3.98 KB

Installing SLACC

SLACC can be setup from scratch on a local machine or a preconfigured virtualbox image can be used. We would recommend the preconfigured virtualbox for prototyping and while setting up from scratch for replicating the ICSE results.

Preconfigured Image

Setting up SLACC can be a cumbersome task. We have preset SLACC as a virtualbox image with the CodeJam dataset used in our study and a sample Example dataset which we used in the motivation section of our paper.

Setting up

  • First download the latest version of VirtualBox for your operating system.
  • Download the virtualbox image of SLACC.
  • Open Virtualbox and import the image. File -> Import Appliance. Please note that the virtual box is configured for smaller experiments so it might not be ideal for large experiments like the one used in our paper.
  • Hardware Requirements: 8GB memory, 20GB storage(dynamically expands based on source code)

Navigating around

  • Once the image is booted up, it can be logged in using the credentials
USER_NAME :  SLACC
PASS_WORD: slacc
  • The source code is already downloaded and unpacked in the folder ~/Raise/ProgramRepair/SLACC. Navigate into this folder
> cd ~/Raise/ProgramRepair/SLACC
  • Setting up DB. Check if mongoDB is running using the command mongo. If not start mongoDB using
> mongostart
  • You are now set to use SLACC. No changes have to be made to the java or python properties. Head over to the README to try out a on the Example dataset or the CodeJam dataset.

Setting up from Scratch

Clone SLACC from github using

> git clone https://github.com/DynamicCodeSearch/SLACC.git

Hardware

  • SLACC requires atleast 4GB of memory to function on smaller programs. Storage and number of processors vary based on the size of the targe code for clone detection.
  • For the CodeJam dataset used in the paper, we used a 16 node cluster 4-core AMD opteron processor and 32GB DDR3 1333 ECCDRAM. This took around 2 hours for SLACC to identify clusters in the dataset.

Java

  • SLACC requires JDK version 1.8. After downloading this version configure the environment variable $JAVA_HOME to the path where Java is installed.
  • We also use maven version 3.3+. Make sure you can access the maven command mvn form a command line window.
  • We would recommend a GUI like Intellij Idea or Eclipse if you plan on editing the source code.
  • The additional java dependecies can be installed by running mvn clean install in SLACC/code folder.

Python

  • We use python 2.7.6+. Make sure you can access python from the command line after installing python.
  • For managing python packages we use pip 9.0+. Make sure you can access pip from the command line after installing pip.
  • To install required python libraries
> cd SLACC/code
> pip install -r requirements.txt

Database

  • Most of the data and meta-data used by SLACC is stored in MongoDB. We use MongoDB 3.6 for our experiments but it should work on later versions as well.
  • Set the environment variable $MONGO_HOME to the path where Mongo is installed.

Properties

Finally the properties have to be set for Java and Python

  • Open SLACC/code/src/main/java/edu/ncsu/config/Settings.java and set the variable ROOT_PATH to the parent folder where SLACC is cloned.
  • Open /SLACC/code/src/main/python/properties.py and set the variable ROOT_HOME to the parent folder where SLACC is cloned.