A methodology to assess the impact of design patterns on software quality
Introduction
Object oriented design patterns have been introduced in mid 1990s as a catalog of common solutions to common design problems, and are considered as standard of “good” software designs [31]. The notion of patterns was firstly introduced by Alexander et al. [2] in the field of architecture. Later the notion of patterns has been transformed in order to fit software design by Gamma, Helm, Johnson and Vlissides (GoF) [31]. The authors cataloged 23 design patterns, classified according to two criteria. The first, i.e. purpose, represents the motivation of the pattern. Under this scope patterns are divided into creational, structural and behavioral patterns. The second criterion, i.e. scope, defines whether the pattern is applied on object or class level. In [31], the authors suggest that using specific software design solutions, i.e. design patterns, provide easier maintainability and reusability, more understandable implementation and more flexible design. At this point it is necessary to clarify GoF are not the first or the only design patterns in software literature. Some other well known patterns are architectural patterns, computational patterns, game design patterns, etc. In recent years, many researchers have attempted to evaluate the effect of GoF design patterns on software quality. Reviewing the literature on the effects of design pattern application on software quality provides controversial results. Until now, researchers attempted to investigate the outcome of design patterns with respect to software quality through empirical methods, i.e. case studies, surveys and experiments, but safe conclusions cannot be drawn since the results lead to different directions. As mentioned in [37], [39], [53], [59], [69], design patterns propose elaborate design solutions to common design problems that can be implemented with simpler solutions as well.
In this paper we propose a methodology for comparing pattern designs. The proposed method is analytical in the sense that system comparison is not performed on specific system instances, but on design motifs that can describe every possible instance of a system during its extension. The methodology is generic so that it can be applied for comparing design alternatives that describe equivalent functionality and have specified axes of change. The proposed method attempts to formulate several quality attributes as functions of functionality addition on multiple, equivalent solutions to a design problem. Then the functions are compared so as to identify cut-off points during system maintenance when one solution gets better or worse than the other. In this study we illustrate the applicability of the methodology by employing it for comparing GoF design patterns to equivalent adhoc solutions. In the next section, we present background information on design patterns. In Section 3, the methodology is presented and in Section 4, three exploratory cases are demonstrated. A discussion on the methodology is presented in Section 5. Conclusions, threats to validity and future work are presented by the end of the paper.
Section snippets
Related work
In this section of the paper, previous scientific research related to design patterns is presented. More specifically, the section is organized into paragraphs concerning indications on pattern identification according to metric scores, qualitative evaluation of pattern employment, quantitative evaluation of pattern employment, discussion on pattern application and class change proneness, results of controlled experiments on the comparison of design pattern application versus simpler solutions
Methodology
This paper is inspired by the work of Hsueh et al. [38] and Huston [39]. Our methodology can be used to compare design patterns and alternative design solutions of equivalent functionality, during system extension. The method of our paper can be summarized in the following steps:
Prerequisite: Suppose a design problem that can be treated with a pattern.
- 1.
Catalog alternative design solutions from literature, open-source solutions and personal experiences.
- 2.
Identify the major axes of change for the
Methodology illustration
As illustrative examples of using the proposed method, we investigate six research questions, evaluating design patterns w.r.t. various quality aspects. The research questions are listed below:
[RQ1]Which is the effect of employing an instance of the bridge pattern on the maintainability of a system?
[RQ2] Which is the effect of employing an instance of the abstract factory pattern on the maintainability of a system?
[RQ3] Which is the effect of employing an instance of the bridge pattern on the
Discussion
This section discusses our analytical methodology and the findings of our work concerning the research questions stated in Section 4. The results that are presented in this paper can be used in various ways. First of all, the mathematical formulas that have been extracted can be used for goal driven decision making. Our study suggests that if a designer is about to apply a pattern, he/she should firstly estimate the number of classes that his system will probably use, then should select the
Threats to validity
This section of the paper discusses possible threats to the validity of the paper. Firstly, even though the analytical method employed in the metric comparison ensures the accuracy of the procedure, the results on three design patterns cannot be generalized to the rest of the 23 design patterns that are described in [31], or any other type of design pattern. Another threat to the validity of the study is the fact that we have considered only two adhoc solutions. We have tried to adopt
Future work
Thus, future work includes a replication of the research with a wider variety of patterns and design alternatives. Additionally, we plan to replicate the methodology by using a quality model that uses code metrics and extends the systems with more ways as described in [56]. Moreover, future work plans also involve the conversion of the DesignPAD tool into an Eclipse plug-in that will automatically receive size information from an already implemented pattern or alternative solution and confirm
Conclusions
Concluding, this paper suggested a methodology for exploring designs where design patterns have been implemented, through the mathematical formulation of the relation between design pattern characteristics and well known metrics, and the identification of thresholds for which one design becomes more preferable than another. This approach can assist goal oriented decision making, since it is expected that every design problem demands a specific solution, according to its special needs with
References (80)
- P.S.C. Alencar, D.D. Cowan, J. Dong, C.J.P. de Lucena, A pattern-based approach to structural design composition, 23rd...
- et al.
A Pattern Language – Town, Buildings, Construction
(1977) - H. Albin-Amiot, P. Cointe, Y.-G. Gueheneuc, N. Jussien, Instantiating and detecting design patterns: putting bits and...
- A. Ampatzoglou, A. Chatigeorgiou, “Evaluation of object-oriented design patterns in game development”, Information and...
- G. Antoniol, R. Fiutem, L. Cristoforetti, Using metrics toidentify design patterns in object-oriented software, IEEE...
- F. Arcelli, S. Spinelli, Impact of refactoring on quality code evaluation, Proceeding of the 4th workshop on...
- E.L.A. Baniassad, G.C. Murphy, C. Schwanninger, Design pattern rationale graphs: linking design to source, Proceedings...
- et al.
A hierarchical model for object-oriented design quality assessment
IEEE Transaction on Software Engineering
(2002) - et al.
Formal specification of the variants and behavioural features of design patterns
Journal of Systems and Software
(2010) - I. Bayley, H. Zhu, Specifying behavioural features of design patterns in first order logic, Proceedings of the 32nd...
An empirical investigation of an object-oriented software system
IEEE Transaction on Software Engineering
Object-Oriented Design: UML, Principles, Patterns and Heuristics
A metrics suite for object oriented design
IEEE Transactions on Software Engineering
Managerial use of metrics for object oriented software: an exploratory analysis
IEEE Transactions on Software Engineering
The structural complexity of software: an experimental test
IEEE Transactions on Software Engineering
Adding pattern related information in structural and behavioural diagrams
Information and Software Technology
Visualizing design patterns in their applications and compositions
IEEE Transactions on Software Engineering
A UML-based pattern specification technique
IEEE Transactions on Software Engineering
Design Patterns: Elements of Reusable Object-Oriented Software
Improving design pattern identification: a new approach and an exploratory study
Software Quality Journal
Coupling, cohesion: towards a valid metrics suite for object-oriented analysis and design
Object-Oriented Systems
Object-oriented design: a goal driven and pattern based approach
Software and Systems Modeling
A quantitative approach for evaluating the quality of design patterns
Journal of Systems and Software
The effects of design pattern application on metric scores
Journal of Systems and Software
Cited by (48)
High assurance software architecture and design
2022, System Assurances: Modeling and ManagementWhat can violations of good practices tell about the relationship between GoF patterns and run-time quality attributes?
2019, Information and Software TechnologyCitation Excerpt :Finally, this study assumes that PP classes in the dataset contribute to pattern instances that are correctly implemented. A pattern implementation might not be the correct one, due to either a programming mistake or pattern grime [55], or because the deployed pattern is not the optimal way to solve the underlying problem considering that the effect of a pattern on quality is affected by different factors [56]. This poses a threat to construct validity.
Efficiently detecting structural design pattern instances based on ordered sequences
2018, Journal of Systems and SoftwareCitation Excerpt :Design patterns, proposed by GoF (Gang of Four: Gamma, Helms, Johnson and Vlisides), are meant to solve recurring design problems in object-oriented software systems, so as to improve the reusability, maintainability, comprehensibility, evolvability, and robustness of applications (Gamma et al., 1995). Although design patterns are not universally good or bad, they typically improve certain aspects of software quality if chosen wisely (Zhang and Budgen, 2012; Ampatzoglou et al., 2012). According to the definitions of GoF, design patterns can be classified as creational, which address object instantiation issues, structural, which concentrate on object composition and relations among the run-time object structures, and behavioural, which focus on the internal dynamics and object interaction in the system (DeLucia et al., 2010b).
Understanding the impact of cloud patterns on performance and energy consumption
2018, Journal of Systems and SoftwareCitation Excerpt :Cloud patterns, which are general and reusable solutions to recurring design problems, have been proposed as best practices to guide developers during the development of cloud-based applications. Although previous works such as Hecht et al. (2014) and Ampatzoglou et al. (2012) have shown that patterns can improve the QoS of cloud based applications, their impact on energy consumption is still unknown. Several works in the literature have assessed the impact of design patterns on software quality (Khomh and Guéhéneuc, 2008), software maintenance (Vokáč et al., 2004) and code complexity (Prechelt et al., 2001).
From Longitudinal Measurements to Image Classification: Application to Longitudinal MRI in Alzheimer’s Disease
2024, Lecture Notes in Networks and SystemsComparing Word-Based and AST-Based Models for Design Pattern Recognition
2023, ACM International Conference Proceeding Series