chapter fourteen

14 Prop cupboard patterns for managing input test data

 

This chapter covers

  • Promoting consistency and improve maintainability of default data
  • Creating simple default objects and object hierarchies
  • Customizing complicated default objects and object hierarchies using builders
  • Centralizing support for handling the use of domain-specific terminology in specifications
  • Simplifying automation code interactions with data tables
  • Comparing two data tables using an atomic assertion without loss of diagnostic information
  • Clarifying the specification and testing of complicated data validations

The patterns described in this chapter simplify the management of input test data, and are primarily used for providing the entities that populate a scenario’s context. In the movies and the theatre these sorts of objects are called “props”. The prop cupboard is where the props are kept until they are needed for a scene (or a scenario), so we call this the Prop Cupboard pattern language:

14.1 Domain Default pattern for managing default test data

14.2 Default instance pattern: use defaults, but…

14.3 Object Mother pattern: generate complicated test data structures

14.4 Terminology Promotion pattern: expressing domain-specific data

14.5 Data Table Accessor pattern: handling data table parameters

14.6 Data Table Assertion pattern: asserting with data tables

14.7 Validation Tester pattern: specifying and automating data validation

14.8 Summary