This document provides guidance on effectively managing test data for software testing. It discusses 6 approaches to preparing test data: 1) using the user interface, 2) inserting data via API calls, 3) direct SQL insertion into the database, 4) using data sets with DBUnit, 5) versioned data dumps, and 6) reusing production data. The key recommendations are to choose the approach that best fits the system under test, speed up test data management with APIs, reuse live data when possible, and mix strategies as needed to build reliable test cases.
6. Data independency as performance driver
• Most dependencies are data related
• Dependent tests = no parallel execution
• Data should be test specific with no reuse
• Use small focused datasets
24. Additional level of data abstraction
Great tools around DBUnit
Suitable format
Whitebox
Support and sync
Small datasets
Caching
Flexible constraints
26. Support DUMPs for different suites
/serviceA/dump/smoke/v50/data.tar.gz
/serviceA/dump/smoke/v51/data.tar.gz
/serviceA/schema/v51/db.jar
/serviceA/dump/regression/v50/data.tar.gz
/serviceA/dump/regression/v51/data.tar.gz
28. DB Object Pools
• DB instance
• Heavy domain objects
• Available data roots
29. Version your test data with schema
Direct data access
Quick
Unclear
Required skills
DUMP preparation via UI
Infrastructure support
Artifact repository
30. If your live system
produces data, it
can be used for
testing
31. #6. Production data DUMP
SYSTEM
DB
QUEUE
UI
API
EXTERNAL
SERVICES
API CONTRACTS
#6. LIVE DATA
32. Real data is always better for testing
Live data
No preparation
Large
Permissions
More realistic cases
Security
33. Summary
• Use UI for test data if the system is black box for you
• Speed up you test data management with API calls
• Put data directly in DB if system is white box for you
• Actively use Docker to prepare test DB images
• Reuse live data if possible for complex systems
• Mix approaches to fill test DB and store dumps to build
Docker images
• Be happy unicorn in the rainbow world ;)
34.
35. It is not an easy
task to create
reliable tests, try
hard and know
your tools