8000 GitHub - Symbolk/RefConfMiner: Python scripts to process data about refactoring-involved merge conflicts.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Symbolk/RefConfMiner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RefConfMiner

Forked From: https://github.com/ualberta-smr/refactoring-analysis-results

Python scripts to analyze MySql data generated by https://github.com/Symbolk/RefactoringsInMergeCommits, which mines merge scenarios with refactoring-related merge conflict(s) from Git repositories.

Requirements

  • Windows (recommended)/Linux/macOS
  • Python 3.7
  • MySQL 5.7
  • PyCharm

Import Dumped Data for Evaluation

  1. Download the dumped data: dumped_data/20190401.sql;

  2. Start MySQL 5.7 locally, import the data into it:

    mysql -u root -p
    Enter password: *****
    mysql> CREATE DATABASE refactoring_analysis;
    mysql> use refactoring_analysis
    mysql> source 20190401.sql
  3. Show studied projects:

    mysql> show tables;
    mysql> select * from project;
  4. To get the number of merge commits with commits for one project:

    select * from project where name="error-prone";
    select count(*) from merge_commit WHERE project_id=10 and is_conflicting=1 and timestamp < 1554048000;

    1554048000 = 2019.04.01

Setup

  1. Open the clone repository as a project with PyCharm;
  2. Under the stats/ directory of the cloned repository, run the following command in the terminal:
pip install -r requirements.txt 
  1. Edit database.properties to config MySQL:
development.driver=com.mysql.jdbc.Driver
development.username=<username>
development.password=<password>
development.url=jdbc:mysql://localhost//refactoring_analysis

Usage

I. Compute statistics of refactorings of different types:

  1. Edit the following code in stats/refactorings_analyzer.py to select one of the two dimensions:

    if __name__ == '__main__':
        get_overall_refactorings_num_by_refactoring_type()
        # get_involved_refactorings_num_by_refactoring_type()
  2. Run the main function of stats/refactorings_analyzer.py to get the result csv file under the stas/results folder.

  3. Visualize the results:

    (a) Overall refactorings in the commit history:

    overall

    (b) Involved refactorings in merge conflicts:

    involved

II. Collect merge scenarios with refactoring-related merge conflict(s):

  1. Edit the following code in stats/data_resolver.py to config repo information:

    def get_merge_scenarios_involved_refactorings():
        # process one project each time
        repo_id = "ID"
        repo_name = "NAME"
        repo_paths = [
            'D:\\github\\repos\\'+repo_name
        ]
        csv_path = 'merge_scenarios_involved_refactorings_' + repo_name + '.csv'
  2. Run the main function of stats/data_resolver.py to get the csv file, which contains a summary of the collected data:

    summary

III. Calculate running time for IntelliMerge and jFSTMerge:

Run stats/runtimes.py with the stats/runtimes.csv file as the input, which is generated by evaluation programs in https://github.com/Symbolk/IntelliMerge.

Average running time:
IntelliMerge	1237.5151856017999ms
jFSTMerge	1932.0837642192348ms
Median running time:
IntelliMerge	367.0ms
jFSTMerge	1373.0ms

About

Python scripts to process data about refactoring-involved merge conflicts.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages

0