NashTech Blog

AI-Assisted Test Case Design: From Requirements to Better Coverage

Table of Contents

Designing test cases is one of the most important activities in software testing. A good test case should not only verify that the system works as expected, but also help identify invalid inputs, boundary conditions, edge cases, and unexpected user behaviors.

Traditionally, testers analyze requirements and manually create test scenarios and test cases. This process requires a strong understanding of the system, business rules, and testing techniques.

With the increasing use of AI tools, testers can now use AI to accelerate test case design. Tools such as Microsoft 365 Copilot can help analyze requirements, generate test scenarios, identify missing cases, and suggest additional test ideas.

However, AI-generated test cases are not automatically complete or correct. The tester still needs to validate the output against the actual requirements and business context.

This article explores a practical approach to using AI for test case design, from analyzing requirements to improving test coverage.

Why Use AI for Test Case Design?

Test case design can become time-consuming when requirements contain many business rules, conditions, and user flows.

For example, a requirement may contain:

  • Multiple input validations
  • Business rules
  • Different user roles
  • Boundary conditions
  • Dependencies between fields
  • Error handling
  • Different system states

A tester needs to identify all relevant scenarios while avoiding unnecessary duplication.

AI can help by providing an additional perspective during test design.

It can be used to:

  • Analyze requirements
  • Generate test scenarios
  • Identify positive and negative cases
  • Suggest boundary conditions
  • Generate edge cases
  • Identify missing scenarios
  • Apply test design techniques
  • Generate test data ideas
  • Review existing test cases
  • Suggest improvements to test coverage

The goal is not to let AI design the entire test suite.

The goal is to use AI as a test design assistant.

1. Start with the Requirement

The quality of AI-generated test cases depends heavily on the quality of the information provided to AI.

Consider the following requirement:

Users can reset their password using the "Forgot Password" function. 
Rules:
- User enters a registered email address. 
- The system sends a password reset link. 
- The reset link expires after 30 minutes. 
- The new password must contain at least 8 characters. 
- The new password must contain at least one uppercase letter, one lowercase letter, and one number. 
- The new password cannot be the same as the previous password.

A tester could manually start creating test cases from this requirement.

However, AI can first help break the requirement into testable conditions.

Prompt

Analyze the following password reset requirement and identify the functional rules, validation rules, boundary conditions, and potential edge cases.

Possible AI Output

Functional Rules: 
- User can request a password reset. 
- A reset link is sent to the registered email. 
- User can reset the password using the link. 

Validation Rules: 
- Email must be registered. 
- Password must contain at least 8 characters. 
- Password must contain uppercase, lowercase, and number. 
- New password cannot match the previous password. 

Boundary Conditions: 
- Password with exactly 8 characters. 
- Password with 7 characters. 
- Reset link at exactly 30 minutes. 
- Reset link after 30 minutes. 

Edge Cases: 
- Expired reset link. 
- Reset link used more than once. 
- Multiple reset requests. 
- Previously used password.

This gives the tester a structured view of the requirement before creating detailed test cases.

2. Generate Test Scenarios with AI

Once the requirement has been analyzed, AI can help generate test scenarios.

A weak prompt might be:

Generate test cases for password reset.

The result may contain only basic scenarios such as:

1. Reset password with valid email. 
2. Reset password with invalid email. 
3. Reset password with valid new password. 
4. Reset password with invalid new password.

These scenarios are useful, but they may not provide enough coverage.

A better prompt provides context and explicitly asks AI to use testing techniques.

Improved Prompt

Generate test scenarios for the password reset feature.

Cover:

  • Positive scenarios
  • Negative scenarios
  • Boundary Value Analysis
  • Equivalence Partitioning
  • Edge cases
  • Security-related scenarios
  • Error handling

Group the scenarios by category and explain the purpose of each scenario.

The output is likely to be more comprehensive.

Example

