Skip to main content
Log in

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

  • Published:
Software Quality Journal Aims and scope Submit manuscript

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5

Similar content being viewed by others

Notes

  1. We consider the concept of class extensively, including abstract classes, and interfaces.

  2. See www.ptidej.net/downloads/pmart/.

  3. We excluded local classes, i.e. classes defined in methods, because of their rarity.

  4. The ratio of misclassified false positives is (number of counter-examples in σ classified as playing a role)/(number of counter-examples in σ).

  5. The error is computed as (number of examples in σ classified as playing a role)/(size of σ).

  6. http://www.ptidej.org/downloads/experiments/SQJ09/.

  7. http://www.ptidej.net/downloads/pmart/.

References

  • 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.

  • 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.

  • Bansiya, J. (1998). Automating design-pattern identification. Dr. Dobb’s Journal. http://www.ddj.com/184410578.

  • 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.

  • Beyer, D., Noack, A., & Lewerentz, C. (2005). Efficient relational calculation for software analysis. Transactions on Software Engineering, 31(2), 137–149.

    Article  Google Scholar 

  • 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.

  • Boehm, B. (1976). Software engineering. IEEE Transactions on Computers, 25(12), 1226–1241.

    Article  MATH  Google Scholar 

  • 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.

  • 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.

  • 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.

  • Chidamber, S. R., & Kemerer, C. F. (1993). A metrics suite for object-oriented design. Technical Report E53-315, MIT Sloan School of Management.

  • 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.

  • Corbi, T. A. (1989). Program understanding: Challenge for the 1990’s. IBM Systems Journal, 28(2), 294–306.

    Article  Google Scholar 

  • 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.

  • Fabry, J., & Mens, T. (2004). Language-independent detection of object-oriented design patterns. Computer Languages, Systems, and Structures, 30(1–2), 21–33.

    Article  Google Scholar 

  • Gamma, E., & Eggenschwiler, T. (1998). JHotDraw. members.pingnet.ch/gamma/JHD-5.1.zip.

  • Gamma, E., Helm, R., Johnson, R., & Vlissides, J. (1994). Design patterns—elements of reusable object-oriented software (1st ed.). Addison-Wesley.

  • 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.

  • 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.

  • 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.

  • 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.

  • 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.

  • 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.

  • 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.

  • 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.

  • Junker, U. (2001). QUICKXPLAIN: Conflict detection for arbitrary constraint propagation algorithms. Technical report, Ilog SA.

  • 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.

  • 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.

  • 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.

  • Koskinen, J. (2004). Software maintenance costs. http://users.jyu.fi/~koskinen/smcosts.htm.

  • 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.

  • 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.

  • Lorenz, M., & Kidd, J. (1994). Object-oriented software metrics: A practical approach (1st ed.). Prentice-Hall.

  • 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.

  • Quilici, A., Yang, Q., & Woods, S. (1997). Applying plan recognition algorithms to program understanding. Journal of Automated Software Engineering, 5(3), 347–372.

    Article  Google Scholar 

  • Scheglov, K., & Shackelford, J.-M. P. (2004). Eclipse profiler. http://eclipsecolorer.sourceforge.net/index_profiler.html.

  • Schiex, T., & Verfaillie, G. (1994). Nogood recording for static and dynamic constraint satisfaction problems. International Journal of Artificial Intelligence Tools, 3(2), 187–207.

    Article  Google Scholar 

  • Spinellis, D. (2003). Code reading: The open source perspective (1st ed.). Addison Wesley.

  • 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 

  • Straw, G. B. (2004). Detecting design pattern use in software designs. Master’s thesis, Colorado State University.

  • 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.

    Article  Google Scholar 

  • Tsantalis, N., Chatzigeorgiou, A., Stephanides, G., & Halkidis, S. (2006). Design pattern detection using similarity scoring. Transactions on Software Engineering, 32(11), 896–909.

    Article  Google Scholar 

  • Wilde, N. (1994). Faster reuse and maintenance using software reconnaissance. Technical Report CSE-301, Software Engineering Research Center.

  • Witten, I. H., & Frank, E. (1999). Data mining: Practical machine learning tools and techniques with Java implementations (1st ed.). Morgan Kaufmann.

  • 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.

Download references

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.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Yann-Gaël Guéhéneuc.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Guéhéneuc, YG., Guyomarc’h, JY. & Sahraoui, H. Improving design-pattern identification: a new approach and an exploratory study. Software Qual J 18, 145–174 (2010). https://doi.org/10.1007/s11219-009-9082-y

Download citation

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11219-009-9082-y

Keywords

Navigation