refactoring-ai / predicting-refactoring-ml

Refactoring recommendation via ML
MIT License
28 stars 8 forks source link

Move Refactorings are not tracked #165

Closed jan-gerling closed 4 years ago

jan-gerling commented 4 years ago

The process metrics test for toyrepo 07 (#163 ) showed, that move source refactorings are not tracked by the ProcessMetricsTracker.

jan-gerling commented 4 years ago

@mauricioaniche Fixing this issue is actually quite difficult:

  1. JGit does not detect (some) move and all move source dir refactorings, but RMiner does
  2. JGit does not generate diffentries for these cases, thus we cannot update the process metrics correctly

Solution:

  1. ignore line deletions and additions in move refactorings
  2. Reorder the entire commit processing:
    1. Collect process metrics already while processing refactorings
    2. update the PMDatabase while processing refactorings
    3. only detect and store stable commits in ProcessMetricsCollector (rename it then)
mauricioaniche commented 4 years ago

Hi, Jan! I'm not sure if I understand it. RMiner identifies the refactoring. The refactoring then goes to the allRefactoringCommits variable in App:processCommit. Then, we call processMetrics.collectMetrics, passing the list of refactorings.

Why can't you collect the metrics for all the refactorings there? I'm having the feeling it's because the name of the files are not matching. Am I right? If so, maybe you will have to do like I did, see getMapWithOldAndNewFiles() method in RefactoringAnalyzer.

We definitely know that the class suffered a refactoring, so I suppose all we need to do is to find the diff entry related to it.

Shall we talk in person about it? You walk me through the case, so that I can maybe help you a bit more?

mauricioaniche commented 4 years ago

How's this issue going?