To What Extent Cognitive-Driven Development Improves Code Readability?
收藏资源简介:
Cognitive-Driven Development (CDD) is a coding design technique<br> that aims to reduce the cognitive effort that developers place in<br> understanding a given code unit (e.g., a class). By following CDD de-<br> sign practices, it is expected that the coding units to be smaller, and,<br> thus, easier to maintain and evolve. However, it is so far unknown<br> whether these smaller code units coded using CDD standards are,<br> indeed, easier to understand. In this work we aim to assess to what<br> extent CDD improves code readability. To achieve this goal, we<br> conducted a two-phase study. We start by inviting professional<br> software developers to vote (and justify their rationale) on the most<br> readable pair of code snippets (from a set of 10 pairs); one of the<br> pairs was coded using CDD practices. We received 133 answers.<br> In the second phase, we applied the state-of-the art readability<br> model on the 10-pairs of CDD-driven refactorings. We observed<br> some conflicting results. On the one hand, developers perceived<br> that seven (out of 10) CDD-driven refactorings were more readable<br> than their counterparts; for two other CDD-driven refactorings,<br> developers were undecided, while only in one of the CDD-driven<br> refactorings, developers preferred the original code snippet. On<br> the other hand, we noticed that only one CDD-driven refactorings<br> have better performance readability, assessed by state-of-the-art<br> readability models. Our results provide initial evidence that CDD<br> could be an interesting approach for software design



