Your First Test Case for a Feature¶
Goal¶
Write one simple manual test case to check whether a feature delivers what its users expect.
Work as a team. Allow approximately 15–20 minutes.
First, Read This Example¶
Suppose a feature request says:
Clicking "Add to cart" adds one unit of the selected product to the shopping cart.
A test case for this feature could be:
- Starting conditions: The application is running, the cart is empty, and the product "Demo Book" is available.
- Step 1: Open the "Demo Book" product page.
- Step 2: Click "Add to cart" once.
- Step 3: Open the shopping cart.
- Expected result: The cart contains "Demo Book" with quantity 1.
The expected result describes what the feature request promises. The actual result must be recorded after running the test.
Your Task¶
-
Choose one feature request from your own GitLab project. Select one small action that a user should be able to perform.
-
Write down the promise: Complete this sentence using the request: "When the user ..., the application should ...". If the request is unclear, record a clarification question in the issue and choose a clearer part of the feature. Do not guess requirements.
-
Copy and fill in the template below. Replace every placeholder. Use exact input values and short, numbered actions. The shopping-cart example shows the level of detail needed.
-
Run the test if possible. Follow your written steps and record what happens:
- PASS: the actual result matches the expected result.
- FAIL: the actual result differs from the expected result.
-
NOT RUN: the test could not be executed; explain why.
-
Check your work using the checklist below. Improve any unclear parts.
-
Save the test as
docs/testing/test_cases/tc_feature_<issue-id>.md, replacing<issue-id>with your feature issue number. Link the file from that issue and the project README.
Template¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | |
Self-Check¶
Before finishing, check that:
- The test refers to a specific feature request.
- The starting conditions and input values are clear.
- The steps say exactly what to do.
- The expected result describes an observable outcome, rather than simply saying "it works".
- The actual result is based on execution, or NOT RUN has an explanation.
- The test file is linked from the issue and README.
Optional Challenge¶
Create a second test for a different situation already described in the feature request.