Using design patterns and constraints to automate the detection and correction of inter-class design defects

Developing code free of defects is a major concern for the object oriented software community. The authors classify design defects as those within classes (intra-class), those among classes (inter-classes), and those of semantic nature (behavioral). Then, we introduce guidelines to automate the detection and correction of inter-class design defects. We assume that design patterns embody good architectural solutions and that a group of entities with organization similar, but not equal, to a design pattern represents an inter-class design defect. Thus, the transformation of such a group of entities, such that its organization complies exactly with a design pattern, corresponds to the correction of an inter-class design defect. We use a meta-model to describe design patterns and we exploit the descriptions to infer sets of detection and transformation rules. A constraint solver with explanations uses the descriptions and rules to recognize groups of entities with organizations similar to the described design patterns. A transformation engine modifies the source code to comply with the recognized distorted design patterns. We apply these guidelines on the Composite pattern using PTIDEJ, our prototype tool that integrates the complete guidelines.

[1]  Tim Teitelbaum The Cornell Program Synthesizer: a syntax-directed programming environment , 1979, SIGP.

[2]  Thomas Reps,et al.  Programming Techniques and Data Structures , 1981 .

[3]  Donald E. Knuth,et al.  Literate Programming , 1984, Comput. J..

[4]  Richard C. Waters,et al.  The Programmer's Apprentice: a research overview , 1988, Computer.

[5]  Robert L. Glass,et al.  Measuring software design quality , 1990 .

[6]  Kent L. Beck,et al.  Extreme programming explained - embrace change , 1990 .

[7]  William F. Opdyke,et al.  Refactoring object-oriented frameworks , 1992 .

[8]  Ralph E. Johnson,et al.  Refactoring and Aggregation , 1993, ISOTAS.

[9]  Ralph Johnson,et al.  design patterns elements of reusable object oriented software , 2019 .

[10]  William F. Opdyke,et al.  Lifecycle and refactoring patterns that support evolution and reuse , 1995 .

[11]  Bruce F. Webster,et al.  Pitfalls of object-oriented development , 1995 .

[12]  Lutz Prechelt,et al.  Design recovery by automated search for structural design patterns in object-oriented software , 1996, Proceedings of WCRE '96: 4rd Working Conference on Reverse Engineering.

[13]  Ivan Moore,et al.  Automatic inheritance hierarchy restructuring and method refactoring , 1996, OOPSLA '96.

[14]  John M. Vlissides,et al.  Automatic Code Generation from Design Patterns , 1996, IBM Syst. J..

[15]  Arthur J. Riel,et al.  Object-Oriented Design Heuristics , 1996 .

[16]  Bernd-Uwe Pagel,et al.  Towards Pattern-based Tools , 1996 .

[17]  Kyle G. Brown,et al.  Design reverse-engineering and automated design-pattern detection in Smalltalk , 1996 .

[18]  François Laburthe,et al.  CLAIRE: Combining Objects and Rules for Problem Solving , 1996 .

[19]  Marco Meijers,et al.  Tool Support for Object-Oriented Patterns , 1997, ECOOP.

[20]  Albert Zündorf,et al.  Rewriting poor Design Patterns by good Design Patterns , 1997 .

[21]  Alexander E. Quilici,et al.  Constraint-based design recovery for software reengineering: theory and experiments , 1997 .

[22]  Ralph E. Johnson,et al.  A Refactoring Tool for Smalltalk , 1997, Theory Pract. Object Syst..

[23]  Roel Wuyts,et al.  Declarative reasoning about the structure of object-oriented systems , 1998, Proceedings. Technology of Object-Oriented Languages. TOOLS 26 (Cat. No.98EX176).

[24]  Jan Bosch,et al.  Design Patterns as Language Constructs , 1998, J. Object Oriented Program..

[25]  Emden R. Gansner,et al.  Bunch: a clustering tool for the recovery and maintenance of software system structures , 1999, Proceedings IEEE International Conference on Software Maintenance - 1999 (ICSM'99). 'Software Maintenance for Business Change' (Cat. No.99CB36360).

[26]  Gerson Sunyé Mise en uvre de patterns de conception : un outil , 1999 .

[27]  Mel Ó Cinnéide,et al.  A methodology for the automated introduction of design patterns , 1999, Proceedings IEEE International Conference on Software Maintenance - 1999 (ICSM'99). 'Software Maintenance for Business Change' (Cat. No.99CB36360).

[28]  Oliver Ciupke,et al.  Automatic detection of design problems in object-oriented reengineering , 1999, Proceedings of Technology of Object-Oriented Languages and Systems - TOOLS 30 (Cat. No.PR00278).

[29]  Frank Tip,et al.  Practical experience with an application extractor for Java , 1999, OOPSLA '99.

[30]  Stéphane Ducasse,et al.  Recovering high-level views of object-oriented applications from static and dynamic information , 1999, Proceedings IEEE International Conference on Software Maintenance - 1999 (ICSM'99). 'Software Maintenance for Business Change' (Cat. No.99CB36360).

[31]  Thierry Géraud,et al.  Generic Programming Redesign of Patterns , 2000, EuroPLoP.

[32]  Narendra Jussien,et al.  The PaLM system: explanation-based constraint programming , 2000 .

[33]  Yann-Gaël Guéhéneuc,et al.  Quelques explications pour les patrons ou une utilisation de la PPC avec explications pour l'identification de patrons de conception , 2001 .