Software Quality Assurance

Comprehensive Database Test Case Generator

Generate enterprise-grade SQL and NoSQL test scenarios covering edge cases, referential integrity, and ACID compliance validation.

#database-testing#sql#qa-automation#test-case-design#data-integrity
P
Created by PromptLib Team
Published February 11, 2026
2,521 copies
4.4 rating
You are a Senior Database Quality Assurance Architect specializing in [DATABASE_TYPE] systems with expertise in ACID compliance, referential integrity, and performance testing. Your task is to generate a comprehensive, production-ready test suite based on the following specifications.

**SCHEMA DEFINITION:**
[SCHEMA_DETAILS]

**FUNCTIONAL REQUIREMENTS:**
[FUNCTIONAL_REQUIREMENTS]

**TESTING SCOPE & FOCUS:**
[TESTING_SCOPE]

**CONSTRAINTS & BUSINESS RULES:**
[CONSTRAINTS]

**GENERATION REQUIREMENTS:**

1. **Test Coverage Categories** (ensure balanced coverage):
   - **CRUD Operations**: Create, Read (single/multi-table joins), Update, Delete (soft and hard)
   - **Constraint Validation**: PRIMARY KEY, FOREIGN KEY, UNIQUE, CHECK, NOT NULL violations
   - **Boundary Analysis**: Min/max values, empty strings vs NULL, date boundaries, string length limits
   - **Transaction Integrity**: COMMIT/ROLLBACK scenarios, deadlock detection, isolation level verification
   - **Referential Integrity**: CASCADE behaviors, orphaned record prevention, circular dependency checks
   - **Performance**: Index usage verification, query execution plans, bulk insert/update limits
   - **Security**: SQL injection attempts, privilege escalation, sensitive data encryption at rest

2. **Test Case Structure** (use for every case):
   - **Test ID**: TC_DB_[Category]_[###] (e.g., TC_DB_CONSTRAINT_001)
   - **Title**: Concise, action-oriented description
   - **Objective**: Specific validation goal
   - **Preconditions**: Exact database state required (tables, existing data, user permissions)
   - **Test Steps**: Numbered, atomic actions with specific SQL statements where applicable
   - **Test Data**: Exact values including edge cases (max INT, unicode characters, special chars)
   - **Expected Result**: Precise pass criteria including error codes, row counts, and state changes
   - **Cleanup Steps**: How to restore database state post-test
   - **Priority**: P0 (Critical/Blocker), P1 (High), P2 (Medium), P3 (Low)
   - **Automation Feasibility**: Yes/No with notes on automation complexity

3. **Negative Testing Scenarios** (mandatory inclusion):
   - Duplicate primary key insertion attempts
   - Foreign key violations (parent missing, child exists during parent delete)
   - Data type overflow (integer overflow, string truncation)
   - Constraint violations (CHECK constraints, business rules)
   - Concurrent modification conflicts (optimistic locking failures)
   - Malformed JSON/XML in structured data fields (if applicable)

4. **Specialized Validations**:
   - Timezone handling for timestamp fields (if applicable)
   - Collation and case-sensitivity issues for text comparisons
   - Auto-increment/sequence behavior verification
   - Default value application when fields omitted
   - Trigger execution validation (if triggers exist in schema)

**OUTPUT FORMAT:**
Provide:
1. Executive Summary: Total test count by priority and type
2. Critical Path Tests (P0): Detailed table format
3. Complete Test Suite: Grouped by functional area with full specifications
4. Test Data Matrix: Sample data sets for boundary conditions
5. Risk Assessment: High-risk areas requiring additional manual testing

Ensure all SQL syntax is appropriate for [DATABASE_TYPE]. Include comments explaining complex business logic validations.
Best Use Cases
Validating database schema migrations before production deployment to catch breaking changes early
Regression testing after adding new tables or modifying existing constraints to ensure backward compatibility
ETL pipeline validation where you need to verify data integrity between source and target databases
API integration testing requiring backend database state verification after HTTP operations
Compliance auditing for sensitive data handling (GDPR, HIPAA) to ensure encryption and access controls work correctly
Frequently Asked Questions

More Like This

Back to Library

Intelligent Test Automation Script Generator

This prompt engineering template enables you to generate complete, executable test scripts across multiple testing paradigms (Unit, Integration, E2E, API). It automatically incorporates edge cases, boundary value analysis, and proper assertion patterns while adhering to language-specific testing frameworks and Arrange-Act-Assert principles.

#qa-automation#test-driven-development+3
3,468
3.8

AI-Powered Mobile Application Test Strategy Architect

This prompt transforms you into a strategic QA architect, guiding AI to create detailed, actionable test strategies for mobile applications. It produces structured documentation covering device fragmentation, automation frameworks, CI/CD integration, and AI-assisted testing approaches to ensure robust app quality across all user scenarios.

#mobile testing#test-strategy+3
4,954
3.7

Enterprise Regression Test Suite Architect

This prompt transforms AI into a senior QA architect that designs exhaustive regression test suites tailored to your application architecture. It produces prioritized test cases, identifies automation candidates, and provides data requirements to ensure maximum coverage with efficient execution cycles.

#quality assurance#regression testing+3
2,273
3.6
Get This Prompt
Free
Quick Actions
Estimated time:10 min
Verified by57 experts