What can violations of good practices tell about the relationship between GoF patterns and run-time quality attributes?Feitosa, D., Ampatzoglou, A., Avgeriou, P., Chatzigeorgiou, A. & Nakagawa, E. Y., Jan-2019, In : Information and Software Technology. 105, p. 1-16 16 p.
Research output: Contribution to journal › Article › Academic › peer-review
Context GoF patterns have been extensively studied with respect to the benefit they provide as problem-solving, communication and quality improvement mechanisms. The latter has been mostly investigated through empirical studies, but some aspects of quality (esp. run-time ones) are still under-investigated. Objective In this paper, we study if the presence of patterns enforces the conformance to good coding practices. To achieve this goal, we explore the relationship between the presence of GoF design patterns and violations of good practices related to source code correctness, performance and security, via static analysis. Method Specifically, we exploit static analysis so as to investigate whether the number of violations of good coding practices identified on classes is related to: (a) their participation in pattern occurrences, (b) the pattern category, (c) the pattern in which they participate, and (d) their role within the pattern occurrence. To answer these questions, we performed a case study on approximately 13,000 classes retrieved from five open-source projects. Results The obtained results suggest that classes not participating in patterns are more probable to violate good coding practices for correctness, performance and security. In a more fine-grained level of analysis, by focusing on specific patterns, we observed that patterns with more complex structure (e.g., Decorator) and pattern roles that are more change-prone (e.g., Subclasses) are more likely to be associated with a higher number of violations (up to 50 times more violations). Conclusion This finding implies that investing in a well-thought architecture based on best practices, such as patterns, is often accompanied with cleaner code with fewer violations.
|Number of pages||16|
|Journal||Information and Software Technology|
|Publication status||Published - Jan-2019|
- Software architecture, GoF patterns, Design, Quality analysis, Evaluation, OF-THE-ART, DESIGN PATTERNS, STATIC ANALYSIS, ROLES