Scalable Test Generation -- Scaffolding
Problem 1: Avoid per-function work for test scaffolding
- Scaffolding required to set appropriate state for each function
- Insight: Fewer data types than functions
- Solution: Encapsulate scaffolding in data types alone -- no per-function scaffolding.
Each test value instance has a constructor & destructor
- Constructor creates state required for a particular test value
- e.g., create a file, put data in it, open it for read, return that file handle
- Destructor cleans up any remaining state after the test
- e.g., close & delete a file that had been created by constructor
- Scaffolding based on data type regardless of function