Advertisement

Software Quality Journal

, Volume 18, Issue 1, pp 145–174 | Cite as

Improving design-pattern identification: a new approach and an exploratory study

  • Yann-Gaël Guéhéneuc
  • Jean-Yves Guyomarc’h
  • Houari Sahraoui
Article

Abstract

The identification of occurrences of design patterns in programs can help maintainers to understand the program design and implementation. It can also help them to make informed changes. Current identification approaches are limited to complete occurrences, are time- and resource-consuming, and lead to many false positives. We propose to combine a structural and a numerical approach to improve the identification of complete and incomplete occurrences of design patterns. We develop a structural approach using explanation-based constraint programming and we enhance this approach using experimentally built numerical signatures. We show that the use of numerical signatures improves the identification of complete and incomplete occurrences in terms of performance and precision.

Keywords

Program understanding Design patterns Explanation-based constraint programming Metrics Exploratory study 

Notes

Acknowledgements

We thank James Bieman, Greg Straw, Huxia Wang, P. Willard, and Roger T. Alexander (2003) for kindly sharing their data. We are grateful to our students, Saliha Bouden, Janice Ka-Yee Ng, Nawfal Chraibi, Duc-Loc Huynh, and Taleb Ikbal, who helped in the creation of the repository. We are indebt with Neil Stewart for his kind helpful comments.

