Skip to content

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

  1. Choose one feature request from your own GitLab project. Select one small action that a user should be able to perform.

  2. 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.

  3. 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.

  4. Run the test if possible. Follow your written steps and record what happens:

  5. PASS: the actual result matches the expected result.
  6. FAIL: the actual result differs from the expected result.
  7. NOT RUN: the test could not be executed; explain why.

  8. Check your work using the checklist below. Improve any unclear parts.

  9. 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
# Test case: <Short title>

Feature issue: <Link>

Starting conditions:

- <What must already be true?>

Steps:

1. <Action and exact input>
2. <Next action>
3. <Next action, if needed>

Expected result:
<What should the user see?>

Actual result:
<What happened, or why the test was not run?>

Status: PASS / FAIL / NOT RUN

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.