Effects of Refactoring on Productivity in Relation to Code Understandability

More Info
expand_more

Abstract

Depending on the context, the benefits of clean code with respect to understandability might be less plain in the short term than is often claimed. This work has studied a system with legacy code in an industrial environment to evaluate if giving ‘clean code’ to developers would immediately lead to increases in productivity. They were given refactored components and were assigned small coding tasks to complete. Contrary to our expectations, we observed both increases as well as decreases in understandability, showing that immediate increases in understandability are not always obvious. This study suggests that negative effects could have been caused by the fact that the test subjects were used to long methods rather than a decomposed design. Another finding is that unit tests, accompanying refactorings, can lead to more substantial increases in productivity. Secondly, developers tend to implement higher quality solutions when working with clean code. A recommendation to improve the net return on refactoring is to not just refactor to improve its understandability, unless one has additional motives, such as easing maintenance or increasing testability.