"Automatically Assessing Code Understandability" Reanalyzed: Combined Metrics Matter

kaestner@cs.cmu.edu (A. Trockman, K. Cates, M. Mozina, T. Nguyen, C. Kästner, B. Vasilescu)
Wed, 28 Nov 2018 13:18:40 -0500

Asher Trockman, Keenen Cates, Mark Mozina, Tuan Nguyen, Christian Kästner, and Bogdan Vasilescu. "Automatically Assessing Code Understandability" Reanalyzed: Combined Metrics Matter. In Proceedings of the 16th International Conference on Mining Software Repositories (MSR), pages 314--318, New York, NY: ACM Press, May 2018.

Previous research shows that developers spend most of their time understanding code. Despite the importance of code understandability for maintenance-related activities, an objective measure of it remains an elusive goal. Recently, Scalabrino et al. reported on an experiment with 46 Java developers designed to evaluate metrics for code understandability. The authors collected and analyzed data on more than a hundred features describing the code snippets, the developers’ experience, and the developers’ performance on a quiz designed to assess understanding. They concluded that none of the metrics considered can individually capture understandability. Expecting that understandability is better captured by a combination of multiple features, we present a reanalysis of the data from the Scalabrino et al. study, in which we use different statistical modeling techniques. Our models suggest that some computed features of code, such as those arising from syntactic structure and documentation, have a small but significant correlation with understandability. Further, we construct a binary classifier of understandability based on various interpretable code features, which has a small amount of discriminating power. Our encouraging results, based on a small data set, suggest that a useful metric of understandability could feasibly be created, but more data is needed.