Recognizing Antipatterns and Analyzing Their Effects on Software Maintainability

Abstract

Similarly to design patterns and their inherent extra information about the structure and design of a system, antipatterns - or bad code smells - can also greatly influence the quality of software. Although the belief that they negatively impact maintainability is widely accepted, there are still relatively few objective results that would support this theory. In this paper we show our approach of detecting antipatterns in source code by structural analysis and use the results to reveal connections among antipatterns, number of bugs, and maintainability. We studied 228 open-source Java based systems and extracted bug-related information for 34 of them from the PROMISE database. For estimating the maintainability, we used the ColumbusQM probabilistic quality model. We found that there is a statistically significant, 0.55 Spearman correlation between the number of bugs and the number of antipatterns. Moreover, there is an even stronger, -0.62 reverse Spearman correlation between the number of antipatterns and code maintainability. We also found that even these few implemented antipatterns could nearly match the machine learning based bug-predicting power of 50 class level source code metrics. Although the presented analysis is not conclusive by far, these first results suggest that antipatterns really do decrease code quality and can highlight spots that require closer attention.

Publication
Proceedings of the 14th International Conference on Computational Science and Its Applications (ICCSA 2014), Guimarães, Portugal, Pages 337–352

BibTeX:

@InProceedings{BaF14,
    author    = {B\'an, D\'enes and Ferenc, Rudolf},
    booktitle = {Proceedings of the 14th International Conference on Computational Science and Its Applications (ICCSA 2014)},
    title     = {Recognizing Antipatterns and Analyzing Their Effects on Software Maintainability},
    year      = {2014},
    address   = {Guimar{\~a}es, Portugal},
    month     = jun,
    pages     = {337--352},
    publisher = {Springer-Verlag},
    series    = {Lecture Notes in Computer Science (LNCS)},
    volume    = {8583},
    doi       = {10.1007/978-3-319-09156-3_25},
    keywords  = {Antipatterns, Software maintainability, Empirical validation, OO design, ISO/IEC 25010, SQuaRE},
    url       = {https://link.springer.com/chapter/10.1007%2F978-3-319-09156-3_25},
}