CategoryScenario
PositiveReset password with valid registered email
PositiveSet password with valid password
NegativeUse unregistered email
NegativePassword shorter than 8 characters
NegativePassword without uppercase character
NegativePassword without lowercase character
NegativePassword without number
BoundaryPassword contains exactly 8 characters
BoundaryReset link is used at 30 minutes
Edge CaseReset link is used after expiration
Edge CaseReset link is used twice
SecurityAttempt to reuse an old password

AI has now moved from simply generating test cases to helping the tester think about different dimensions of coverage.

3. Use Test Design Techniques with AI

One of the most useful applications of AI is combining requirements with established test design techniques.

AI should not replace knowledge of testing techniques. Instead, it can help apply them systematically.

Equivalence Partitioning

Suppose an application accepts an age between 18 and 65.

The tester can ask:

Apply Equivalence Partitioning to the age field. Identify valid and invalid partitions and provide representative test values.

Possible result:

Valid: 
- 18–65 

Invalid: 
- Less than 18 
- Greater than 65 

Representative values:
 17, 18, 30, 65, 66

This gives the tester a quick starting point for designing representative tests.

Boundary Value Analysis

The same requirement can be analyzed using Boundary Value Analysis.

Prompt

Apply Boundary Value Analysis to an age field that accepts values from 18 to 65. Provide the minimum, maximum, and values immediately around each boundary.

Possible result:

17 → Below minimum 
18 → Minimum 
19 → Just above minimum 

64 → Just below maximum 
65 → Maximum 
66 → Above maximum

This approach helps ensure that boundary conditions are explicitly considered.

4. Ask AI to Find Missing Test Cases

AI can also be useful after the tester already has a test suite.

For example:

TC01 - Login with valid username and password 
TC02 - Login with invalid password 
TC03 - Login with invalid username 
TC04 - Login with empty username 
TC05 - Login with empty password

Instead of asking AI to generate another complete list, ask it to review the existing coverage.

Prompt

Review the following login test cases against these requirements.

Identify:

  1. Missing scenarios
  2. Duplicate scenarios
  3. Boundary cases
  4. Security-related scenarios
  5. Error-handling scenarios

Do not rewrite the existing test cases. Only identify potential gaps.

AI may identify scenarios such as:

Potential gaps: 
- Account lockout after multiple failed attempts 
- Password field boundary conditions 
- Case sensitivity 
- Session timeout 
- Remember-me behavior 
- Multiple concurrent login attempts 
- Disabled account 
- Locked account 
- Expired password

This is particularly useful during test case reviews.

Instead of asking:

“Did I miss anything?”

the tester can use AI as an additional review perspective.

5. Improve Coverage by Mapping Requirements to Test Cases

Another useful approach is requirement-to-test-case mapping.

Consider three requirements:

REQ-01: User must provide a valid email. 
REQ-02: Password must contain at least 8 characters. 
REQ-03: Password reset link expires after 30 minutes.

The tester can ask AI to identify whether each requirement has sufficient test coverage.

Prompt

Create a requirement-to-test-case coverage matrix for the following requirements and test cases. Identify any requirement that has insufficient coverage.

Example:

RequirementTest CasesCoverage
REQ-01
TC01, TC02, TC03
Covered
REQ-02
TC04, TC05
Covered
REQ-03TC06Partial

The important point is that AI should help identify potential gaps, while the tester determines whether the coverage is actually sufficient.

6. Use AI to Generate Better Test Data

Test case design is not only about scenarios. Good test data is also important.

For example, consider a registration form:

Username: 
- 5–20 characters 
- Letters and numbers only

Age: 
- 18–65 

Email: 
- Valid email format

A tester can ask:

Generate test data for this registration form using valid, invalid, and boundary-value categories. Include the expected validation result for each data set.

Possible output:

Test DataExpected Result
user123Valid
abc12Valid boundary
abc1Invalid
abcdefghijklmnopqrstuInvalid
test@example.comValid
test@Invalid
Age = 18Valid boundary
Age = 17Invalid
Age = 65Valid boundary
Age = 66Invalid

