In this empirical study, we examined refactoring activities to explore how developers document their refactoring activities during the software life-cycle. Then we extract the rationale behind the applied refactorings, e.g., fixing code smells or improving specific quality attributes. Our approach relies on text mining refactoring-related change messages and identifying refactoring patterns by only considering refactoring commits.
More specifically, the research questions that we investigated are:
RQ1. What patterns do developers use to describe their refactoring activities?
Since there is no consensus on how to formally document the act of refactoring code, we mine in this research questions, patterns, using which developers have described their refactoring activities. The outcome of this research question enumerates the most popular text patterns used in the analyzed commit messages.
RQ2. What are the quality issues that drive developers to refactor?
In this research question, we investigate whether developers explicitly mention the purpose of their refactoring activity, e.g., improving structural metrics of fixing code smells.
RQ3. What are the top-10 patterns developers use to describe quality issues in their commits?
we link between patterns extracted from the first research question and the quality issues found in the second question. We explore how developers express combining them to express their refactoring activity.
RQ4. Do Commits containing the label "Refactor" indicate more refactoring activity than those without the label?
We quantify the commit messages with the label "refactor" and without to compare between them.
If you are interested to learn more about the process we followed, please refer to our paper.
Eman Abdullah AlOmar, Mohamed Wiem Mkaouer, and Ali Ouni, "Can refactoring be self-affirmed? an exploratory study on how developers document their refactoring activities in commit messages", the 3nd International Workshop on Refactoring (IWoR'2019). [preprint]