What is the test case?
A test case is a series of operations designed to verify software functionality. A test case should include test steps, test data, preconditions, postconditions, and special test scenarios. It may also be necessary to consider whether the software can meet the user's use from the user's point of view.
How to write test cases?
This article will introduce how to write standard test cases, follow the steps below:
Create Test Scenario
Let's create a Test Case for the scenario: Check Login Functionality
Create a test case for the user login scenario:
Step 1) A simple test case to explain the scenario would be (a test scenario described by a test case)
Test Case | Test Case Description |
---|---|
1 | Check response when valid email and password is entered |
Step 2) Test the Data.
In order to execute the test case, you would need Test Data. Adding it below
Test Case | Test Case Description | Test Data |
---|---|---|
1 | Check response when valid email and password is entered | Email: guru99@email.com Password: lNf9^Oti7^2h |
Step 3) Perform actions.
In order to execute a test case, a tester needs to perform a specific set of actions on the AUT. This is documented as below: (test steps)
Test Case | Test Case Description | Test Steps | Test Data |
---|---|---|---|
1 | Check response when valid email and password is entered | 1) Enter Email Address 2) Enter Password 3) Click Sign in | Email: guru99@email.com Password: lNf9^Oti7^2h |
Step 4) Check behavior of the AUT.
The goal of test cases in software testing is to check behavior of the AUT for an expected result. This needs to be documented as below.
Test Case | Test Case Description | Test Steps | Test Data | Expected Result |
---|---|---|---|---|
1 | Check response when valid email and password is entered | 1) Enter Email Address 2) Enter Password 3) Click Sign in | Email: guru99@email.com Password: lNf9^Oti7^2h | Login should be successful |
During test execution time, the tester will check expected results against actual results and assign a pass or fail status
During execution, the tester will check whether the expected result is the same as the true result to decide whether the test case passes or not.
Test Case | Test Case Description | Test Steps | Test Data | Expected Result | Actual Result | Pass/Fail |
---|---|---|---|---|---|---|
1 | Check response when valid email and password is entered | 1) Enter Email Address 2) Enter Password 3) Click Sign in | Email: guru99@email.com Password: lNf9^Oti7^2h | Login should be successful | Login was successful | Pass |
Step 5) Running conditions Pre-conditions for the test case to run (for example: xxx needs to be installed before testing), post-conditions (for example: how long does it take for the test case to finish running, the xxx data should have been stored in the database) )
Conditions for high-quality test cases
Best Practice for writing good Test Case Example.
- simple and transparent
- Create test cases using user thinking
- avoid repetition
- Don't make assumptions
- 100% coverage
- Test case ID is unique
- Good at using test techniques: Boundary Value Analysis (BVA) edge analysis, Equivalence Partition (EP) and other class divisions, State Transition Technique state transition, Error Guessing Technique error prediction This comparison depends on the experience of the tester
- Peer Review
Tool recommendation
Test management tools can help testers manage and maintain test cases. Has the following features:
- Easily create test templates with tools
- Convenient execution of use cases to record test results
- Use cases that fail the test are automatically submitted to developers to track bugs
- Traceable, more convenient statistical test coverage
Popular Test Management tools are: Quality Center and JIRA
Popular test management tools are uality Center and JIRA
refer to
How to Write Test Cases: Sample Template with Examples
Sample Test Case Template With Test Case Examples
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。