An empirical study on software understandability and its dependence on code characteristics

Author:

Lavazza LuigiORCID,Morasca SandroORCID,Gatto Marco

Abstract

Abstract Context Insufficient code understandability makes software difficult to inspect and maintain and is a primary cause of software development cost. Several source code measures may be used to identify difficult-to-understand code, including well-known ones such as Lines of Code and McCabe’s Cyclomatic Complexity, and novel ones, such as Cognitive Complexity. Objective We investigate whether and to what extent source code measures, individually or together, are correlated with code understandability. Method We carried out an empirical study with students who were asked to carry out realistic maintenance tasks on methods from real-life Open Source Software projects. We collected several data items, including the time needed to correctly complete the maintenance tasks, which we used to quantify method understandability. We investigated the presence of correlations between the collected code measures and code understandability by using several Machine Learning techniques. Results We obtained models of code understandability using one or two code measures. However, the obtained models are not very accurate, the average prediction error being around 30%. Conclusions Based on our empirical study, it does not appear possible to build an understandability model based on structural code measures alone. Specifically, even the newly introduced Cognitive Complexity measure does not seem able to fulfill the promise of providing substantial improvements over existing measures, at least as far as code understandability prediction is concerned. It seems that, to obtain models of code understandability of acceptable accuracy, process measures should be used, possibly together with new source code measures that are better related to code understandability.

Funder

Università degli Studi dell’Insubria

Publisher

Springer Science and Business Media LLC

Subject

Software

Reference51 articles.

1. GitHub (2022) - json-iterator/java: jsoniter (json-iterator) is fast and flexible JSON parser available in Java and Go. https://github.com/json-iterator. Accessed 29 Sept 2023

2. GitHub - stleary/JSON-java (2022) A reference implementation of a JSON package in Java. https://github.com/stleary/json-java. Accessed 29 Sept 2023

3. SourceMeter (2022). https://www.sourcemeter.com/. Accessed 29 Sept 2023

4. Ajami S, Woodbridge Y, Feitelson DG (2019) Syntax, predicates, idioms - what really affects code complexity. Empir Softw Eng 24(1):287–328. https://doi.org/10.1007/s10664-018-9628-3

5. Arcuri A, Briand L (2014) A hitchhiker’s guide to statistical tests for assessing randomized algorithms in software engineering. Softw Test Verif Reliab 24(3):219–250

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3