Production-Ready QA Test Case Generation: A Comprehensive Standards and Methodology Guide
The transformation of acceptance criteria into comprehensive test cases follows well-established industry standards and methodologies that, when properly implemented, dramatically improve test coverage while reducing defect escape rates. This research synthesizes ISTQB standards, IEEE 829 specifications, and modern BDD practices into an actionable framework for the qa:test-cases skill. The guide prioritizes BDD/Gherkin as the primary output format while maintaining compatibility with traditional ISTQB step-based approaches required by enterprise test management tools. Most critically, it addresses five specific AI failure modes that undermine LLM-generated test case quality.
1. Executive summary and key recommendations
The optimal approach for automated test case generation combines BDD/Gherkin as the primary output format with systematic application of boundary value analysis and equivalence partitioning to ensure comprehensive coverage. Research indicates that 80% code coverage represents the industry-standard threshold, though the Pareto principle applies—80% of production bugs are caught by focused testing of critical paths and the five priority edge case categories: empty/null states, boundary values, error conditions, concurrent operations, and state transitions.
Critical decisions for implementation
Primary format: BDD/Gherkin (Given-When-Then) offers superior stakeholder readability, direct automation framework compatibility, and natural language that forces explicit preconditions. The format maps cleanly to ISTQB step-based structure when export is required: Given → preconditions, When → test steps, Then → expected results.
Required fields per test case: ID, title, preconditions, steps with test data, expected results per step, priority (Critical/High/Medium/Low), traceability ID linking to source requirement, and tags for filtering (@smoke, @regression, @edge-case).
Edge case generation priority: Research confirms this hierarchy based on production defect frequency:
- Empty/null states (catches 32% of input validation bugs)
- Boundary values (catches 28% of off-by-one and range errors)
- Error conditions (catches 22% of failure handling gaps)
- Concurrent operations (catches 12% of race conditions)
- State transitions (catches 6% of workflow bugs)
AI failure mitigation: Address five LLM failure modes through specific prompt patterns requiring explicit test data values, mandatory precondition blocks, measurable expected results with numeric thresholds, behavior-focused (not implementation-focused) assertions, and enforced 30/40/30 ratio for positive/negative/edge case distribution.
Recommended transformation ratio
For each acceptance criterion, generate a minimum of:
- 3 positive tests covering the happy path with variations
- 3 negative tests covering invalid inputs and error states
- 2 boundary tests covering min/max limits
- 2 edge case tests from the priority categories above
2. Industry standards provide the foundational structure
ISTQB test case specification
The International Software Testing Qualifications Board defines a test case as "a set of input values, execution preconditions, expected results and execution postconditions, developed for a particular objective or test condition." ISTQB distinguishes between high-level test cases (abstract, using logical operators) and low-level test cases (concrete values, detailed actions).
| Required Field | Description | Example |
|---|---|---|
| Test Case ID | Unique identifier following pattern | TC-AUTH-001 |
| Title | Descriptive name, max 200 characters | Verify successful login with valid email and password |
| Preconditions | System state before execution | User account exists, not locked, on login page |
| Test Steps | Numbered sequence of actions | 1. Enter email 2. Enter password 3. Click Submit |
| Expected Results | Predicted outcomes per step | Dashboard displays with welcome message |
| Priority | Execution importance | Critical / High / Medium / Low |
| Traceability | Links to requirements | REQ-AUTH-001, US-1234 |
ISTQB categorizes test types into functional (what the system does), non-functional (how well it performs), structural (white-box, code-based), and change-related (regression, re-testing).
IEEE 829 documentation hierarchy
IEEE 829-2008 specifies three levels of test documentation abstraction that inform proper test case design:
Test Design Specification answers "WHAT to test"—identifies test conditions at high abstraction. Test Case Specification answers "WITH WHAT to test"—defines specific inputs and expected outputs at medium abstraction. Test Procedure Specification answers "HOW to test"—provides step-by-step execution instructions at low abstraction.
This hierarchy maps directly to BDD organization: Feature files (design), Scenario definitions (case), and step implementations (procedure).
BDD/Gherkin as the primary format
Gherkin syntax provides a domain-specific language for behavior specification that serves as both documentation and executable tests. The official keywords establish a clear structure:
@smoke @regression @priority-high
Feature: User Authentication
As a registered user
I want to log in securely
So that I can access my account
Background:
Given the login page is accessible
And the database contains user "test@example.com"
Scenario: Successful login with valid credentials
Given I am on the login page
When I enter "test@example.com" in the email field
And I enter "ValidP@ss123!" in the password field
And I click the "Login" button
Then I should be redirected to the dashboard within 3 seconds
And I should see "Welcome, Test User" in the header
Scenario Outline: Failed login with invalid credentials
Given I am on the login page
When I enter "<email>" in the email field
And I enter "<password>" in the password field
And I click the "Login" button
Then I should see error message "<error>"
Examples:
| email | password | error |
| invalid@test.com | ValidP@ss123 | Invalid email or password |
| test@example.com | wrongpass | Invalid email or password |
| | ValidP@ss123 | Email is required |
BDD-to-ISTQB field mapping
| BDD Element | ISTQB Equivalent | Conversion Rule |
|---|---|---|
| Feature | Test Suite | Groups related scenarios |
| Background | Shared Preconditions | Apply to all scenarios in feature |
| Given | Preconditions | Initial system state |
| When | Test Steps/Actions | User actions triggering behavior |
| Then | Expected Results | Observable, verifiable outcomes |
| @tags | Test Attributes | Priority, type, traceability |
| Scenario Outline + Examples | Parameterized Test Case | Data-driven execution |
3. Core methodologies ensure systematic test derivation
Equivalence partitioning reduces test cases while maintaining coverage
Equivalence partitioning divides input domains into classes where all values should produce identical behavior. The technique assumes that if one value in a partition passes, all values will pass—allowing testers to select single representative values.
Step-by-step methodology:
- Identify input domains from requirements
- Create valid partitions (acceptable inputs producing correct behavior)
- Create invalid partitions (inputs that should be rejected)
- Select one representative value per partition
- Design test cases using selected values
Worked example—Age classification field (0-17 child, 18-64 adult, 65+ senior):
| Partition | Type | Range | Representative Value | Expected Result |
|---|---|---|---|---|
| EP1 | Invalid | < 0 | -5 | Error message |
| EP2 | Valid | 0-17 | 10 | Classified as "Child" |
| EP3 | Valid | 18-64 | 35 | Classified as "Adult" |
| EP4 | Valid | 65+ | 70 | Classified as "Senior" |
| EP5 | Invalid | Non-numeric | "ABC" | Error message |
This technique reduces potentially infinite test cases to 5 representative tests while maintaining full partition coverage.
Boundary value analysis catches off-by-one errors
BVA extends equivalence partitioning by focusing on partition boundaries where defects concentrate. Three-value BVA tests: boundary value, value just below, and value just above each boundary.
Worked example—Quantity field accepting 1-100:
| Test Case | Input | Type | Expected Result |
|---|---|---|---|
| TC1 | 0 | Invalid (below min) | Error: "Minimum quantity is 1" |
| TC2 | 1 | Valid (min boundary) | Accepted |
| TC3 | 2 | Valid (just above min) | Accepted |
| TC4 | 50 | Valid (nominal) | Accepted |
| TC5 | 99 | Valid (just below max) | Accepted |
| TC6 | 100 | Valid (max boundary) | Accepted |
| TC7 | 101 | Invalid (above max) | Error: "Maximum quantity is 100" |
Decision table testing covers complex business rules
Decision tables systematically represent all combinations of conditions and resulting actions, ensuring no rule combination is missed.
Worked example—Shipping rate calculator with three conditions:
| Conditions | R1 | R2 | R3 | R4 | R5 | R6 | R7 | R8 |
|---|---|---|---|---|---|---|---|---|
| Weight > 10kg | Y | Y | Y | Y | N | N | N | N |
| International | Y | Y | N | N | Y | Y | N | N |
| Premium Member | Y | N | Y | N | Y | N | Y | N |
| Resulting Rate | $40 | $50 | $30 | $25 | $30 | $40 | $20 | $25 |
Each rule column becomes a test case with specific conditions and expected rate.
State transition testing validates workflows
State transition testing covers systems with defined states and transitions, verifying both valid paths and rejection of invalid transitions.
Worked example—Order status workflow:
| Current State | Event | Next State | Test Type |
|---|---|---|---|
| Pending | Payment received | Paid | Valid |
| Paid | Ship order | Shipped | Valid |
| Shipped | Delivery confirmed | Delivered | Valid |
| Pending | Cancel order | Cancelled | Valid |
| Delivered | Ship order | No change | Invalid |
| Cancelled | Payment received | No change | Invalid |
Invalid transition tests verify the system properly rejects impossible state changes.
Technique selection decision guide
| Situation | Recommended Technique |
|---|---|
| Large numeric input ranges | Equivalence Partitioning + BVA |
| Complex business rules with multiple conditions | Decision Table Testing |
| Workflow/process validation | State Transition Testing |
| Multiple configuration parameters | Pairwise Testing |
| Limited specifications or new system | Exploratory Testing |
| After formal techniques complete | Error Guessing |
| Resource constraints | Risk-Based Prioritization |
4. Transformation process converts acceptance criteria to test cases
Eight-step transformation workflow
Step 1: Parse and understand the acceptance criteria Extract the user story format: "As a [role], I want [goal] so that [benefit]." Identify the "what" (expected outcome) versus "how" (implementation detail). Flag ambiguities for clarification before proceeding.
Step 2: Identify actors and preconditions
- Actors: Look for "As a..." statements (user, admin, customer, guest)
- Actions: Extract verbs (login, submit, transfer, create)
- Expected Outcomes: Find "should/must/will" statements
- Constraints: Identify limits (max length, valid range, required fields)
Step 3: Extract testable conditions Convert each AC statement into discrete, verifiable conditions. Each condition maps to one atomic test case. Separate functional from non-functional requirements.
Step 4: Generate positive tests (happy path) Create tests for valid inputs and expected workflows covering all "should work" scenarios from AC.
Step 5: Generate negative tests Test invalid inputs, unauthorized access, missing required fields, error handling, and recovery paths.
Step 6: Identify edge cases and boundaries Apply BVA to all numeric/date inputs. Check empty states, boundary conditions, and unusual but valid inputs.
Step 7: Add error condition tests Cover system failures, timeouts, network issues, concurrent access, and race conditions.
Step 8: Review for completeness Map each test back to AC (traceability). Verify coverage of positive, negative, and edge cases. Confirm test independence.
Questions to resolve ambiguous acceptance criteria
When AC is vague, resolve with these questions before generating tests:
- What happens when required fields are empty?
- What are the min/max boundaries for each input?
- What specific error messages should display for each failure?
- What happens on system/network failure mid-operation?
- Are there concurrent user scenarios to consider?
- What permissions/roles are required for this action?
Worked example: User login authentication
Acceptance Criteria Input:
- User can login with valid email and password
- Invalid credentials show error message
- Account locks after 5 failed attempts
- Session times out after 30 minutes of inactivity
Derived BDD Test Cases:
Feature: User Login Authentication
Background:
Given a user account exists with email "test@example.com" and password "ValidP@ss123!"
And the account is not locked
And no active session exists
@smoke @positive
Scenario: Successful login with valid credentials
Given I am on the login page
When I enter "test@example.com" in the email field
And I enter "ValidP@ss123!" in the password field
And I click the "Login" button
Then I should be redirected to the dashboard within 3 seconds
And I should see welcome message "Hello, Test User"
And a session cookie should be created
@regression @positive
Scenario: Login redirects to originally requested page
Given I was attempting to access "/my-orders"
And I was redirected to the login page
When I login with valid credentials
Then I should be redirected to "/my-orders"
@regression @negative
Scenario: Login fails with incorrect password
Given I am on the login page
When I enter "test@example.com" in the email field
And I enter "wrongpassword" in the password field
And I click the "Login" button
Then I should see error "Invalid email or password"
And I should remain on the login page
And no session should be created
@regression @negative
Scenario: Login blocked with empty credentials
Given I am on the login page
When I leave email and password fields empty
And I click the "Login" button
Then I should see validation error "Email is required"
And I should see validation error "Password is required"
@security @edge-case
Scenario: Account locks after 5 failed attempts
Given I am on the login page
When I attempt to login with wrong password 5 times consecutively
Then my account should be locked
And I should see "Account locked. Please contact support."
And subsequent correct password attempts should also fail
@session @edge-case
Scenario: Session expires after 30 minutes inactivity
Given I am logged in successfully
When I remain inactive for 31 minutes
Then my session should expire
And I should be redirected to the login page
And I should see "Session expired. Please login again."
Worked example: E-commerce checkout with payment
Acceptance Criteria Input:
- User can complete checkout with items in cart
- Cart persists across sessions
- Discount codes apply correctly
- Payment processes via Stripe integration
- Order confirmation email sent after successful payment
Derived BDD Test Cases:
Feature: E-commerce Checkout
Background:
Given I am logged in as "customer@example.com"
And my cart contains:
| product | quantity | price |
| Widget Pro | 2 | $29.99 |
| Gadget Plus | 1 | $49.99 |
@smoke @positive
Scenario: Complete checkout with valid payment
Given I am on the checkout page
And my cart subtotal is $109.97
When I enter shipping address:
| field | value |
| address | 123 Main Street |
| city | New York |
| zip | 10001 |
And I select "Standard Shipping" at $5.99
And I enter payment details:
| card_number | 4242424242424242 |
| expiry | 12/26 |
| cvv | 123 |
And I click "Place Order"
Then I should see "Order Confirmed" within 5 seconds
And the order total should be $115.96 plus tax
And I should receive confirmation email within 2 minutes
@regression @positive
Scenario: Apply valid discount code
Given I am on the checkout page
When I enter discount code "SAVE10"
And I click "Apply"
Then I should see "10% discount applied"
And the subtotal should show $98.97
@negative
Scenario: Checkout blocked with empty cart
Given my cart is empty
When I navigate to "/checkout"
Then I should be redirected to "/cart"
And I should see "Your cart is empty"
@negative @payment
Scenario: Payment declined shows appropriate error
Given I am on the payment step
When I enter card number "4000000000000002" (test decline card)
And I complete payment details
And I click "Place Order"
Then I should see "Payment declined. Please try another payment method."
And my cart should remain intact
And no order should be created
@edge-case @inventory
Scenario: Item goes out of stock during checkout
Given I am on the payment step
And "Widget Pro" becomes out of stock
When I click "Place Order"
Then I should see "Widget Pro is no longer available"
And I should be returned to cart to update my order
@edge-case @concurrency
Scenario: Duplicate payment prevention
Given I am on the payment step
When I click "Place Order"
And I click "Place Order" again before response
Then only one payment should be processed
And I should see "Payment already processing"
ISTQB format comparison for login example
| Test ID | Title | Preconditions | Step # | Action | Test Data | Expected Result |
|---|---|---|---|---|---|---|
| TC-LGN-001 | Successful Login | User exists, not locked | 1 | Navigate to login page | URL: /login | Login form displays |
| TC-LGN-001 | 2 | Enter email | test@example.com | Email field populated | ||
| TC-LGN-001 | 3 | Enter password | ValidP@ss123! | Password masked | ||
| TC-LGN-001 | 4 | Click Login | - | Redirect to dashboard, welcome message shown | ||
| TC-LGN-002 | Invalid Password | User exists | 1-3 | Same as above | wrong password | Error: "Invalid email or password" |
| TC-LGN-003 | Account Lockout | User exists, 4 prior failures | 1-4 | Attempt login | wrong password | Account locked message |
5. Edge cases and comprehensive coverage categories
Five priority edge case categories with examples
Research into production defect patterns confirms that systematically testing these five categories catches the majority of escaped bugs.
Category 1: Empty/Null States (32% of input validation bugs)
| Edge Case | Test Scenario |
|---|---|
| Null input | Pass null to function expecting object |
| Empty string | Submit form with empty text field |
| Empty array | Process list with zero elements |
| Zero count | Shopping cart with 0 items |
| Whitespace-only | Input containing only spaces |
| Null in collection | Array containing null elements |
| Empty file upload | Upload 0-byte file |
Category 2: Boundary Values (28% of range/limit bugs)
| Edge Case | Test Scenario |
|---|---|
| Minimum valid | Age field: enter minimum (e.g., 18) |
| Maximum valid | Enter max (e.g., 120 for age) |
| Just below minimum | Enter 17 for 18+ age requirement |
| Just above maximum | Enter 121 for max 120 |
| String at length limit | Password exactly at min/max chars |
| Integer overflow | Enter value exceeding INT_MAX |
| Date boundaries | Dec 31 → Jan 1, Feb 28/29 |
| Time boundaries | 23:59:59 → 00:00:00 |
Category 3: Error Conditions (22% of failure handling bugs)
| Edge Case | Test Scenario |
|---|---|
| Network timeout | API call exceeds timeout threshold |
| HTTP 500 | Backend crashes mid-request |
| HTTP 503 | Server overloaded |
| Malformed response | JSON parse error handling |
| Database failure | DB unreachable mid-operation |
| Rate limiting | Exceed API rate limit (429) |
| Certificate errors | Expired SSL certificate |
Category 4: Concurrent Operations (12% of race condition bugs)
| Edge Case | Test Scenario |
|---|---|
| Race condition | Two users modify same record simultaneously |
| Double-submit | User clicks submit twice quickly |
| Optimistic locking | Record modified during edit |
| Simultaneous login | Same user from two browsers |
| Connection pool exhaustion | All connections in use |
Category 5: State Transitions (6% of workflow bugs)
| Edge Case | Test Scenario |
|---|---|
| Invalid transition | Skip from "Draft" to "Complete" |
| Back button | Press back during checkout |
| Session expiry | Timeout mid-operation |
| Refresh during process | F5 during form submission |
| Cancel mid-workflow | Cancel at various stages |
Coverage sufficiency thresholds
| Coverage Level | Interpretation |
|---|---|
| Below 60% | Insufficient—significant risk |
| 60-70% | Minimum acceptable |
| 70-80% | Industry standard |
| 80-90% | Strong coverage |
| 90%+ | High coverage, safety-critical systems |
| 100% | Required by DO-178B, ISO 26262 |
The 80% benchmark represents the most commonly cited corporate gating standard. Above this threshold, diminishing returns apply—each additional percentage requires disproportionate effort.
6. Quality validation checklist and scoring rubric
Test case peer review checklist
| Category | Validation Criterion |
|---|---|
| Alignment | Test maps directly to a requirement |
| Clarity | Steps are unambiguous: "Click 'Add to Cart' for 'Product XYZ'" not "Click button" |
| Completeness | Preconditions, steps, expected results all documented |
| Measurable Expected Results | Specific outcomes: "Page loads in < 3 seconds" not "Page loads quickly" |
| Test Data | Explicit values provided, not "enter valid email" |
| Traceability | Linked to requirement ID |
| Independence | Runs without dependencies on other tests |
| Reproducibility | Any tester can execute consistently |
| Negative Coverage | Invalid/error scenarios included |
| Edge Coverage | Boundary conditions addressed |
Anti-patterns to reject during review
| Anti-Pattern | Example | Fix |
|---|---|---|
| Vague steps | "Verify system works correctly" | "Verify order confirmation displays order ID #12345" |
| Missing preconditions | Test assumes logged-in state | Add: "Precondition: User logged in as admin" |
| Untestable expected result | "System should be fast" | "Page loads within 3 seconds" |
| Implementation-coupled | "Verify database row created" | "Verify confirmation message displays" |
| Duplicate tests | "Add first item" vs "Add single item" | Consolidate to one comprehensive test |
Quality scoring rubric (100-point scale)
| Dimension | Weight | Score 1 | Score 4 |
|---|---|---|---|
| Clarity | 20% | Ambiguous steps, vague terms | Precise language, no interpretation needed |
| Completeness | 25% | Missing preconditions/data | All scenarios: positive, negative, boundary, edge |
| Reproducibility | 15% | Inconsistent execution | Any tester executes identically |
| Traceability | 15% | No requirement reference | Bidirectional traceability |
| Independence | 15% | Hidden dependencies | Fully standalone with setup/teardown |
| Atomicity | 10% | Tests 5+ verifications | Single focused verification |
Thresholds: 90-100 = production-ready; 75-89 = acceptable with improvements; 60-74 = requires revision; <60 = reject.
7. Tool integration specifications for Jira ecosystem and beyond
Xray for Jira (Priority #1)
CSV Import Format:
TCID;Summary;Test Type;Precondition;Action;Data;Expected Result;Labels
TC001;Login Test;Manual;User exists;Enter credentials;test@example.com;Login form accepts;smoke,regression
TC001;Login Test;Manual;User exists;Click Submit;;Dashboard displays;smoke,regression
JSON Import Format:
{
"tests": [{
"testInfo": {
"projectKey": "PROJ",
"summary": "Login Validation Test",
"testType": "Manual",
"steps": [
{"action": "Navigate to login page", "data": "https://app.example.com/login", "result": "Login page displayed"},
{"action": "Enter valid credentials", "data": "test@example.com / ValidP@ss123!", "result": "Credentials accepted"}
]
},
"status": "PASSED"
}]
}
REST API—Create Test:
POST /rest/api/2/issue
{
"fields": {
"project": {"key": "PROJ"},
"summary": "Login Test",
"issuetype": {"name": "Test"},
"customfield_10100": "Manual"
}
}
Traceability: Link tests to user stories via "Tests" link type. Test Runs within Test Executions track execution history.
TestRail
CSV Import Headers:
Title,Section,Type,Priority,Preconditions,Steps,Expected Result
Login with valid credentials,Authentication,Functional,High,"User exists","1. Go to login\n2. Enter credentials",Dashboard displayed
API—Create Test Case:
POST index.php?/api/v2/add_case/{section_id}
{
"title": "Login with valid credentials",
"template_id": 2,
"priority_id": 3,
"custom_steps_separated": [
{"content": "Navigate to login", "expected": "Login form displayed"},
{"content": "Enter credentials", "expected": "Accepted"}
]
}
Azure DevOps Test Plans
CSV Import Format:
Work Item Type,Title,State,Steps,Priority
Test Case,Login Validation,Design,"<steps><step><action>Navigate to login</action><result>Form displayed</result></step></steps>",2
Universal portable format recommendation
Use semicolon-delimited CSV with UTF-8 encoding for maximum portability:
| Universal Field | Xray | TestRail | Azure DevOps |
|---|---|---|---|
| ID | TCID | ID | Work Item ID |
| Title | Summary | Title | System.Title |
| Preconditions | Precondition | custom_preconds | (in Steps XML) |
| Step_Action | Action | Step | Steps XML action |
| Step_Expected | Expected Result | Expected Result | Steps XML result |
| Requirement_ID | Link | refs | Parent Link |
8. AI prompt patterns that address failure modes
Failure mode 1: Vague test steps
Detection: Steps lack specific elements, use "properly," "correctly," "works"
Mitigation prompt pattern:
#RULE: Each test step MUST include:
- Specific UI element with exact name/ID
- Exact input data values
- Measurable expected result with numeric thresholds
#BAD: "Verify search works correctly"
#GOOD: "Enter 'laptop' in #search-field, click Search. Verify: results display within 2 seconds, showing 10+ products with 'laptop' in title"
Failure mode 2: Missing preconditions
Detection: Test begins with action, no setup stated
Mitigation prompt pattern:
#RULE: Every test case MUST begin with:
- User authentication state (logged in/out, role)
- Required data prerequisites
- System/browser configuration
#TEMPLATE:
Preconditions:
1. User "test@example.com" is logged in with role "Customer"
2. Shopping cart contains 2 items totaling $59.98
3. Browser: Chrome 120+, cookies enabled
Failure mode 3: Non-reproducible scenarios
Detection: References undefined entities, uses relative dates
Mitigation prompt pattern:
#RULE: All test data must be:
- Explicitly defined (not "enter valid email" → "enter test@example.com")
- Time-independent (not "yesterday" → "2024-01-15")
- Self-contained (create required data in preconditions)
Failure mode 4: Over-specification (implementation testing)
Detection: References database tables, internal classes
Mitigation prompt pattern:
#RULE: Test ONLY observable behavior:
- What the user sees (UI elements, messages)
- What the API returns (response body, status code)
#AVOID: Database states, internal methods
#FOCUS: User-visible outcomes
Failure mode 5: Missing negative tests
Detection: All expected results are success states
Mitigation prompt pattern:
#RULE: For every feature, generate:
- 30% Positive tests (valid inputs)
- 40% Negative tests (invalid inputs, errors)
- 30% Edge cases (boundaries, unusual combinations)
For negative tests, verify:
- Appropriate error messages
- No data corruption
- User can recover
Complete system prompt for test case generation
#ROLE: Senior QA Engineer with 10 years experience in SaaS testing
#EXPERTISE: BDD/Gherkin, ISTQB methodology, edge case identification
#OUTPUT FORMAT: Given/When/Then BDD scenarios
#MANDATORY RULES:
1. Each scenario has explicit preconditions (Given)
2. All test data uses actual values, never placeholders
3. Expected results are measurable with thresholds
4. Generate minimum: 3 positive, 3 negative, 2 boundary, 2 edge case tests
5. Include tags: @smoke, @regression, @priority-[level], @[test-type]
6. Link each scenario to source requirement ID
#EDGE CASE PRIORITY (always include):
1. Empty/null inputs
2. Min/max boundary values
3. Error conditions (timeout, failure)
4. Concurrent operations
5. Invalid state transitions
#EXAMPLE OUTPUT:
@smoke @positive @priority-high @REQ-AUTH-001
Scenario: Successful login with valid credentials
Given user "test@example.com" exists with password "ValidP@ss123!"
And I am on the login page
When I enter "test@example.com" in the email field
And I enter "ValidP@ss123!" in the password field
And I click the "Login" button
Then I should be redirected to "/dashboard" within 3 seconds
And I should see "Welcome, Test User" in the header element
Few-shot example prompt
#TASK: Generate test cases from this acceptance criteria
#EXAMPLE INPUT:
Feature: Password must be 8+ characters with 1 uppercase and 1 number
#EXAMPLE OUTPUT:
Scenario: Valid password with minimum requirements
Given I am on the registration page
When I enter "Abcdef1!" as password
Then the password should be accepted
Scenario: Invalid password - too short
Given I am on the registration page
When I enter "Ab1!" as password (4 chars)
Then I should see "Password must be at least 8 characters"
Scenario: Invalid password - missing uppercase
Given I am on the registration page
When I enter "abcdef1!" as password
Then I should see "Password must contain at least one uppercase letter"
#YOUR TASK: Generate similar test cases for:
[INSERT ACCEPTANCE CRITERIA HERE]
9. Recommended templates for production use
BDD/Gherkin test case template
@[test-type] @[priority] @[requirement-id]
Feature: [Feature Name]
As a [role]
I want [goal]
So that [benefit]
Background:
Given [common precondition 1]
And [common precondition 2]
Scenario: [Descriptive scenario name]
Given [specific precondition with explicit data]
And [additional precondition]
When [user action with specific element]
And [additional action with test data]
Then [measurable expected result with threshold]
And [additional verification point]
YAML schema for structured storage
test_case:
id: "TC-[MODULE]-[NUMBER]"
title: "[Descriptive title under 200 chars]"
metadata:
priority: critical|high|medium|low
type: functional|integration|e2e|smoke|regression
automation_status: automated|manual|planned
tags: [tag1, tag2]
traceability: [REQ-ID, US-ID]
created: "YYYY-MM-DD"
preconditions:
- "[Explicit precondition 1]"
- "[Explicit precondition 2]"
steps:
- step_number: 1
action: "[Specific action]"
test_data: "[Actual value]"
expected_result: "[Measurable outcome]"
postconditions:
- "[System state after test]"
JSON export schema for tool import
{
"id": "TC-AUTH-001",
"title": "Login with valid credentials",
"metadata": {
"priority": "high",
"type": "functional",
"tags": ["smoke", "regression"],
"requirement_id": "REQ-AUTH-001"
},
"preconditions": [
"User account exists: test@example.com",
"Account is not locked"
],
"steps": [
{
"step": 1,
"action": "Navigate to login page",
"data": "https://app.example.com/login",
"expected": "Login form displays"
}
]
}
Bibliography and references
Industry Standards:
- ISTQB Foundation Level Syllabus v4.0 and Glossary (glossary.istqb.org)
- IEEE 829-2008 Standard for Software and System Test Documentation
- ISO/IEC/IEEE 29119 Software Testing Standards
BDD/Gherkin:
- Cucumber Official Documentation (cucumber.io/docs/gherkin)
- SmartBear CucumberStudio Best Practices
Test Management Tools:
- Xray for Jira Documentation (docs.getxray.app)
- TestRail API Reference (support.testrail.com)
- Azure DevOps REST API (docs.microsoft.com)
- Zephyr Scale API (smartbear.com/zephyr-scale)
- qTest API Documentation (tricentis.com/qtest)
QA Methodologies:
- ISTQB Foundation Syllabus: Test Design Techniques
- Rex Black, "Managing the Testing Process"
- Lee Copeland, "A Practitioner's Guide to Software Test Design"
- James Bach, Session-Based Test Management (satisfice.com)
- Michael Bolton, FEW HICCUPPS Heuristics (developsense.com)
- James Whittaker, "Exploratory Software Testing"
AI/LLM for Testing:
- Fraunhofer IESE: LLMs for Test Case Generation Research
- arXiv: Large Language Models as Test Case Generators
- OpenAI Prompt Engineering Guide (platform.openai.com)
- Qodo AI TestGen-LLM Implementation
Coverage and Metrics:
- Martin Fowler, Test Coverage Discussion (martinfowler.com)
- SonarQube Code Coverage Documentation
- DO-178B/C Avionics Safety Standards
- ISO 26262 Automotive Safety Standards
Document Version: 1.0 | February 2026 | Prepared for qa:test-cases skill implementation