References

  1. Albin-Amiot, H., Cointe, P., Guéhéneuc, Y.-G., & Jussien, N. (2001). Instantiating and detecting design patterns: Putting bits and pieces together. In D. Richardson, M. Feather, & M. Goedicke (Eds.), Proceedings of the 16th conference on automated software engineering (ASE), November 2001 (pp. 166–173). IEEE Computer Society Press.Google Scholar
  2. Antoniol, G., Fiutem, R., & Cristoforetti, L. (1998). Design pattern recovery in object-oriented software. In S. Tilley & G. Visaggio (Eds.), Proceedings of the 6th international workshop on program comprehension (pp. 153–160). IEEE Computer Society Press.Google Scholar
  3. Bansiya, J. (1998). Automating design-pattern identification. Dr. Dobb’s Journal. http://www.ddj.com/184410578.
  4. Bayardo, R. J. Jr., & Miranker, D. P. (1996). A complexity analysis of space-bounded learning algorithms for the constraint satisfaction problem. In D. Weld & B. Clancey (Eds.), Proceedings of the 13th national conference on artificial intelligence (pp. 298–304). AAAI Press, The MIT Press.Google Scholar
  5. Beyer, D., Noack, A., & Lewerentz, C. (2005). Efficient relational calculation for software analysis. Transactions on Software Engineering, 31(2), 137–149.CrossRefGoogle Scholar
  6. Bieman, J., Straw, G., Wang, H., Munger, P. W., & Alexander, R. T. (2003). Design patterns and change proneness: An examination of five evolving systems. In M. Berry & W. Harrison (Eds.), Proceedings of the 9th international software metrics symposium (pp. 40–49). IEEE Computer Society Press.Google Scholar
  7. Boehm, B. (1976). Software engineering. IEEE Transactions on Computers, 25(12), 1226–1241.zbMATHCrossRefGoogle Scholar
  8. Briand, L., Devanbu, P., & Melo, W. (1997a). An investigation into coupling measures for C++. In Adrion W. R. (Ed.), Proceedings of the 19th international conference on software engineering (pp. 412–421). ACM Press.Google Scholar
  9. Briand, L. C., Daly, J. W., & Wüst, J. K. (1997b). A unified framework for cohesion measurement. In S. L. Pfleeger & L. Ott (Eds.), Proceedings of the 4th international software metrics symposium (pp. 43–53). IEEE Computer Society Press.Google Scholar
  10. Brown, K. (1996). Design reverse-engineering and automated design pattern detection in Smalltalk. Technical Report TR-96-07, Department of Computer Science, University of Illinois at Urbana-Champaign.Google Scholar
  11. Chidamber, S. R., & Kemerer, C. F. (1993). A metrics suite for object-oriented design. Technical Report E53-315, MIT Sloan School of Management.Google Scholar
  12. Ciupke, O. (1999). Automatic detection of design problems in object-oriented reengineering. In D. Firesmith (Ed.), Proceeding of 30th conference on technology of object-oriented languages and systems (pp.18–32). IEEE Computer Society Press.Google Scholar
  13. Corbi, T. A. (1989). Program understanding: Challenge for the 1990’s. IBM Systems Journal, 28(2), 294–306.CrossRefGoogle Scholar
  14. Eppstein, D. (1995). Subgraph isomorphism in planar graphs and related problems. In K. Clarkson (Ed.), Proceedings of the 6th annual symposium on discrete algorithms (pp. 632–640). ACM Press.Google Scholar
  15. Fabry, J., & Mens, T. (2004). Language-independent detection of object-oriented design patterns. Computer Languages, Systems, and Structures, 30(1–2), 21–33.CrossRefGoogle Scholar
  16. Gamma, E., & Eggenschwiler, T. (1998). JHotDraw. members.pingnet.ch/gamma/JHD-5.1.zip.
  17. Gamma, E., Helm, R., Johnson, R., & Vlissides, J. (1994). Design patterns—elements of reusable object-oriented software (1st ed.). Addison-Wesley.Google Scholar
  18. Guéhéneuc, Y.-G., & Albin-Amiot, H. (2001). Using design patterns and constraints to automate the detection and correction of inter-class design defects. In Q. Li, R. Riehle, G. Pour, & B. Meyer (Eds.), Proceedings of the 39th conference on the technology of object-oriented languages and systems (TOOLS USA) (pp. 296–305). IEEE Computer Society Press.Google Scholar
  19. Guéhéneuc, Y.-G., & Albin-Amiot, H. (2004). Recovering binary class relationships: Putting icing on the UML cake. In D. C. Schmidt (Ed.), Proceedings of the 19th conference on object-oriented programming, systems, languages, and applications (OOPSLA) (pp. 301–314). ACM Press.Google Scholar
  20. Guéhéneuc, Y.-G., & Antoniol, G. (2008). DeMIMA: A multi-layered framework for design pattern identification. Transactions on Software Engineering (TSE), 34(5), 667–684.Google Scholar
  21. Guéhéneuc, Y.-G., & Jussien, N. (2001). Using explanations for design-patterns identification. In C. Bessière (Ed.), Proceedings of the 1st IJCAI workshop on modeling and solving problems with constraints (pp 57–64). AAAI Press.Google Scholar
  22. Guéhéneuc, Y.-G., Sahraoui, H., & Zaidi, F. (2004). Fingerprinting design patterns. In E. Stroulia & A. de Lucia, (Eds.), Proceedings of the 11th working conference on reverse engineering (WCRE) (pp.172–181). IEEE Computer Society Press.Google Scholar
  23. Heuzeroth, D., Holl, T., & Löwe, W. (2002). Combining static and dynamic analyses to detect interaction patterns. In H. Ehrig, B. J. Krämer, & A. Ertas (Eds.), Proceedings the 6th world conference on integrated design and process technology. Society for Design and Process Science.Google Scholar
  24. Hitz, M., & Montazeri, B. (1995). Measuring coupling and cohesion in object-oriented systems. In Proceedings of the 3rd intermational symposium on applied corporate computing (pp. 25–27). Texas A&M University.Google Scholar
  25. Jahnke, J. H., & Zündorf, A. (1997). Rewriting poor design patterns by good design patterns. In S. Demeyer & H. C. Gall (Eds.), Proceedings the 1st ESEC/FSE workshop on object-oriented reengineering. Distributed Systems Group, Technical University of Vienna. TUV-1841-97-10.Google Scholar
  26. Junker, U. (2001). QUICKXPLAIN: Conflict detection for arbitrary constraint propagation algorithms. Technical report, Ilog SA.Google Scholar
  27. Jussien, N., & Barichard, V. (2000). The PaLM system: Explanation-based constraint programming. In N. Beldiceanu, W. Harvey, M. Henz, F. Laburthe, E. Monfroy, T. Müller, L. Perron, & C. Schulte (Eds.), Proceedings of TRICS: Techniques for implementing constraint programming systems (pp. 118–133). School of Computing, National University of Singapore, Singapore. TRA9/00.Google Scholar
  28. Keller, R. K., Schauer, R., Robitaille, S., & Pagé, P. (1999). Pattern-based reverse-engineering of design components. In D. Garlan & J. Kramer (Eds.), Proceedings of the 21st international conference on software engineering (pp. 226–235). ACM Press.Google Scholar
  29. Kohavi, R. (1995). A study of cross-validation and bootstrap for accuracy estimation and model selection. In Proceedings of the 14th international joint conference on artificial intelligence (pp. 1137–1145). Morgan Kaufmann.Google Scholar
  30. Koskinen, J. (2004). Software maintenance costs. http://users.jyu.fi/~koskinen/smcosts.htm.
  31. Krämer, C., & Prechelt, L. (1996). Design recovery by automated search for structural design patterns in object-oriented software. In L. M. Wills & I. Baxter (Eds.), Proceedings of the 3rd working conference on reverse engineering (pp. 208–215). IEEE Computer Society Press.Google Scholar
  32. Labuthe, F. (2000). Choco: Implementing a CP kernel. In N. Beldiceanu (Ed.), Proceedings of the 1st workshop on techniques for implementing constraint programming systems, CP’00 at Singapore.Google Scholar
  33. Lorenz, M., & Kidd, J. (1994). Object-oriented software metrics: A practical approach (1st ed.). Prentice-Hall.Google Scholar
  34. Ng, K.-Y., & Guéhéneuc, Y.-G. (2007). Identification of behavioral and creational design patterns through dynamic analysis. In A. Zaidman, A. Hamou-Lhadj, & O. Greevy (Eds.), Proceedings of the 3rd international workshop on program comprehension through dynamic analysis (PCODA) (pp. 34–42). Delft University of Technology. TUD-SERG-2007-022.Google Scholar
  35. Quilici, A., Yang, Q., & Woods, S. (1997). Applying plan recognition algorithms to program understanding. Journal of Automated Software Engineering, 5(3), 347–372.CrossRefGoogle Scholar
  36. Scheglov, K., & Shackelford, J.-M. P. (2004). Eclipse profiler. http://eclipsecolorer.sourceforge.net/index_profiler.html.
  37. Schiex, T., & Verfaillie, G. (1994). Nogood recording for static and dynamic constraint satisfaction problems. International Journal of Artificial Intelligence Tools, 3(2), 187–207.CrossRefGoogle Scholar
  38. Spinellis, D. (2003). Code reading: The open source perspective (1st ed.). Addison Wesley.Google Scholar
  39. Stone, M. (1974). Cross-validatory choice and assessment of statistical predictions. Journal of the Royal Statistical Society Series B: Statistical Methodology, 36, 111–147.Google Scholar
  40. Straw, G. B. (2004). Detecting design pattern use in software designs. Master’s thesis, Colorado State University.Google Scholar
  41. Tegarden, D. P., Sheetz, S. D., & Monarchi, D. E. (1995). A software complexity model of object-oriented systems. Decision Support Systems, 13(3–4), 241–262.CrossRefGoogle Scholar
  42. Tsantalis, N., Chatzigeorgiou, A., Stephanides, G., & Halkidis, S. (2006). Design pattern detection using similarity scoring. Transactions on Software Engineering, 32(11), 896–909.CrossRefGoogle Scholar
  43. Wilde, N. (1994). Faster reuse and maintenance using software reconnaissance. Technical Report CSE-301, Software Engineering Research Center.Google Scholar
  44. Witten, I. H., & Frank, E. (1999). Data mining: Practical machine learning tools and techniques with Java implementations (1st ed.). Morgan Kaufmann.Google Scholar
  45. Wuyts, R. (1998). Declarative reasoning about the structure of object-oriented systems. In J. Gil (Ed.), Proceedings of the 26th conference on the technology of object-oriented languages and systems (pp. 112–124). IEEE Computer Society Press.Google Scholar

Copyright information

© Springer Science+Business Media, LLC 2009

Authors and Affiliations

  • Yann-Gaël Guéhéneuc
    • 1
  • Jean-Yves Guyomarc’h
    • 2
  • Houari Sahraoui
    • 2
  1. 1.Ptidej Team, École Polytechnique de MontréalMontréalCanada
  2. 2.GEODES, DIRO, Université de MontréalMontréalCanada

Personalised recommendations