This website contains complementary data to the paper.
Background: Code refactoring aims to improve code structures via code transformations. A single transformation rarely suffices to fully remove code smells that reveal poor code structures. Most transformations are applied in batches, i.e. sets of interrelated transformations, rather than in isolation. Nevertheless, empirical knowledge on batch application, or batch refactoring, is scarce. Such scarceness helps little to improve current refactoring practices. Aims: We analyzed 57 open and closed software projects. We aimed to understand batch application from two perspectives: characteristics that typically constitute a batch (e.g., the variety of transformation types employed), and the batch effect on smells. Method: We analyzed 19 smell types and 13 transformation types. We identified 4,607 batches, each applied by the same developer on the same code element (method or class); we expected to have batches whose transformations are closely interrelated. We computed (1) the frequency in which five batch characteristic manifest, (2) the probability of each batch characteristics to remove smells, and (3) the frequency in which batches introduce and remove smells. Results: Most batches are quite simple: although most batches are applied on more than one method (90%), they are usually composed of the same transformation type (72%) and only two transformations (57%). Batches applied on a single method are 2.6 times more prone to fully remove smells than batches affecting more than one method. Surprisingly, batches mostly ended up introducing (51%) or not fully removing (38%) smells. Conclusions: The batch simplicity suggests that developers have sub-explored the combinations of transformations within a batch. We summarized some batches that may fully remove smells, so that developers can incorporate them into current refactoring practices.
# | Artifact | Description |
---|---|---|
1 | Batch Effect on Code Smells that affect the Method Scope | This file contains the number of code smells that affect the method scope which can have added or removed by batches according to the nature of code transformations. |
2 | Batch Effect on Code Smells that affect the Class Scope | This file contains the number of code smells that affect the class scope which can have added or removed by batches according to the nature of code transformations. |
3 | Distance between commits to complete a batch | This file contains the distance (number of days) between commits to complete a batch. |
4 | Frequency of distance between commits to complete a batch | This file contains the frequency of distance between commits to complete a batch. |
5 | Paper | This file contains the paper accepted in ESEM 2019 - Research Track. |
Any questions and/or suggestions should be sent to the paper authors as follows.
# | Name | |
---|---|---|
1 | Ana Carla Bibiano | abibiano@inf.puc-rio.br |
2 | Eduardo Fernandes | emfernandes@inf.puc-rio.br |
3 | Daniel Oliveira | doliveira@inf.puc-rio.br |
4 | Alessandro Garcia | afgarcia@inf.puc-rio.br |
5 | Marcos Kalinowski | kalinowski@inf.puc-rio.br |
6 | Baldoino Fonseca | baldoino@ic.ufal.br |
7 | Roberto Oliveira | rfelicio@inf.puc-rio.br |
8 | Anderson Oliveira | aoliveira@inf.puc-rio.br |
9 | Diego Cedrim | dccedrim@amazon.com |