Automated Refactoring: Can They Pass The Turing Test?

08/13/2018
by   Rodrigo Morales, et al.
0

Refactoring is a maintenance activity that aims to improve design quality while preserving the behavior of a system. Several (semi)automated approaches have been proposed to support developers in this maintenance activity, based on the correction of anti-patterns, which are "poor solutions" to recurring design problems. However, little quantitative evidence exists about the impact of automatically refactored code on program comprehension, and in which context automated refactoring can be as effective as manual refactoring. We performed an empirical study to investigate whether the use of automated refactoring approaches affects the understandability of systems during comprehension tasks. (1) We surveyed 80 developers, asking them to identify from a set of 20 refactoring changes if they were generated by developers or by machine, and to rate the refactorings according to their design quality; (2) we asked 30 developers to complete code comprehension tasks on 10 systems that were refactored by either a freelancer or an automated refactoring tool. We measured developers' performance using the NASA task load index for their effort; the time that they spent performing the tasks; and their percentages of correct answers. Results show that for 3 out the 5 types of studied anti-patterns, developers cannot recognize the origin of the refactoring (i.e., whether it was performed by a human or an automatic tool). We also observe that developers do not prefer human refactorings over automated refactorings, except when refactoring Blob classes; and that there is no statistically significant difference between the impact on code understandability of human refactorings and automated refactorings. We conclude that automated refactorings can be as effective as manual refactorings. However, for complex anti-patterns types like the Blob, the perceived quality of human refactorings is slightly higher.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
09/05/2020

A Large Scale Empirical Study of the Impact of Spaghetti Code and Blob Anti-patterns on Program Comprehension

Context: Several studies investigated the impact of anti-patterns (i.e.,...
research
07/06/2021

COSPEX: A Program Comprehension Tool for Novice Programmers

Developers often encounter unfamiliar code during software maintenance w...
research
03/31/2021

Investigating Design Anti-pattern and Design Pattern Mutations and Their Change- and Fault-proneness

During software evolution, inexperienced developers may introduce design...
research
07/12/2022

Refactoring Assertion Roulette and Duplicate Assert test smells: a controlled experiment

Test smells can reduce the developers' ability to interact with the test...
research
04/19/2022

Auto-Icon+: An Automated End-to-End Code Generation Tool for Icon Designs in UI Development

Approximately 50 tasks [9]. Occupying a large proportion of development ...
research
12/12/2022

Automated Variable Renaming: Are We There Yet?

Identifiers, such as method and variable names, form a large portion of ...
research
06/23/2020

A Catalogue of Game-Specific Anti-Patterns

With the ever-increasing use of games, game developers are expected to w...

Please sign up or login with your details

Forgot password? Click here to reset