Summary of "How To Write A Test Case? | Test Case In Software Testing | Software Testing Tutorial | Edureka"

How to Write a Test Case — Summary

Main ideas and lessons

Software testing aims to find bugs before release to improve quality and reduce cost and time. Good documentation (requirements and test artifacts) is critical: it provides traceability, a single source of truth, and legal/business protection (for example, resolving disputes about compatibility or scope).

Three levels of test documentation (from most to least detailed): - Test script — line-by-line steps and data (very detailed; may include expected results per step). - Test case — describes what to test (the expected feature/behavior) without prescribing exact step-by-step actions; allows tester flexibility. - Test scenario — high-level user activity or condition to test; minimal detail and maximum tester flexibility.

Primary goal of a test case:

Validate that features work as expected under specified conditions, improve coverage, enable reusability, reduce maintenance/support cost, and ensure the product meets end-user requirements.


Test case structure — typical fields

A standard test case typically includes:

Optional/additional fields: - Priority, test type (positive/negative), bug ID, reviewer, creation/execution dates, etc.


Test case design techniques

Three major categories:

  1. Specification-based (Black-box)

    • Derive tests from requirements/specs.
    • Common techniques:
      • Boundary Value Analysis (BVA)
      • Equivalence Partitioning (EP)
      • Decision Table Testing
      • State Transition Testing (use state-transition diagrams)
      • Use Case Testing (business scenarios / end-user flows)
  2. Structure-based (White-box)

    • Derive tests from the internal code structure.
    • Common techniques:
      • Statement coverage
      • Decision / Branch coverage
      • Condition coverage
      • Multiple condition testing
      • Path coverage
  3. Experience-based

    • Rely on tester skill and product knowledge.
    • Common approaches:
      • Error guessing
      • Exploratory testing (design and execution happen concurrently)

Characteristics of a good test case

A good test case is: - Accurate — has a clear purpose. - Traceable — mapped to requirements. - Repeatable — can be run multiple times with the same result. - Reusable — can be used in future tests. - Independent — can run in any order without dependencies.


Guidelines and best practices


Common mistakes and how to avoid them


Step-by-step process to create test cases

  1. Prepare

    • Check for existing equivalent test cases; update if appropriate.
    • Understand the characteristics of a good test case.
    • Consider likely user scenarios and think from the customer’s perspective.
    • Allocate sufficient time for writing and review.
  2. Select tooling

    • Choose Excel or a spreadsheet for simple/manual workflows, or a test management tool (TestLink, TestRail) for more scale.
  3. Write test cases using a template that includes the standard fields listed above.

  4. Write a concise test case statement — a one-line summary of what you verify, the conditions, inputs, and expected outcome.

  5. Review test cases

    • Ensure steps and expected results align, remove duplicates, and ensure traceability to requirements.

Examples (condensed)

Login functionality — valid credentials - Preconditions: (none) or valid credentials available. - Steps: navigate to login page → enter username → enter password → click login. - Test data: valid username and password. - Expected result: login dialog visible, credentials accepted, user logged in. - Actual result / Status: recorded per step; overall Pass if all expected == actual.

Login functionality — invalid credentials - Steps same as above. - Test data: invalid username and/or password. - Expected result: navigation & data entry succeed; login fails and an appropriate error is shown. - Status: Pass if actual matches expected (i.e., the system correctly rejects login).

Upload photo — logged-in user - Preconditions: user logged in. - Steps: click upload photo link → select photo → click upload. - Expected: upload dialog opens, photo selected, photo uploaded successfully.

Upload photo — not logged-in user - Preconditions: user not logged in. - Expected: upload action should be prevented and an appropriate message shown (test should fail early or show appropriate error).


Practical tips


Sources / Speakers

Category ?

Educational


Share this summary


Is the summary off?

If you think the summary is inaccurate, you can reprocess it with the latest model.

Video