Bird
Raised Fist0
Testing Fundamentalstesting~6 mins

Test case components (steps, expected, actual) in Testing Fundamentals - Full Explanation

Choose your learning style10 modes available
Introduction
Imagine trying to check if a new phone app works correctly without a clear plan. You might miss important actions or misunderstand what should happen. Test case components help organize these checks clearly so anyone can follow and verify the app's behavior.
Explanation
Test Steps
Test steps are the exact actions you perform to check a feature. They guide you through what to do, like clicking buttons or entering data. Clear steps ensure anyone can repeat the test the same way.
Test steps provide a clear, repeatable path to test a feature.
Expected Result
The expected result describes what should happen after following the test steps. It sets the goal for the test, like showing a message or saving data correctly. This helps decide if the feature works as intended.
Expected results define the correct outcome to compare against.
Actual Result
The actual result is what really happens when you perform the test steps. It shows the real behavior of the feature. Comparing this with the expected result reveals if there is a problem or if the test passes.
Actual results show the real behavior to verify correctness.
Real World Analogy

Think of following a recipe to bake a cake. The test steps are the recipe instructions, the expected result is a delicious cake, and the actual result is the cake you actually bake. If the cake looks and tastes right, the recipe worked well.

Test Steps → Recipe instructions guiding each action in baking
Expected Result → The ideal cake described by the recipe
Actual Result → The cake you actually bake and taste
Diagram
Diagram
┌─────────────┐     ┌───────────────┐     ┌───────────────┐
│ Test Steps  │ ──▶ │ Expected      │ ──▶ │ Actual        │
│ (Actions)   │     │ Result        │     │ Result        │
└─────────────┘     └───────────────┘     └───────────────┘
       │                  │                   │
       └──────────────────┴───────────────────┘
                      Compare Results
Flow showing test steps leading to expected and actual results, which are then compared.
Key Facts
Test Steps → Detailed actions performed to test a feature.
Expected Result → The correct outcome anticipated after test steps.
Actual Result → The real outcome observed after executing test steps.
Test Case → A document containing test steps, expected result, and actual result.
Test Pass → When actual result matches the expected result.
Common Confusions
Believing test steps alone prove a feature works.
Believing test steps alone prove a feature works. Test steps guide the test, but only comparing actual and expected results confirms success.
Assuming expected results are flexible or vague.
Assuming expected results are flexible or vague. Expected results must be clear and specific to accurately judge test outcomes.
Recording actual results before performing test steps.
Recording actual results before performing test steps. Actual results come only after executing test steps and observing behavior.
Summary
Test steps are clear actions to follow during testing to ensure consistency.
Expected results define what should happen to know if the feature works correctly.
Actual results show what really happens and are compared to expected results to find issues.

Practice

(1/5)
1. Which component of a test case describes the actions a tester must perform?
easy
A. Test steps
B. Expected results
C. Actual results
D. Test summary

Solution

  1. Step 1: Understand test case components

    Test cases have steps, expected results, and actual results.
  2. Step 2: Identify which describes actions

    Test steps tell the tester what to do, the actions to perform.
  3. Final Answer:

    Test steps -> Option A
  4. Quick Check:

    Actions = Test steps [OK]
Hint: Steps = actions to perform in test case [OK]
Common Mistakes:
  • Confusing expected results with steps
  • Thinking actual results describe actions
  • Mixing test summary with steps
2. Which of the following is the correct way to write the expected result in a test case?
easy
A. User clicks the login button and waits.
B. Click the login button to open the login page.
C. Login page appears sometimes after clicking.
D. The system should display the login page after clicking the login button.

Solution

  1. Step 1: Identify expected result format

    Expected results describe what should happen clearly and precisely.
  2. Step 2: Compare options

    The system should display the login page after clicking the login button. clearly states the expected system behavior after an action.
  3. Final Answer:

    The system should display the login page after clicking the login button. -> Option D
  4. Quick Check:

    Expected result = clear system behavior [OK]
Hint: Expected result = clear, precise system behavior [OK]
Common Mistakes:
  • Writing steps instead of expected results
  • Being vague or uncertain in expected results
  • Mixing user actions with expected outcomes
3. Given this test case snippet:
Steps: 1. Enter username 'user1'
2. Enter password 'pass123'
3. Click 'Submit'
Expected: User is logged in and dashboard appears
Actual: Error message 'Invalid credentials'

What does this test result indicate?
medium
A. Test failed due to incorrect actual result
B. Expected result is wrong
C. Test steps are incomplete
D. Test passed successfully

Solution

  1. Step 1: Compare expected and actual results

    Expected is successful login; actual shows error message.
  2. Step 2: Determine test outcome

    Mismatch means test failed due to unexpected actual result.
  3. Final Answer:

    Test failed due to incorrect actual result -> Option A
  4. Quick Check:

    Expected ≠ Actual = Fail [OK]
Hint: If actual ≠ expected, test fails [OK]
Common Mistakes:
  • Assuming test passed despite different actual result
  • Confusing steps with results
  • Ignoring error messages in actual results
4. A tester wrote this test case:
Steps: 1. Open app
2. Click 'Settings'
Expected: Settings page opens
Actual: Settings page opens

But the test is marked as failed. What is the most likely error?
medium
A. Steps are missing details
B. Actual result was not recorded correctly
C. Expected result is unclear
D. Test case lacks test data

Solution

  1. Step 1: Check expected vs actual results

    Both say settings page opens, so results match.
  2. Step 2: Consider why test marked failed

    If test failed despite matching results, actual result might be recorded incorrectly or test status set wrongly.
  3. Final Answer:

    Actual result was not recorded correctly -> Option B
  4. Quick Check:

    Matching results but fail = recording error [OK]
Hint: Matching expected and actual means test should pass [OK]
Common Mistakes:
  • Assuming missing steps cause fail here
  • Confusing unclear expected with fail reason
  • Ignoring test status errors
5. You have a test case with these components:
Steps: 1. Add item to cart
2. Proceed to checkout
Expected: Total price updates correctly
Actual: Total price remains unchanged

How should you update the test case to better capture the issue?
hard
A. Remove actual result to avoid confusion
B. Change expected result to match actual price
C. Add detailed steps to verify price calculation and record exact actual price
D. Skip the test since actual differs from expected

Solution

  1. Step 1: Analyze test case problem

    Actual result shows a bug: price not updating as expected.
  2. Step 2: Improve test case details

    Adding detailed steps and exact actual price helps reproduce and fix the bug.
  3. Final Answer:

    Add detailed steps to verify price calculation and record exact actual price -> Option C
  4. Quick Check:

    More detail = better bug capture [OK]
Hint: Add details and exact actual results to clarify bugs [OK]
Common Mistakes:
  • Changing expected to hide bugs
  • Removing actual results loses evidence
  • Skipping tests hides problems
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard