Shorter identifier names take longer to comprehend
Developers spend the majority of their time reading code, a process in which identifier names play a key role. Although many identifier naming styles exist, they often lack an empirical basis and it is not clear whether short or long identifier names facilitate comprehension. In this paper, we inves...
Gespeichert in:
| Hauptverfasser: | , , |
|---|---|
| Dokumenttyp: | Article (Journal) |
| Sprache: | Englisch |
| Veröffentlicht: |
2019
|
| In: |
Empirical software engineering
Year: 2018, Jahrgang: 24, Heft: 1, Pages: 417-443 |
| ISSN: | 1573-7616 |
| DOI: | 10.1007/s10664-018-9621-x |
| Online-Zugang: | Verlag, Volltext: https://doi.org/10.1007/s10664-018-9621-x |
| Verfasserangaben: | Johannes C. Hofmeister, Janet Siegmund, Daniel V. Holt |
| Zusammenfassung: | Developers spend the majority of their time reading code, a process in which identifier names play a key role. Although many identifier naming styles exist, they often lack an empirical basis and it is not clear whether short or long identifier names facilitate comprehension. In this paper, we investigate the effect of different identifier naming styles (single letters, abbreviations, and words) on program comprehension. We conducted an experimental study with 72 professional C# developers who had to locate defects in source code snippets. We used a within-subjects design, such that each developer worked with all three versions of identifier naming styles, and we measured the time it took them to find a defect. We found that word identifiers led to a 19% increase in speed to find defects compared to meaningless single letters and abbreviations, but we did not find a difference between letters and abbreviations. The results of our study suggest that code is more difficult to comprehend when it contains only letters and abbreviations as identifier names. Words as identifier names facilitate program comprehension and may help to save costs and improve software quality. |
|---|---|
| Beschreibung: | First online: 26 April 2018 Gesehen am 18.09.2019 |
| Beschreibung: | Online Resource |
| ISSN: | 1573-7616 |
| DOI: | 10.1007/s10664-018-9621-x |