Abstract
Design patterns are used extensively in the design of software systems. Patterns codify effective solutions for recurring design problems and allow software engineers to reuse these solutions, tailoring them appropriately to their particular applications, rather than reinventing them from scratch. In this paper, we consider the following question: How can system designers and implementers test whether their systems, as implemented, are faithful to the requirements of the patterns used in their design? A key consideration underlying our work is that the testing approach should enable us, in testing whether a particular pattern P has been correctly implemented in different systems designed using P, to reuse the common parts of this effort rather than having to do it from scratch for each system. Thus in the approach we present, corresponding to each pattern P, there is a set of pattern test case templates (PTCTs). A PTCT codifies a reusable test case structure designed to identify defects associated with applications of P in all systems designed using P. Next we present a process using which, given a system designed using P, the system tester can generate a test suite from the PTCTs for P that can be used to test the particular system for bugs in the implementation of P in that system. This allows the tester to tailor the PTCTs for P to the needs of the particular system by specifying a set of specialization rules that are designed to reflect the scenarios in which the defects codified in this set of PTCTs are likely to manifest themselves in the particular system. We illustrate the approach using the Observer pattern.
Similar content being viewed by others
References
Baudry B, Le Sunyé Y, Jézéquel J (2001) Towards a ‘safe’ use of design patterns to improve OO software testability. In: The 12th international symposium on software reliability engineering, IEEE Computer Society, Washington, DC, pp 324–329
Beck K and Gamma E (1998). Test infected: programmers love writing tests. Java Rep 3(7): 37–50
Binder R (1999). Testing object-oriented systems. Addison-Wesley, Menlo Park
Buschmann F, Meunier R, Rohnert H, Sommerlad P and Stal M (1996). Pattern-oriented software architecture: a system of patterns. Wiley, New York
Chandy K and Misra J (1988). Parallel program design. Addison-Wesley, Menlo Park
Dasiewicz P (2005) Design patterns and object-oriented software testing. In: The 2005 Canadian conference on electrical and computer engineering, IEEE Canada, Dundas
Dong J (2002) UML extenstions for design pattern compositions. In: Mingins C (ed) Proceedings of TOOLS, in special issue of journal of object technology, vol 1, issue 3, pp 149–161
Dong J, Alencar P, Cowan D (2001) A behavioral analysis approach to pattern-based composition. In: Proceedings of the 7th international conference on object-oriented information systems, Springer, pp 540–549
Eden A (2001) Formal specification of object-oriented design. In: Proceedings of the international conference on multidisciplinary design in engineering
Eden A (2002) LePUS: a visual formalism for object-oriented architectures. In: Proceedings of the 6th world conference on integrated design and process technology, IEEE Computer Society, pp 149–159
Gamma E, Helm R, Johnson R and Vlissides J (1995). Design patterns: elements of Reusable OO Software. Addison-Wesley, Menlo Park
Hallstrom J, Soundarajan N, Tyler B (2006) Amplifying the benefits of design patterns. In: Aagedal J, Baresi L (eds) Proceedings of the 9th international conference on fundamental approaches to software engineering (FASE), Springer, pp 214–229
Helm R, Holland I, Gangopadhyay D (1990) Contracts: specifying behavioral compositions in object-oriented systems. In: OOPSLA-ECOOP, pp 169–180
Järvinen H, Kurki-Suonio R (1991) Disco specification language: marriage of actions and objects. In: Proceedings of the 11th international conference on distributed computing systems, IEEE Computer Society, Los Alamitos, pp 142–151
Jones C (1990). Systematic software development using VDM. Prentice-Hall, Englewood Cliffs, New York
Marick B (2007 (date of last access)) Test patterns repository/ software testing patterns. http://www.testing.com/test-patterns/patterns/
McGregor J (1999). Testpatterns: please stand by. J Object-oriented Program 12: 14–19
McGregor J and Sykes D (2001). A practical guide to testing object-oriented software. Addison-Wesley, Menlo Park
Mikkonen T (1998) Formalizing design patterns. In: Proceedings of 20th ICSE, IEEE Computer Society Press, pp 115–124
Rainsberger J (2005) JUnit recipes. Manning
Reenskaug T (1996). Working with objects. Prentice-Hall, Englewood Cliffs
Reimer D, Schonberg E, Srinivas K, Srinivasan H, Alpern B, Johnson R, Kershenbaum A, Koved L (2004) “saber”: smart analysis based error reduction. In: Proceedings of “ISSTA ’04”, ACM Press, pp 243–251
Riehle D (1997) Composite design patterns. In: Proceedings of OOPSLA, ACM, pp 218–228
Schmidt D, Stal M, Rohnert H and Buschmann F (1996). Pattern-oriented software architecture: patterns for concurrent and networked objects. Wiley, New York
Shalloway A and Trott J (2002). Design patterns explained. Addison-Wesley, Menlo Park
Soundarajan N, Hallstrom J (2004) Responsibilities and rewards: specifying design patterns. In: Finkelstein A, Estublier J, Rosenblum D (eds) Proceedings of 26th international conference on software engineering (ICSE), IEEE Computer Society, pp 666–675
Soundarajan N, Hallstrom J (2006) Pattern-based system evolution: a case-study. In: Zhang K, Spanoudakis G, Visaggio G (eds) Proceedings of 18th international conference on software engineering and knowledge engineering (SEKE 2006), Knowledge Systems Institute, pp 321–326
Testing (2001) Patterns of software testing 1
Testing (2001) Patterns of software testing 2
Testing (2001) Patterns of software testing 3
Tyler B, Hallstrom J, Soundarajan N (2006) A comparative study of monitoring tools for pattern-centric behavior. In: Hinchey M (ed) Procedings of 30th IEEE/NASA sofware engineering workshop (SEW-30), IEEE-Computer Society
Vlissides J (1998) Notation, notation, notation. C++ Report
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Soundarajan, N., Hallstrom, J.O., Shu, G. et al. Patterns: from system design to software testing. Innovations Syst Softw Eng 4, 71–85 (2008). https://doi.org/10.1007/s11334-007-0042-z
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11334-007-0042-z