Home »
AI Prompts Tutorial
AI Prompts for Software Testing
AI can help software testers with test planning, test case generation, test data preparation, bug analysis, automation, regression testing, API testing, performance testing, and test reporting. Well-designed prompts can help testers organize requirements and create structured testing scenarios.
In this chapter, you will learn 51 practical AI prompts for software testing. These prompts cover different stages of the testing process, including test case creation, functional testing, API testing, UI testing, automation, performance testing, security testing, defect analysis, and test documentation.
1. Generate Test Cases From Requirements
Requirements provide the foundation for deciding what an application should do. AI can convert functional requirements into structured test cases that testers can review and execute.
Example
Generate test cases for the following requirement:
Requirement:
Users should be able to log in using a valid email address
and password.
Include:
- Test case ID
- Test scenario
- Preconditions
- Test steps
- Test data
- Expected result
- Priority
Include positive and negative test cases.
2. Generate Positive Test Cases
Positive testing verifies that an application works correctly when valid inputs and expected conditions are provided. AI can generate normal usage scenarios based on the requirements.
Example
Generate positive test cases for an online registration form.
Fields:
- Name
- Email
- Password
- Confirm password
- Phone number
Use valid input values and describe the expected result
for each test case.
3. Generate Negative Test Cases
Negative testing checks how an application behaves when invalid, unexpected, or incomplete information is provided. AI can generate scenarios that help testers verify error handling and validation.
Example
Generate negative test cases for a login page.
Test conditions:
- Empty email
- Empty password
- Invalid email
- Incorrect password
- Both fields empty
- Unsupported characters
For each test case provide the expected behavior.
4. Generate Boundary Value Test Cases
Boundary value analysis focuses on values at the edges of an allowed range. AI can generate test cases for minimum, maximum, just-below, and just-above boundary conditions.
Example
Generate boundary value test cases for a username field.
Requirement:
Username must contain between 5 and 20 characters.
Generate test cases for:
- 4 characters
- 5 characters
- 6 characters
- 19 characters
- 20 characters
- 21 characters
Provide the expected result for each case.
5. Generate Equivalence Partitioning Test Cases
Equivalence partitioning divides input data into groups that are expected to behave similarly. AI can identify valid and invalid partitions and generate representative test cases.
Example
Create equivalence partitioning test cases for an age field.
Requirement:
Users must be between 18 and 60 years old.
Identify:
- Valid partition
- Invalid partitions
Provide representative test values and expected results.
6. Generate UI Test Cases
UI testing verifies that application interfaces behave correctly from a user's perspective. AI can generate test cases for buttons, forms, menus, navigation, validation messages, and other interface elements.
Example
Generate UI test cases for an e-commerce checkout page.
Test:
- Product quantity
- Address fields
- Payment method
- Coupon field
- Place order button
- Error messages
- Navigation
Include positive, negative, and boundary scenarios.
7. Generate Functional Test Cases
Functional testing verifies whether an application performs the functions defined by its requirements. AI can convert feature descriptions into structured functional test scenarios.
Example
Generate functional test cases for a password reset feature.
Requirements:
- User enters registered email.
- System sends a reset link.
- User opens the link.
- User enters a new password.
- Password is updated successfully.
Include positive and negative scenarios.
8. Generate Regression Test Cases
Regression testing checks whether existing functionality continues to work after application changes. AI can identify important existing scenarios that should be included in a regression suite.
Example
Create a regression test suite for an e-commerce application.
Major features:
- Login
- Product search
- Product details
- Cart
- Checkout
- Payment
- Order history
Prioritize the test cases based on business importance.
9. Create Smoke Test Cases
Smoke testing provides a quick check that the most important application functions are working. AI can create a short smoke test suite covering critical workflows.
Example
Create a smoke test suite for a web application.
Verify:
- Application loads
- User can log in
- Dashboard opens
- Search works
- Main form can be submitted
- User can log out
Keep the suite small and focused on critical functionality.
10. Create Sanity Test Cases
Sanity testing focuses on a specific area after a change or fix. AI can create targeted test cases based on the functionality that was modified.
Example
Create sanity test cases for a bug fix related to
password reset.
The fix changed:
- Password validation
- Reset token handling
- Password update process
Create focused test cases to verify the affected functionality.
11. Generate API Test Cases
API testing verifies that backend endpoints accept valid requests, reject invalid requests, and return the expected responses. AI can generate API test scenarios based on endpoint specifications.
Example
Generate test cases for this REST API:
POST /api/users
Request:
{
"name": "John",
"email": "[email protected]",
"password": "Password123"
}
Test:
- Valid request
- Missing fields
- Invalid email
- Duplicate email
- Invalid password
- Malformed JSON
Include expected status codes and response behavior.
12. Generate API Negative Test Cases
API negative testing verifies that endpoints handle invalid requests safely and predictably. AI can create cases involving missing parameters, invalid data types, malformed requests, and unauthorized access.
Example
Generate negative test cases for:
GET /api/products/{id}
Test:
- Missing ID
- Non-numeric ID
- Negative ID
- Very large ID
- Non-existent product
- Unauthorized request
- Invalid authentication token
Provide the expected response for each scenario.
13. Generate API Validation Test Cases
API validation ensures that the server correctly validates request data. AI can create test cases for required fields, formats, lengths, ranges, and data types.
Example
Generate API validation test cases for a user registration endpoint.
Fields:
- name: required, 2-100 characters
- email: required, valid email
- age: integer between 18 and 100
- password: minimum 8 characters
Test valid and invalid values for every field.
14. Generate Postman Test Scripts
Postman can be used to automate API validation and response checks. AI can generate JavaScript test scripts when the expected response structure and conditions are provided.
Example
Write a Postman test script for this API response.
Requirements:
- Status code must be 200.
- Response must contain a "user" object.
- User must contain "id" and "email".
- Response time should be below 1000 ms.
Provide the complete Postman test script.
15. Generate Selenium Test Cases
Selenium is widely used for browser automation. AI can create Selenium test scripts based on the webpage elements, workflow, programming language, and expected behavior.
Example
Create a Selenium test using Python and pytest.
Test scenario:
User logs into a website.
Steps:
1. Open the login page.
2. Enter email.
3. Enter password.
4. Click Login.
5. Verify that the dashboard is displayed.
Use explicit waits where appropriate.
Include basic error handling.
16. Generate Playwright Test Cases
Playwright can automate modern web applications across multiple browsers. AI can create Playwright tests when the page flow and expected results are clearly described.
Example
Create a Playwright test using JavaScript.
Scenario:
Search for a product on an e-commerce website.
Steps:
- Open the website.
- Enter "laptop" in the search box.
- Submit the search.
- Verify that search results are displayed.
- Verify that the results contain the search term.
17. Generate Cypress Test Cases
Cypress is another popular framework for frontend and end-to-end testing. AI can generate Cypress tests based on user workflows and expected UI behavior.
Example
Create a Cypress test for a registration form.
Verify:
- Valid registration
- Required field validation
- Invalid email
- Password mismatch
- Successful registration message
Use clear test names and assertions.
18. Generate Unit Test Cases
Unit testing checks individual functions, methods, or components in isolation. AI can generate unit tests when the implementation and expected behavior are provided.
Example
Generate unit tests for the following Python function.
Test:
- Normal values
- Zero
- Negative values
- Empty input
- Invalid input
Use pytest.
[Paste function here]
19. Generate Integration Test Cases
Integration testing verifies that multiple components work correctly together. AI can identify scenarios involving databases, APIs, services, modules, and external dependencies.
Example
Generate integration test cases for a user registration system.
Components:
- Registration API
- User service
- Database
- Email service
Verify:
- Successful registration
- Database record creation
- Email generation
- Duplicate user handling
- Failure handling
20. Generate End-to-End Test Cases
End-to-end testing verifies complete workflows from the user's perspective. AI can generate scenarios that cover multiple application components in a realistic sequence.
Example
Create end-to-end test cases for an online shopping application.
Workflow:
1. User logs in.
2. Searches for a product.
3. Opens the product.
4. Adds it to the cart.
5. Proceeds to checkout.
6. Enters shipping details.
7. Completes payment.
8. Verifies the order confirmation.
Include positive and failure scenarios.
21. Generate Test Data
Good test data is important for testing different application conditions. AI can create structured test data based on field types, validation rules, and business requirements.
Example
Generate test data for a user registration form.
Fields:
- Name
- Email
- Phone
- Age
- Password
Provide:
- 10 valid records
- 10 invalid records
- Boundary values
- Empty values
- Special character cases
Use fictional data only.
22. Generate Boundary Test Data
Boundary test data focuses on values around the minimum and maximum allowed limits. AI can generate precise boundary cases from validation requirements.
Example
Generate boundary test data for a product quantity field.
Requirement:
Quantity must be between 1 and 100.
Generate values for:
- Below minimum
- Minimum
- Just above minimum
- Middle value
- Just below maximum
- Maximum
- Above maximum
23. Generate Test Scenarios From User Stories
User stories describe functionality from the user's perspective. AI can transform user stories and acceptance criteria into test scenarios covering expected and unexpected behavior.
Example
Generate test scenarios from this user story:
"As a customer, I want to save products to my wishlist
so that I can purchase them later."
Acceptance criteria:
- Logged-in users can add products.
- Users can remove products.
- Wishlist persists after logout.
- Duplicate products cannot be added.
Include positive and negative scenarios.
24. Generate Acceptance Test Cases
Acceptance testing verifies whether a feature meets business requirements. AI can convert acceptance criteria into test cases that can be reviewed by testers and business stakeholders.
Example
Create acceptance test cases for an online payment feature.
Requirements:
- User can select a payment method.
- Valid payment completes the order.
- Failed payment displays an error.
- Order status is updated correctly.
- Payment confirmation is shown.
Write test cases in a business-friendly format.
25. Generate Exploratory Testing Ideas
Exploratory testing allows testers to investigate an application without following only predefined scripts. AI can suggest areas, behaviors, and unusual workflows that testers may explore manually.
Example
Generate exploratory testing ideas for an e-commerce checkout page.
Explore:
- Navigation
- Input fields
- Back button
- Refresh behavior
- Session expiration
- Multiple tabs
- Slow network
- Invalid data
- Unexpected user actions
Focus on scenarios that may reveal usability or functional issues.
26. Generate Usability Test Cases
Usability testing evaluates how easily users can understand and interact with an application. AI can create scenarios that focus on navigation, clarity, consistency, and user experience.
Example
Generate usability test cases for a banking dashboard.
Evaluate:
- Navigation clarity
- Menu labels
- Readability
- Error messages
- Button visibility
- Transaction flow
- Mobile usability
For each test case provide the expected usability outcome.
27. Generate Accessibility Test Cases
Accessibility testing checks whether applications can be used by people with different abilities and assistive technologies. AI can help create an accessibility testing checklist based on the application's interface.
Example
Generate accessibility test cases for a web application.
Check:
- Keyboard navigation
- Focus indicators
- Form labels
- Image alternative text
- Color contrast
- Heading structure
- Error messages
- Screen reader compatibility
Organize the test cases by accessibility area.
28. Generate Cross-Browser Test Cases
Web applications can behave differently across browsers and browser versions. AI can help create a cross-browser testing matrix based on the target audience and supported platforms.
Example
Create a cross-browser testing matrix for a web application.
Test on:
- Chrome
- Firefox
- Edge
- Safari
Platforms:
- Windows
- macOS
- Android
- iOS
Include:
- Browser
- Platform
- Priority
- Main functionality to verify
29. Generate Responsive Testing Scenarios
Responsive testing verifies that a website works correctly across different screen sizes and devices. AI can create scenarios for layouts, navigation, forms, images, and interactive elements.
Example
Generate responsive testing scenarios for a website.
Test screen sizes:
- 320px
- 480px
- 768px
- 1024px
- 1440px
Verify:
- Navigation
- Images
- Text
- Forms
- Buttons
- Tables
- Horizontal scrolling
30. Generate Performance Test Scenarios
Performance testing evaluates how an application behaves under different workloads. AI can help create scenarios for response time, throughput, concurrency, and resource usage.
Example
Create performance test scenarios for an online shopping website.
Test:
- Normal traffic
- High traffic
- Concurrent users
- Product search
- Checkout
- Login
- API response time
For each scenario define:
- Objective
- Load
- Metric
- Expected result
31. Generate Load Test Scenarios
Load testing evaluates application behavior under an expected number of concurrent users or requests. AI can create a structured load testing plan based on expected usage.
Example
Create a load testing plan for a REST API.
Expected traffic:
1,000 concurrent users.
Endpoints:
- Login
- Product search
- Product details
- Order creation
Define:
- Test duration
- Ramp-up strategy
- Requests per second
- Response time metrics
- Error rate metrics
32. Generate Stress Test Scenarios
Stress testing pushes a system beyond normal expected conditions to understand how it behaves under extreme load. AI can help define a safe test plan for an authorized test environment.
Example
Create a stress testing plan for an authorized staging environment.
Application:
Online learning platform.
Gradually increase concurrent users beyond the expected
maximum load.
Monitor:
- Response time
- Error rate
- CPU usage
- Memory usage
- Database performance
Define stopping conditions and recovery checks.
33. Generate Regression Automation Scenarios
Automating repetitive regression tests can reduce manual testing effort. AI can identify stable, high-value test cases that are suitable candidates for automation.
Example
Review the following regression test cases.
Identify which tests are good candidates for automation.
Consider:
- Execution frequency
- Stability
- Repetitive steps
- Business importance
- Automation complexity
Return:
- Test case
- Automation suitability
- Reason
- Suggested automation priority
[Paste test cases here]
34. Generate Bug Reports
A clear bug report helps developers understand and reproduce a problem. AI can convert tester notes into a structured defect report with steps, expected behavior, actual behavior, and environment details.
Example
Create a professional bug report from the following notes.
Include:
- Bug title
- Description
- Environment
- Preconditions
- Steps to reproduce
- Expected result
- Actual result
- Severity
- Priority
- Reproducibility
Tester notes:
[Paste notes here]
35. Improve a Bug Report
Incomplete bug reports can slow down the debugging process. AI can review an existing report and identify missing information that would help developers reproduce and investigate the issue.
Example
Review the following bug report.
Identify missing or unclear information related to:
- Reproduction steps
- Expected behavior
- Actual behavior
- Environment
- Test data
- Frequency
- Screenshots or logs
Suggest specific improvements without changing confirmed facts.
[Paste bug report here]
36. Analyze a Defect
AI can help organize information about a defect and identify possible areas for investigation. It should not be treated as a replacement for debugging or source-code analysis.
Example
Analyze the following defect information.
Identify:
- Observed behavior
- Expected behavior
- Conditions under which it occurs
- Possible affected components
- Information needed for further investigation
Do not claim a root cause unless supported by evidence.
[Paste defect information here]
37. Generate Root Cause Analysis Questions
Root cause analysis helps teams understand why a defect or failure occurred. AI can generate structured questions that guide developers and testers through the investigation process.
Example
Generate root cause analysis questions for a production
application failure.
Consider:
- Recent code changes
- Configuration changes
- Dependencies
- Database changes
- Infrastructure
- Traffic changes
- Monitoring
- Deployment process
- Testing gaps
Group the questions by investigation area.
38. Generate Test Automation Framework Structure
A structured automation framework makes automated tests easier to maintain and expand. AI can suggest folders, utilities, page objects, test data, reports, and configuration files based on the chosen technology.
Example
Design a Selenium automation framework using Python and pytest.
Include:
- Page objects
- Test cases
- Test data
- Configuration
- Utilities
- Screenshots
- Reports
- Logging
Show the recommended folder structure and explain each folder.
39. Generate Page Object Model Code
The Page Object Model separates webpage interactions from test logic. AI can create page classes when the page elements and actions are provided.
Example
Create a Selenium Page Object Model class for a login page.
Elements:
- Email field
- Password field
- Login button
- Error message
Methods:
- enter_email()
- enter_password()
- click_login()
- get_error_message()
Use Python and Selenium.
40. Generate Test Automation Data
Automated tests often need repeatable and varied input data. AI can create fictional test datasets that cover valid, invalid, boundary, and special cases.
Example
Generate a CSV test dataset for a registration automation suite.
Columns:
name,email,password,expected_result
Include:
- 10 valid records
- 10 invalid records
- Boundary cases
- Missing values
- Invalid email formats
Use fictional data only.
41. Generate Test Scenarios for Mobile Applications
Mobile applications have device-specific behaviors such as orientation changes, permissions, network changes, and interruptions. AI can generate mobile test scenarios based on the application's features.
Example
Generate test scenarios for a mobile banking application.
Test:
- Login
- Account balance
- Money transfer
- Notifications
- Permissions
- Network changes
- Screen rotation
- Background and foreground behavior
- Session timeout
Include positive and negative scenarios.
42. Generate Mobile Compatibility Tests
Mobile applications need to work across different devices, operating systems, screen sizes, and configurations. AI can help create a device compatibility matrix based on the supported platforms.
Example
Create a mobile compatibility testing matrix.
Platforms:
- Android
- iOS
Consider:
- Operating system versions
- Screen sizes
- Device categories
- Network conditions
- Orientation
Assign testing priority based on expected user coverage.
43. Generate Security Test Cases
Security testing checks whether an application handles authentication, authorization, input validation, session management, and sensitive data appropriately. AI can create defensive security test scenarios for authorized applications.
Example
Generate security test cases for a web application's login system.
Test:
- Authentication
- Authorization
- Session management
- Password reset
- Account lockout
- Input validation
- Sensitive information exposure
Focus on defensive testing in an authorized test environment.
44. Generate SQL Database Test Cases
Database testing verifies data integrity, constraints, relationships, and CRUD operations. AI can generate test cases from a database schema and application requirements.
Example
Generate database test cases for an order management system.
Tables:
- customers
- products
- orders
- order_items
Verify:
- Primary keys
- Foreign keys
- Required fields
- Duplicate records
- Referential integrity
- Insert operations
- Update operations
- Delete behavior
45. Generate Data Integrity Test Cases
Data integrity testing verifies that information remains accurate and consistent as it moves through an application. AI can identify scenarios that could cause incorrect or inconsistent data.
Example
Create data integrity test cases for an order processing system.
Verify:
- Order totals
- Product quantities
- Customer information
- Payment status
- Inventory updates
- Order status
Check data before and after each major operation.
46. Generate Test Cases From API Documentation
API documentation often contains endpoints, parameters, authentication requirements, and response formats. AI can convert this information into a structured API test suite.
Example
Generate API test cases from the following API documentation.
For every endpoint include:
- Positive tests
- Negative tests
- Authentication tests
- Validation tests
- Boundary tests
- Expected status codes
- Expected response structure
[Paste API documentation here]
47. Generate Test Coverage Analysis
Test coverage analysis helps teams identify requirements or features that are not adequately tested. AI can compare requirements with existing test cases and identify potential gaps.
Example
Analyze the following requirements and test cases.
Identify:
- Requirements without test coverage
- Requirements with partial coverage
- Duplicate test cases
- Missing negative scenarios
- Missing boundary scenarios
Return a coverage matrix.
Requirements:
[Paste requirements]
Test cases:
[Paste test cases]
48. Create a Test Plan
A test plan defines the scope, objectives, resources, environments, risks, and approach for a testing project. AI can create an initial test plan based on the application and project requirements.
Example
Create a software testing plan for an online shopping application.
Include:
- Testing objectives
- Scope
- Out of scope
- Test types
- Test environment
- Test data
- Entry criteria
- Exit criteria
- Risks
- Responsibilities
- Deliverables
Use a professional testing format.
49. Create a Test Summary Report
A test summary report communicates the results of a testing cycle to stakeholders. AI can organize test execution information into a concise report containing results, defects, coverage, risks, and recommendations.
Example
Create a test summary report from the following test results.
Include:
- Testing period
- Total test cases
- Passed
- Failed
- Blocked
- Not executed
- Defects found
- Critical issues
- Test coverage
- Remaining risks
- Recommendation
[Paste test execution data here]
50. Create a Test Automation Strategy
A test automation strategy defines which tests should be automated, which tools should be used, and how the automation suite should be maintained. AI can help organize an initial strategy based on project requirements.
Example
Create a test automation strategy for a web application.
Application:
E-commerce platform.
Testing areas:
- UI
- API
- Database
- Regression
- Smoke testing
Include:
- Automation scope
- Recommended tools
- Framework structure
- Test data strategy
- CI/CD integration
- Reporting
- Maintenance approach
- Risks
51. Create a Complete Software Testing Strategy
A complete testing strategy combines different testing levels and techniques to verify software quality. AI can help create an initial strategy based on the application's architecture, users, risks, and business requirements.
Example
Create a complete software testing strategy for a web-based
e-commerce application.
Include:
- Unit testing
- Integration testing
- Functional testing
- UI testing
- API testing
- Regression testing
- Smoke testing
- Performance testing
- Security testing
- Accessibility testing
- Cross-browser testing
- Mobile testing
- Test automation
- Defect management
- Test reporting
For each testing area provide:
- Objective
- Scope
- Suggested approach
- Important test scenarios
- Recommended tools
Organize the strategy into clear sections.
General AI Prompt Template for Software Testing
A reusable software testing prompt can help testers provide the AI model with the application context, requirements, testing objective, and expected output. This template can be adapted for test case generation, automation, API testing, UI testing, defect analysis, and test planning.
Example
Role:
Act as a senior software testing engineer.
Application:
[Describe the application]
Feature:
[Describe the feature being tested]
Requirements:
[Paste requirements or user stories]
Testing Objective:
[Describe what needs to be verified]
Test Type:
[Functional, regression, API, UI, performance, etc.]
Requirements:
- Include positive scenarios.
- Include negative scenarios.
- Include boundary cases where applicable.
- Identify assumptions.
- Do not invent requirements.
Expected Output:
[Describe the required test case or report format]
Additional Information:
[Add environment, platform, browser, API, database, or other details]
Advertisement
Advertisement