CLAMS

A novel approach for mining API Usage Examples in the form of source code snippets, from client code

Documentation

Source Code

The source code of CLAMS is available at https://github.com/mast-group/clams.

Installation Instructions

Clone the project:

git clone https://github.com/mast-group/clams.git

Cd to the project's directory:

cd clams

Install Java 8:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer

Install/Configure Anaconda 2:

wget https://repo.continuum.io/archive/Anaconda2-4.2.0-Linux-x86_64.sh
bash Anaconda2-4.2.0-Linux-x86_64.sh -b -p ~/anaconda
rm Anaconda2-4.2.0-Linux-x86_64.sh

//replace <username> with your username before running the following command
echo 'export PATH="/home/<username>/anaconda/bin:$PATH' >> ~/.bashrc 
source .bashrc
conda update conda
conda config --add channels conda-forge

Install the Artistic Style formatter:

mkdir libs/astyle
sudo apt-get install astyle
ln -s /usr/bin/astyle ./libs/astyle/astyle

Install srcML (remove -64 for 32 bit OS):

mkdir libs/srcml
wget http://131.123.42.38/lmcrs/beta/srcML-Ubuntu14.04-64.deb
sudo dpkg -i srcML-Ubuntu14.04-64.deb
rm srcML-Ubuntu14.04-64.deb
ln -s /usr/bin/srcml ./libs/srcml/srcml

Install python dependencies using conda and requirements.txt:

conda install --file requirements.txt

Usage

You can run the application using the following command:

python main.py

The results will be stored in the results directory.