Skip to content

habibrahmanbd/JavaRepoMiner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JavaRepoMiner

JavaRepoMiner is a python tool which can detect:

  • Java method signature after and before a commit. In this repo, JavaRepoMiner mines a given Java GitHub code repository and analyses all the commits in that repository to find the commits that have added a parameter to an existing method. For example, assume that we have a method test(int x) in a Java file. If a commit changes this method to be test(int x, int y) then this commit added a parameter to this function and this project will detect that.
  • Java class before and after commit,
  • Java Library before and after commit,
  • Java Loops before and after commit.

JavaRepoMiner makes a report in CSV file with:

  • Columns of "Commit SHA, Java File, Before Commit Status, After Commit Status”.
  • Frequency of Method, Class, Library, and Loop.

Getting Started

Requirements

  • Python 3.X
  • Git

Setting up the requirements

  • To install git in Linux:
sudo apt-get install git
  • To install PyDriller[1]:
pip install pydriller

Module and Methods

  • RepoMiner.py This module wil take the Java code repository as input and write the output as described in a CSV file upder the Outputs folder.

  • RepoMiner method takes the git repo name as input and returns the results to write in CSV.

  • isMethod method checks the JAVA statements and ensures that statement is a method or not.

How it works

After running the RepoMiner.py module, it will prompt for input. The input is the JAVA code repository. For example, we have a repo named JavaTestingRepo in parent directory, then input will be like ../JavaTestingRepo. Then it write the result in this project in a folder name output as Result.csv.

Run

To run the code:

$ git clone https://github.com/habibrahmanbd/JavaRepoMiner.git
$ python RepoMiner.py
Enter the git name with path: <RepoNameWithDirectory>
Output printed successfully...

Datasets

Two popular JAVA git repo, java-design-patterns [2] and RxJava [3] is used as dataset. JavaTestingRepo [4] is a demo git repo for running this code while developing.

Results

  • java-design-patterns.csv is the result of [2]
  • RxJava is the result of [3]
  • JavaTestingRepo is the result of [4]

References

About

Mining Software Repositories

Resources

Stars

Watchers

Forks

Packages

No packages published