Abstract

Background: Coding guidelines can be contradictory despite their intention of providing a universal perspective on source code quality. For instance, five attributes (code size, semantic complexity, internal documentation, layout style, and identifier length) out of 13 presented contradictions regarding their influence (positive or negative) on the source code readability and comprehensibility. Aims: To investigate source code attributes and their influence on readability and comprehensibility. Method: A literature review was used to identify source code attributes impacting the source code reading and comprehension, and an empirical study was performed to support the assessment of four attributes that presented empirical contradictions in the technical literature. Results: Regardless participants’ experience; all participants showed more positive comprehensibility perceptions for Python snippets with more lines of code. However, their readability perceptions regarding code size were contradictory. The less experienced participants preferred more lines of code while the more experienced ones preferred fewer lines of code. Long and complete-word identifiers presented better readability and comprehensibility according to both novices and experts. Comments contribute to better comprehension. Furthermore, four indentation spaces dominated the code reading preference. Conclusions: Coding guidelines contradictions still demand further investigation to provide indications on possible confounding factors explaining some of the inconclusive results.

Highlights

  • Quality is a complex issue since its perception depends on different people’s expectations for a product [1]

  • Hindle, and Devanbu (O) [16] and Feigenspan et al (N) [30] measured the size using only the total number of lines. While the former identified it as being directly proportional to the source code readability/comprehensibility, the latter reached no conclusive influence on these characteristics

  • Concerning the readability characteristic, almost all explanations against the size of code were for the bigger code snippet versions, independent of the participants’ programming experience, which makes us conjecture whether the code size has a negative influence on its readability

Read more

Summary

Introduction

Quality is a complex issue since its perception depends on different people’s expectations for a product [1]. Software quality is assessed through the number of software defects and the effort required with its maintenance This perspective is expected given the high costs involved in the evolution of software [2], many other features can influence the perception of quality regarding software products. Five attributes (code size, semantic complexity, internal documentation, layout style, and identifier length) out of 13 presented contradictions regarding their influence (positive or negative) on the source code readability and comprehensibility. Results: Regardless participants’ experience; all participants showed more positive comprehensibility perceptions for Python snippets with more lines of code. Their readability perceptions regarding code size were contradictory. Conclusions: Coding guidelines contradictions still demand further investigation to provide indications on possible confounding factors explaining some of the inconclusive results

Objectives
Methods
Results
Conclusion
Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call