Coder Social home page Coder Social logo

ekincanufuktepe / change-instepector-java Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 3.03 MB

This project is on inspecting change types from commits (QRS2021)

ANTLR 0.12% Java 99.88% Python 0.01%
java parsing change-type-detection parse-tree repository-mining bug-fix-changes

change-instepector-java's Introduction

Change Instepector Java

This project is on inspecting change types from commits.

Running PyDriller for change collection

For PyDriller you need Python 3.x. It is recommended to use Anaconda for installing dependecies.

To run Pydriller, you can simply use the command below:

python find_changed_codes.py

Running Change Inspectore Java

To run Change Inspector Java (CIJ), make sure you have collected the changed files extracted from PyDriller. You will need two folders; one for source codes before change and one for source codes after change. These two folders should have the Java source codes for parse tree generation.

Setting Parameters for Change Inspector Java

Running CIJ is very simple and very few parameters needs to be set. All the required parameters should be set in the Main class given below.

cij.Main.java

There are two variables that need to be set:

  • Set path to source files: To set the path to the source files you need to use modify the varible given below in the main function, which is currently set to commons-csv_data in the source code by default.
String dataFileName = "commons-csv_bug_fix_data";

This path should contain data obtained from PyDriller and the folder hierarchy should follow the example given below:

python/[project_bug_fix_data]/[commit-hash-value]/before/[set of .java files]

python/[project_bug_fix_data]/[commit-hash-value]/after/[set of .java files]

For example for project commons-csv and for hash value 1a7c6140825bd7b3abe73c5dd732b090acc84b61 the folder structure would look like the path given below:

python/commons-csv_bug_fix_data/1a7c6140825bd7b3abe73c5dd732b090acc84b61/before/*.java

and

python/commons-csv_bug_fix_data/1a7c6140825bd7b3abe73c5dd732b090acc84b61/after/*.java

  • Set report file name and/or directory: Currently the change type report will create a file called changeReport.txt. If you want to change the file report name and directory, you will have to modify the code below from the main function:
BufferedWriter bw = new BufferedWriter(new FileWriter("changeReport.txt"));

Dataset

Dataset is organized as the following:

change_reports
├── changeReport_commons-csv.txt
└── ...
python
├── find_changed_codes.py
├── bug_and_fix_data
|   ├── commons-csv
|   |   └── active-bugs.csv
|   └── ...
├── commons-csv_bug_fix_data
|   ├── 1282503fb97d621b4225bd031757adbfada66181
|   |   ├── after
|   |   |   ├── CSVFormat.java
|   |   |   ├── CSVPrinter.java
|   |   |   └── CSVPrinterTest.java
|   |   └── before
|   |       ├── CSVFormat.java
|   |       ├── CSVPrinter.java
|   |       └── CSVPrinterTest.java
|   └── ...
└── ...

Citing

If you have used our work please cite us:

Tracking Code Bug Fix Ripple Effects Based on Change Patterns Using Markov Chain Models (IEEE TR '22)

@article{ufuktepe2022tracking,
  title={Tracking Code Bug Fix Ripple Effects Based on Change Patterns Using Markov Chain Models},
  author={Ufuktepe, Ekincan and Tuglular, Tugkan and Palaniappan, Kannappan},
  journal={IEEE Transactions on Reliability},
  volume={71},
  number={2},
  pages={1141--1156},
  year={2022},
  publisher={IEEE}
}

The relation between bug fix change patterns and change impact analysis (QRS'21)

@inproceedings{ufuktepe2021relation,
  title={The relation between bug fix change patterns and change impact analysis},
  author={Ufuktepe, Ekincan and Tuglular, Tugkan and Palaniappan, Kannappan},
  booktitle={2021 IEEE 21st International Conference on Software Quality, Reliability and Security (QRS)},
  pages={1089--1099},
  year={2021},
  organization={IEEE}
}

change-instepector-java's People

Contributors

ekincanufuktepe avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

jsaied99

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.