The tester can then select the data that is relevant to the actual application.

7. AI + Risk-Based Test Design

Not all test cases have the same business impact.

A payment function, authentication process, or policy calculation may require more attention than a low-risk UI preference.

AI can help identify potential risk areas from requirements.

Prompt

Analyze this requirement from a risk-based testing perspective.

Identify:

  • High-impact functionality
  • Potential failure points
  • Business-critical scenarios
  • Scenarios that should receive higher testing priority

Explain the reasoning for each suggestion.

For example:

Potential high-risk areas: 
- Incorrect payment calculation 
- Duplicate payment 
- Failed payment handling 
- Transaction timeout 
- Incorrect transaction status

The tester can then use this information to decide where deeper testing may be appropriate.

AI is therefore not only helping generate more test cases; it can help testers think about where testing effort should be concentrated.

8. Example: From Requirement to Improved Test Cases

Let’s combine the techniques into one practical example.

Requirement

A user can transfer money to another account. 

Rules: 
- Transfer amount must be between $10 and $10,000. 
- Sender must have sufficient balance. 
- Recipient account must be valid. 
- A transfer cannot be made to the sender's own account. 
- The transaction must have a unique transaction ID.

Step 1 — Ask AI to Analyze the Requirement

Prompt:

Analyze this money transfer requirement and identify business rules, validation rules, boundaries, negative scenarios, edge cases, and potential risks.

AI identifies:

Business Rules: 
- Transfer amount: $10–$10,000 
- Sufficient balance required 
- Recipient must be valid 
- Sender cannot transfer to their own account 
- Transaction ID must be unique

Boundary Conditions: 
- $9.99 
- $10 
- $10,000 
- $10,000.01

Step 2 — Generate Initial Test Cases

The tester asks:

Generate functional test scenarios based on the identified rules.

AI provides:

TC01 - Transfer valid amount 
TC02 - Transfer amount below minimum 
TC03 - Transfer amount above maximum 
TC04 - Transfer exactly minimum amount 
TC05 - Transfer exactly maximum amount 
TC06 - Insufficient balance 
TC07 - Invalid recipient 
TC08 - Transfer to own account 
TC09 - Verify unique transaction ID

Step 3 — Ask AI to Find Gaps

Now the tester asks:

Review these test cases and identify missing edge cases and failure scenarios.

AI may suggest:

Potential missing scenarios: 
- Decimal amount 
- Zero amount 
- Negative amount 
- Null amount 
- Network interruption during transfer 
- Duplicate submission 
- Transfer timeout 
- Balance changes during transaction 
- Session expiration during transfer

Step 4 — Tester Review

The tester reviews the suggestions against the actual system.

Some scenarios may be relevant, while others may not apply.

For example:

Keep: 
- Duplicate submission 
- Transfer timeout 
- Decimal amount 
- Session expiration

Remove: 
- Negative amount if the UI/API already prevents it and the behavior is covered elsewhere.

This is where tester expertise becomes important.

AI generates possibilities.

The tester determines what is relevant.

9. AI Should Complement Test Design Techniques

AI becomes more useful when combined with established testing techniques rather than used as a simple “test case generator.”

For example:

Testing TechniqueHow AI Can Help
Equivalence PartitioningIdentify valid and invalid partitions
Boundary Value AnalysisSuggest values around boundaries
Decision Table TestingIdentify combinations of business rules
State Transition TestingIdentify scenarios across system states
Error GuessingSuggest potential failure scenarios
Risk-Based TestingIdentify potentially high-impact areas
Pairwise TestingSuggest combinations of input conditions

The tester should still understand these techniques and decide when each one is appropriate.

10. A Practical AI-Assisted Test Design Workflow

A practical workflow can be structured into five steps:

Step 1 — Understand the Requirement

Read and understand the requirement before asking AI for test cases.

Step 2 — Ask AI to Analyze

