Database Testing Checklist
Your database is the foundation your entire app is built on. AI-generated database code often has missing indexes, incorrect relationships, and no migration strategy. This checklist ensures your data layer is solid, performant, and recoverable.
Last updated: 2026-03-14
Data Integrity
Foreign key relationships are enforced
Attempt to create records with invalid foreign keys and verify the database rejects them rather than creating orphaned data.
Unique constraints prevent duplicate data
Attempt to insert duplicate values in uniquely constrained columns and verify the operation fails with a clear error.
Required fields cannot be null
Try inserting records with null values in required columns and verify the database enforces NOT NULL constraints.
Cascade deletes work correctly
Delete a parent record and verify that related child records are handled correctly, either cascaded or prevented.
Data types match the stored values
Verify that dates store as dates, numbers as numbers, and that no implicit type conversions corrupt data.
Query Performance
Frequently queried columns are indexed
Identify columns used in WHERE, JOIN, and ORDER BY clauses and verify appropriate indexes exist.
No N+1 query patterns exist
Monitor queries during list page loads and verify that related data is fetched with joins, not individual queries per item.
Slow queries are identified and optimized
Enable query logging and identify any query taking longer than 100ms to verify it is optimized or acceptable.
Pagination queries are efficient
Verify that paginated queries do not scan the entire table and that performance remains stable on large datasets.
Migrations and Schema
Migration scripts run without errors
Run all migration scripts in sequence on a fresh database and verify they complete without errors.
Rollback migrations work correctly
Roll back each migration and verify the database returns to its previous state without data loss or corruption.
Schema matches the application models
Compare database columns with application model definitions to verify they are in sync.
Seed data loads correctly
Run seed scripts and verify that initial data is created correctly and does not conflict with existing records.
Backup and Recovery
Database backups run on schedule
Verify that automated backups are configured and executing at the scheduled interval.
Backups can be restored successfully
Restore a backup to a test environment and verify all data is intact and the application works correctly.
Point-in-time recovery is possible
If supported, verify that the database can be restored to a specific point in time, not just the last backup.
Connection pool handles load correctly
Simulate multiple concurrent database connections and verify the pool manages them without errors or timeouts.
Frequently Asked Questions
How do I test database performance with realistic data volumes?
Create a seed script that generates thousands to millions of rows depending on your expected scale. Test all queries against this dataset to catch performance issues that only appear at volume.
Should I test database backups regularly?
Yes. A backup you have never tested restoring is not a real backup. Schedule regular restore tests to a non-production environment to verify your recovery process works.
Let human testers run through this checklist for you
Submit your app and our testers will find the bugs you missed. Starting at €15 per test.
Related checklists
API Testing Checklist
API testing checklist covering endpoints, validation, error handling, and authentication. Ensure your AI-generated API is reliable and well-behaved.
Read moreSecurity Testing Checklist
Essential security testing checklist for AI-built applications. Cover authentication, input validation, data protection, and common vulnerabilities.
Read morePerformance Optimization Testing Checklist
Performance testing checklist for AI-built web apps. Cover page load speed, runtime performance, asset optimization, and server response times.
Read more