Software Testing · Software Engineering

Test Case Design

Watch lectures

Test Case Design

Definition

Test Case Design is the process of creating a set of test cases — specific inputs, execution conditions, and expected outputs — systematically crafted to effectively find defects in the software with reasonable effort.

Components of a Test Case

Field Description
Test Case ID Unique identifier
Description What is being tested
Preconditions Setup needed before running the test
Test Input Specific input values
Test Steps Steps to execute the test
Expected Output What should happen if the software is correct
Actual Output What actually happened (filled during execution)
Pass/Fail Result of comparing expected vs. actual

Two Broad Approaches to Test Case Design

1. Black-Box Testing (Specification-based)

  • Test cases derived from requirements/specifications, without looking at internal code
  • Focuses on what the software should do
  • Techniques: Boundary Value Analysis, Equivalence Class Partitioning, Decision Table Testing, Cause-Effect Graphing

2. White-Box Testing (Structural/Code-based)

  • Test cases derived from the internal code structure
  • Focuses on how the software does it — covering code paths, branches, statements
  • Techniques: Path Testing (Basis Path Testing using Cyclomatic Complexity), Data Flow Testing, Statement/Branch Coverage

Why Systematic Test Case Design Matters

  • Exhaustive testing is impossible (too many input combinations) — systematic techniques find the most defects with the fewest test cases
  • Ensures good coverage without redundant tests
  • Provides traceability — each test case should map back to a specific requirement

Test Case Design Goals

  • Maximize defect detection for minimum test cases
  • Ensure coverage (of requirements for black-box, of code paths for white-box)
  • Include positive tests (valid input, expected behavior) and negative tests (invalid input, error handling)

Exam tip: Know the Black-Box vs White-Box distinction clearly (specification-based vs. code-based), and be ready to list at least 2 techniques under each — this framework organizes almost every other topic in this module.

Free AppAndroid App

Coursify Android App

Generate AI courses, take quick quizzes between classes, and master complex engineering concepts on the go.

← All Software Engineering modules