Skip to content

Latest commit

 

History

19 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code Clone Detection Tool

This tool performs code clone detection using Z3 SMT solver for symbolic reasoning.

Setup Instructions

1. Clone the repository

git clone ...
cd SimTwin

2. Create and activate the virtual environment

python3 -m venv venv
source venv/bin/activate

3. Install dependencies

pip install -r requirements.txt

Running the Tool

To run the code clone detection:

python3 SimTwin.py T2_samples/func1.py T2_samples/func2.py

Make sure your virtual environment is activated before running the script.

Deactivate virtual environment (optional)

After using the tool, deactivate your virtual environment by running:

deactivate

Note: Ensure you have Python 3 installed on your machine.


Example Test Cases

Here are some example comparisons you can run to validate the tool:

******* TYPE 1 EXAMPLES *******

python3 SimTwin.py T1_samples/func0.py T1_samples/func1.py
python3 SimTwin.py T1_samples/func1.py T1_samples/func2.py
python3 SimTwin.py T1_samples/func3.py T1_samples/func4.py

******* TYPE 2 EXAMPLES *******

python3 SimTwin.py T2_samples/func1.py T2_samples/func2.py
python3 SimTwin.py T2_samples/func3.py T2_samples/func4.py

******* TYPE 3 EXAMPLES *******

python3 SimTwin.py T3_samples/func1.py T3_samples/func2a.py
python3 SimTwin.py T3_samples/func1.py T3_samples/func2b.py
python3 SimTwin.py T3_samples/func2a.py T3_samples/func2b.py

python3 SimTwin.py T3_samples/func3.py T3_samples/func4.py

python3 SimTwin.py T3_samples/func5.py T3_samples/func6.py
python3 SimTwin.py T3_samples/func5.py T3_samples/func7.py
python3 SimTwin.py T3_samples/func5.py T3_samples/func8.py
python3 SimTwin.py T3_samples/func6.py T3_samples/func7.py
python3 SimTwin.py T3_samples/func6.py T3_samples/func8.py
python3 SimTwin.py T3_samples/func7.py T3_samples/func8.py

******* TYPE 4 EXAMPLES *******

python3 SimTwin.py T4_samples/func1.py T4_samples/func2.py
python3 SimTwin.py T4_samples/func3.py T4_samples/func4.py

****** NO CLONE EXAMPLES ******

python3 SimTwin.py T1_samples/func1.py T4_samples/func2.py
python3 SimTwin.py T1_samples/func1.py T4_samples/func4.py
python3 SimTwin.py T1_samples/func1.py T3_samples/func5.py

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages