Search-Based Design Defects Detection by Example

We propose an automated approach to detect various types of design defects in source code. Our approach allows to automatically find detection rules, thus relieving the designer from doing so manually. Rules are defined as combinations of metrics/thresholds that better conform to known instances of design defects (defect examples). In our setting, we use and compare between different heuristic search algorithms for rule extraction: Harmony Search, Particle Swarm Optimization, and Simulated Annealing. We evaluate our approach by finding potential defects in two open-source systems. For all these systems, we found, in average, more than 75% of known defects, a better result when compared to a state-of-the-art approach, where the detection rules are manually or semi-automatically specified.

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

[2]  Cemal Yilmaz,et al.  Software Metrics , 2008, Wiley Encyclopedia of Computer Science and Engineering.

[3]  John E. Gaffney,et al.  Metrics in software quality assurance , 1981, ACM '81.

[4]  Shari Lawrence Pfleeger,et al.  Software metrics (2nd ed.): a rigorous and practical approach , 1997 .

[5]  K. Lee,et al.  A new meta-heuristic algorithm for continuous engineering optimization: harmony search theory and practice , 2005 .

[6]  De Raedt,et al.  Advances in Inductive Logic Programming , 1996 .

[7]  Zhendong Niu,et al.  Facilitating software refactoring with appropriate resolution order of bad smells , 2009, ESEC/FSE '09.

[8]  Shari Lawrence Pfleeger,et al.  Software Metrics : A Rigorous and Practical Approach , 1998 .

[9]  Yann-Gaël Guéhéneuc,et al.  DECOR: A Method for the Specification and Detection of Code and Design Smells , 2010, IEEE Transactions on Software Engineering.

[10]  Mel Ó Cinnéide,et al.  Search-based refactoring: an empirical study , 2008 .

[11]  Houari A. Sahraoui,et al.  Détection d'anomalies utilisant un langage de règle de qualité , 2006, LMO.

[12]  K. Lee,et al.  The harmony search heuristic algorithm for discrete structural optimization , 2005 .

[13]  Yuhui Shi,et al.  Particle swarm optimization: developments, applications and resources , 2001, Proceedings of the 2001 Congress on Evolutionary Computation (IEEE Cat. No.01TH8546).

[14]  John A. Clark,et al.  Metrics are fitness functions too , 2004 .

[15]  Claus Lewerentz,et al.  Applying design-metrics to object-oriented frameworks , 1996, Proceedings of the 3rd International Software Metrics Symposium.

[16]  Houari A. Sahraoui,et al.  Deviance from perfection is a better criterion than closeness to evil when identifying risky code , 2010, ASE.

[17]  Thomas J. Mowbray,et al.  AntiPatterns: Refactoring Software, Architectures, and Projects in Crisis , 1998 .

[18]  H. Sahraoui,et al.  Model Transformation as an Optimization Problem , 2008, MoDELS.

[19]  C. D. Gelatt,et al.  Optimization by Simulated Annealing , 1983, Science.

[20]  Radu Marinescu,et al.  Detection strategies: metrics-based rules for detecting design flaws , 2004, 20th IEEE International Conference on Software Maintenance, 2004. Proceedings..

[21]  Kevin Lano,et al.  Slicing of UML models using model transformations , 2010, MODELS'10.

[22]  Martin Fowler,et al.  Refactoring - Improving the Design of Existing Code , 1999, Addison Wesley object technology series.

[23]  William C. Wake,et al.  Refactoring Workbook , 2003 .

[24]  Foutse Khomh,et al.  A Bayesian Approach for the Detection of Code and Design Smells , 2009, 2009 Ninth International Conference on Quality Software.

[25]  Mika Mäntylä,et al.  A taxonomy and an initial empirical study of bad smells in code , 2003, International Conference on Software Maintenance, 2003. ICSM 2003. Proceedings..