Search-Based Design Defects Detection by Example

  • Marouane Kessentini
  • Houari Sahraoui
  • Mounir Boukadoum
  • Manuel Wimmer
Part of the Lecture Notes in Computer Science book series (LNCS, volume 6603)

Abstract

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.

Keywords

Design defects software quality metrics search-based software engineering by example 

References

  1. 1.
    Brown, W.J., Malveau, R.C., Brown, W.H., McCormick III, H.W., Mowbray, T.J.: Anti Patterns: Refactoring Software, Architectures, and Projects in Crisis, 1st edn. John Wiley and Sons, Chichester (March 1998)Google Scholar
  2. 2.
    Fowler, M.: Refactoring – Improving the Design of Existing Code. 1st edn. Addison-Wesley, Reading (June 1999)MATHGoogle Scholar
  3. 3.
    Fenton, N., Pfleeger, S.L.: Software Metrics: A Rigorous and Practical Approach, 2nd edn. International Thomson Computer Press, London (1997)Google Scholar
  4. 4.
    Khomh, F., Vaucher, S., Guéhéneuc, Y.-G., Sahraoui, H.: A Bayesian Approach for the Detection of Code and Design Smells. In: Proc. of the ICQS 2009 (2009)Google Scholar
  5. 5.
    Moha, N., Guéhéneuc, Y.-G., Duchien, L., Meur, A.-F.L.: DECOR: A method for the specification and detection of code and design smells. Transactions on Software Engineering (TSE), 16 pages (2009)Google Scholar
  6. 6.
    Liu, H., Yang, L., Niu, Z., Ma, Z., Shao, W.: Facilitating software refactoring with appropriate resolution order of bad smells. In: Proc. of the ESEC/FSE 2009, pp. 265–268 (2009)Google Scholar
  7. 7.
    Marinescu, R.: Detection strategies: Metrics-based rules for detecting design flaws. In: Proc. of ICM 2004, pp. 350–359 (2004)Google Scholar
  8. 8.
    Kessentini, M., Vaucher, S., Sahraoui, H.: Deviance from perfection is a better criterion than closeness to evil when identifying risky code. In: Proc. of the International Conference on Automated Software Engineering, ASE 2010 (2010)Google Scholar
  9. 9.
    Lee, K.S., Geem, Z.W.: A new meta-heuristic algorithm for continuous engineering optimization: harmony search theory and practice. Comput. Method Appl. M 194(36-38), 3902–3933 (2005)CrossRefMATHGoogle Scholar
  10. 10.
    Lee, K.S., Geem, Z.W., Lee, S.H., Bae, K.W.: The harmony search heuristic algorithm for discrete structural optimization. Eng Optimiz 37(7), 663–684 (2005)MathSciNetCrossRefGoogle Scholar
  11. 11.
  12. 12.
  13. 13.
    Riel, A.J.: Object-Oriented Design Heuristics. Addison-Wesley, Reading (1996)Google Scholar
  14. 14.
    Gaffney, J.E.: Metrics in software quality assurance. In: Proc. of the ACM 1981 Conference, pp. 126–130. ACM, New York (1981)Google Scholar
  15. 15.
    Mantyla, M., Vanhanen, J., Lassenius, C.: A taxonomy and an initial empirical study of bad smells in code. In: Proc. of ICSM 2003. IEEE Computer Society, Los Alamitos (2003)Google Scholar
  16. 16.
    Wake, W.C.: Refactoring Workbook. Addison-Wesley Longman Publishing Co., Inc., Boston (2003)Google Scholar
  17. 17.
  18. 18.
    http://www.marou ane-kessentini/FASE10.zip
  19. 19.
    Raedt, D.: Advances in Inductive Logic Programming, 1st edn. IOS Press, Amsterdam (1996)MATHGoogle Scholar
  20. 20.
    Erni, K., Lewerentz, C.: Applying design metrics to object-oriented frameworks. In: Proc. IEEE Symp. Software Metrics. IEEE Computer Society Press, Los Alamitos (1996)Google Scholar
  21. 21.
    Alikacem, H., Sahraoui, H.: Détection d’anomalies utilisant un langage de description de règle de qualité, in actes du 12e colloque LMO (2006)Google Scholar
  22. 22.
    O’Keeffe, M., Cinnéide, M.: Search-based refactoring: an empirical study. Journal of Software Maintenance 20(5), 345–364 (2008)Google Scholar
  23. 23.
    Harman, M., Clark, J.A.: Metrics are fitness functions too. In: IEEE METRICS, pp. 58–69. IEEE Computer Society Press, Los Alamitos (2004)Google Scholar
  24. 24.
    Kessentini, M., Sahraoui, H.A., Boukadoum, M.: Model Transformation as an Optimization Problem. In: Busch, C., Ober, I., Bruel, J.-M., Uhl, A., Völter, M. (eds.) MODELS 2008. LNCS, vol. 5301, pp. 159–173. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  25. 25.
    Kirkpatrick, D.S., Gelatt, Jr., Vecchi, M.P.: Optimization by simulated annealing. Science 220(4598), 671680 (1983)MathSciNetCrossRefMATHGoogle Scholar
  26. 26.
    Eberhart, R.C., Shi, Y.: Particle swarm optimization: developments, applications and resources. In: Proc. IEEE Congress on Evolutionary Computation (CEC 2001), pp. 81–86 (2001)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2011

Authors and Affiliations

  • Marouane Kessentini
    • 1
  • Houari Sahraoui
    • 1
  • Mounir Boukadoum
    • 2
  • Manuel Wimmer
    • 3
  1. 1.DIROUniversité de MontréalCanada
  2. 2.DIUniversité du Québec à MontréalCanada
  3. 3.Vienna University of TechnologyAustria

Personalised recommendations