During software evolution, inexperienced developers may introduce design anti-patterns when they modify their software systems to fix bugs or to add new functionalities based on changes in requirements. Developers may also use design patterns to promote software quality or as a possible cure for some design anti-patterns. Thus, design patterns and design anti-patterns are introduced, removed, and mutated from one another by developers. Many studies investigated the evolution of design patterns and design anti-patterns and their impact on software development. However, they investigated design patterns or design anti-patterns in isolation and did not consider their mutations and the impact of these mutations on software quality. Therefore, we report our study of bidirectional mutations between design patterns and design anti-patterns and the impacts of these mutations on software change- and fault-proneness. We analyzed snapshots of seven Java software systems with diverse sizes, evolution histories, and application domains. We built Markov models to capture the probability of occurrences of the different design patterns and design anti-patterns mutations. Results from our study show that (1) design patterns and design anti-patterns mutate into other design patterns and/or design anti-patterns. They also show that (2) some change types primarily trigger mutations of design patterns and design anti-patterns (renaming and changes to comments, declarations, and operators), and (3) some mutations of design anti-patterns and design patterns are more faulty in specific contexts. These results provide important insights into the evolution of design patterns and design anti-patterns and its impact on the change- and fault-proneness of software systems.
翻译:在软件进化期间,经验不足的开发者在修改软件系统以修补错误或根据需求变化增加新功能时,可能会采用设计反模式。开发者还可能使用设计模式来提高软件质量或作为某些设计反模式的可能的治疗方法。因此,设计模式和设计反模式被引入、删除,并被开发者相互变换。许多研究调查了设计模式和设计反模式的演变及其对软件开发的影响。然而,他们调查了设计模式或设计孤立的反模式,没有考虑到这些模式的突变和这些突变对软件质量的影响。因此,我们报告了我们关于设计模式和设计反模式之间的双向突变的研究,以及这些突变对软件变化和易误差的影响。我们分析了大小不同、进化历史和应用领域的七爪哇软件系统的近照。我们构建了Markov模型,以了解不同设计模式的发生概率,并设计反模式的反变异变情况。我们研究的结果显示:(1)设计模式和设计模式的设计模式和设计主要变换型/变型。