Use AI to identify:

  • Business rules
  • Inputs and outputs
  • Conditions
  • Constraints
  • Boundaries
  • Dependencies

Step 3 — Generate Test Scenarios

Ask AI to generate:

  • Positive scenarios
  • Negative scenarios
  • Boundary scenarios
  • Edge cases
  • Error handling
  • Security scenarios
  • Risk-based scenarios

Step 4 — Review and Refine

Compare the AI output against:

  • Actual requirements
  • Business rules
  • Existing test cases
  • System behavior
  • Known defects
  • Production issues

Remove irrelevant scenarios and add missing ones.

Step 5 — Validate Coverage

Finally, check whether important requirements and risks are covered.

Requirement
↓
AI Analysis
↓
Test Design Techniques
↓
AI-Generated Scenarios
↓
Tester Review
↓
Test Case Refinement
↓
Coverage Review

11. Best Practices When Using AI for Test Case Design

Provide Context

Avoid vague prompts such as:

Generate test cases.

Instead, provide the requirement, business rules, constraints, and expected behavior.

Specify Testing Techniques

If you need boundary or negative testing, explicitly ask for it.

For example:

Apply Equivalence Partitioning and Boundary Value Analysis to this requirement.

Ask AI to Review Existing Tests

AI can be useful not only for generating tests but also for identifying potential gaps in an existing test suite.

Do Not Automatically Accept Every Suggestion

AI-generated scenarios may be:

  • Irrelevant
  • Duplicated
  • Technically incorrect
  • Based on assumptions
  • Missing important business context

Keep the Tester in the Loop

The final test suite should be based on tester judgment and actual system requirements.

A useful mindset is:

AI → Generate Ideas
Tester → Validate and Decide

Conclusion

AI can significantly support test case design by helping testers analyze requirements, generate scenarios, identify edge cases, apply test design techniques, and review existing test coverage.

However, better coverage does not simply mean having more test cases.

The goal is to create relevant, meaningful, and risk-focused tests.

AI can provide additional ideas and help testers explore scenarios that might otherwise be missed. The tester remains responsible for understanding the system, validating AI suggestions, and deciding which scenarios provide real value.

A practical approach is:

Requirement → AI Analysis → Test Scenarios → Tester Review → Coverage Improvement

When used this way, AI becomes more than a test case generator. It becomes a test design assistant that helps testers think broader, identify gaps, and improve test coverage without replacing testing expertise.

References

  1. Microsoft Learn – Write effective prompts to achieve optimal results
    Guidance on creating effective prompts and providing clear context and instructions when working with Copilot.
  2. Microsoft Learn – Optimize prompts
    Guidance on improving prompts to achieve more relevant and useful AI-generated results.
  3. Microsoft – Responsible AI
    Information about responsible AI principles, including transparency, accountability, reliability, privacy, and human oversight.
  4. GitHub Docs – Responsible use of GitHub Copilot
    Guidance on the responsible use of GitHub Copilot and the importance of reviewing and validating AI-generated output.
  5. ISTQB – Certified Tester Foundation Level
    Reference for software testing fundamentals and test design techniques, including Equivalence Partitioning, Boundary Value Analysis, Decision Table Testing, and State Transition Testing.
  6. ISTQB – Boundary Value Analysis White Paper
    Detailed guidance on Boundary Value Analysis and how boundary conditions can be used to design effective test cases.

Picture of Ngọc lê

Ngọc lê

Hello everyone, I'm Ngoc, a Software Tester. I'm thrilled to share my experiences, insights, and challenges as a software tester in the rapidly advancing world of technology. Come along on this journey as we delve into the vital role of testers in ensuring sturdy and dependable software. Together, we will navigate the ever-changing technological landscape, exploring innovative approaches to guarantee robust software that satisfies the demands of users and businesses. Stay tuned for more valuable insights, tips, and anecdotes from the forefront of bug hunting!

Suggested Article

Scroll to Top