An Empirical Study of the Impact of Two Antipatterns, Blob and Spaghetti Code, on Program Comprehension

Marwen Abbes, Foutse Khomh, Yann‐Gaël Guéhéneuc, Giuliano Antoniol

2011 · 311 citations · 25 references

Concepts

TL;DR

Antipatterns are poor solutions to recurring design problems that are thought to make object‑oriented systems harder to maintain, yet quantitative evidence for this claim is scarce. This study examines whether the presence of antipatterns impairs developers’ ability to understand and maintain software during comprehension tasks. Three experiments with 24 participants each measured effort (NASA TLX), task time, and correctness to evaluate the effects of Blob and Spaghetti Code alone and in combination. Results show that a single antipattern does not significantly degrade performance, but the combination of both markedly impedes developers, suggesting that multiple antipatterns should be avoided through detection and refactoring.

Abstract

Antipatterns are "poor" solutions to recurring design problems which are conjectured in the literature to make object-oriented systems harder to maintain. However, little quantitative evidence exists to support this conjecture. We performed an empirical study to investigate whether the occurrence of antipatterns does indeed affect the understandability of systems by developers during comprehension and maintenance tasks. We designed and conducted three experiments, with 24 subjects each, to collect data on the performance of developers on basic tasks related to program comprehension and assessed the impact of two antipatterns and of their combinations: Blob and Spaghetti Code. We measured the developers' performance with: (1) the NASA task load index for their effort, (2) the time that they spent performing their tasks, and, (3) their percentages of correct answers. Collected data show that the occurrence of one antipattern does not significantly decrease developers' performance while the combination of two antipatterns impedes significantly developers. We conclude that developers can cope with one antipattern but that combinations of antipatterns should be avoided possibly through detection and refactorings.

References

25