Test Case Design Techniques: How to Choose the Right Approach

June 04, 2026 · 14 min read · Testing Guide

Blog / Insights /
Test Case Design Techniques: How to Choose the Right Approach

Test Case Design Techniques: How to Choose the Right Approach

QA Consultant Updated on

Learn with AI

Linkedin

Facebook

X (Twitter)

Mail

Learn with AI

The first step is often the hardest, and in software quality engineering, this is especially true. When exhibit with a system, how do you go about and determinewhat to test? Standing in the middle of the unidentified, we need guidance, and learning abouttest cause design proficiencyis a good spot to start. As software complexness scales with AI-integrated characteristic, these proficiency ensure your coverage is both deep and efficient.

In this article, we ’ ll display you:

  • 2 types of software system: black-box and white-box, each necessitate a unique attack to essay lawsuit plan
  • Techniques to design test instance for each system
  • Best practices for each types of system

& nbsp; Let ’ s dive in!

Black-box System vs White-box System


To design a test lawsuit, you first require to considerthe opacity of the system.

At one end of the spectrum, we have a & nbsp;black-box system. Testers don ’ t know its internal code structure or internal mechanics. All they know is what the system can fulfil and what we can put in it. To an end-user without proficient knowledge, the system is a black box.If you are working with a system where the home code is hidden, you are doblack box testing.

At the other end of the spectrum, we have a & nbsp;white-box system. Testers feature full knowledge of its internal codification structure. & nbsp;

In the middle we have the gray box. Testers have partial knowledge of the internal code structure. In practice, most scheme in real-world coating can be study a “ gray box ”.

For example, only by sail to any random website and using its lineament, you are interact with a black-box system. However, as soon as you right-click on a blank space on the screen and chooseInspect,you ’ ll get to see the HTML codification behind it. The website is now a gray box to you.

To the web developers behind the site, it is a white box, since they have full approach to the source code.

Modern caliber engineering has evolved. According toIBM, adopting a `` Shift-Left '' mindset, where quiz blueprint starts during the requirements phase, can prevent shortcoming that cost15x more to fix if get after release.

How to Choose the Right Test Case Design Technique

Knowing the techniques is only half the challenge, & nbsp; the other half is cognise which one to reach for. Use this three-step framework before you start designing any tryout suite.

Step 1 — Determine scheme opacity

  • No code entree?→ Use black-box techniques
  • Full code access?→ Use white-box technique
  • Fond code admittance?→ Combine both approaches

Step 2 — Match proficiency to input type

Your stimulant / scheme characteristics

Recommended technique

Inputs with defined valid/invalid value cast

Inputs where fault cluster at scope boundaries

Complex occupation prescript with multiple interacting conditions

Many configurable parameters or environments

Pairwise Testing

Code itinerary, branches, and performance logic

Control Flow Testing / Structured Testing

Step 3 — Consider your resource restraint

  • Tight timeline?Prioritize Pairwise or Equivalence Class Partitioning to cut test volume first.
  • High-risk system?Layer Boundary Value Analysis on top of comparability class for edge coverage.
  • Complex conditional logic?Decision Tables afford you full traceability from requirements to test cases.
  • Code caliber review needed?Cyclomatic Complexity tells you where white-box effort should be concentrated.

Test Case Design Techniques For Black-box System

The following techniques use when you have no admission to the system 's intragroup code: & nbsp; you are essay from the outside, based on inputs and expected outputs. For entire definitions, worked model, best practices, and edge instance for each technique, see the.

1. Equivalence Class Testing

Equivalence Class Testing, besides called Equivalence Partitioning, is ablack-box testing proficiencydesigned to denigrate the number of test cases while ensuring adequate coverage.

In this method, remark data is divided intoequation classes or divider. Each stratum symbolize a group of stimulant that the system should handle in the same way.

From each equivalence class, one or more representative values are choose for testing. These value are expected to produce the same effect as any other value in the same grade, reducing the need to test every potential input.

There are typically two types of compare family:

  • Valid Equivalence Class: Inputs that the system should accept and treat correctly.
  • Invalid Equivalence Class: Inputs that the scheme should reject or handle differently.

For illustration, a password field requiring 8–20 fibre gives you three classes: valid (8–20 chars, e.g. `` Pa55word! ``), too short (& lt; 8 chars, e.g. `` abc ''), and too long (& gt; 20 chars, e.g. `` thispasswordistoolong123 ''). One representative from each class, & nbsp; three exam suit instead of century.

An equivalence class is only as good as its predictability. If one stimulant in the group uncovers a bug (or passes), its counterparts will belike do the same. This means you only postulate one representative test case per class, & nbsp; let you to cut your test suite size without sacrificing reporting.

Best for: numeric ranges, date fields, string length constraints, number types, any input domain with clear valid/invalid edge.

📚Full step-by-step walkthrough, best practices, edge cases, and AI prove integration: 

2. Boundary Value Analysis

Boundary value analysis is an extension of comparison partitioning testing, with a focus on the boundaries between equivalence classes. The nucleus thought is that errors are more likely to occur at the edges of input roll rather than in the middle, making boundary testing crucial.

Building on the password field example: a field take 8–20 characters has two boundaries. BVA produces test cases at the 6 most critical value: just below the lower boundary (7 chars), at the lower limit (8 char), just above (9 chars), just below the upper boundary (19 chars), at the upper boundary (20 chars), and just above (21 charr). These six values are where off-by-one errors, fence-post bug, and boundary logic failure are most probable to hide.

Best for: any system with defined minimum and maximum input limit — always duad with Equivalence Class Partitioning for complete remark coverage.

📚Complete BVA process, three-step methodology, and combination with ECP: 

3. Decision Table Testing

Decision Table Testing is a black-box examination proficiency that uses a decision table to map diverse stimulus combinations to their corresponding output.

Key concepts of a decision table include:

  • Condition:Input variables that influence system demeanor
  • Action:Outcomes based on combination of conditions
  • Rule:A specific combination of conditions and their resulting actions

 

Rule-1

Rule-2

[...]

Rule-p

Conditions

 

 

 

 

Condition-1

 

 

 

 

Condition-2

 

 

Pro tip: Tools like SUSA can handle this autonomously — upload your app and get results without writing a single test script.

 

 

...

 

 

 

 

Condition-m

 

 

 

 

Actions

 

 

 

 

Action-1

 

 

 

 

Action-2

 

 

 

 

...

 

 

 

 

Action-n

 

 

 

 

Consider an e-commerce discount system with two conditions: rank status (Member/ Guest) and cart value (above or below $ 50). This produces four regulation: four distinct tryout cases - & nbsp; each mapping a condition combination to its expected discount result. Each rule column is one test case, and the table makes it directly seeable if any combination has been lose.

Decision table examination is particularly utilitarian for system enforce complex business rules that can be typify as combination of conditions.

Best for: eligibility logic, pricing locomotive, access control convention, any system where multiple conditions combine to determine an outcome.

📚Full decision table templates, worked examples, and best practices: 

4. Pairwise Testing

Pairwise examination is a black-box testing technique that focuses on try combinations of two inputs at a clip. Instead of testing every possible combination, this method assist reduce the number of tests while even providing good coverage.

Testing every combination of OS, browser, and network is physically impossible for rapid release cycles.Gartnerpredicts that by 2027, 80 % of enterprise will integrate AI-augmented testing tools to automatise complex tasks like pairwise optimization, aid squad move from unproblematic execution to strategical orchestration.

Let 's look at a brief case study to illustrate the potency of pairwise testing: a package company is germinate a new e-commerce platform. The program necessitate to be tested across different browsers, operate systems, payment method, and user character, such as:

  • Browser:Chrome, Firefox, Safari, Edge
  • Operating System:Windows, macOS, Linux
  • Payment Method:Credit Card, PayPal, Bank Transfer
  • User Type:New User, Returning User, Guest

Testing all possible combination would require:

4 (Browsers) x 3 (Operating Systems) x 3 (Payment Methods) x 3 (User Types) = 108 test cases

By use a pairwise examine instrument (such as PICT or ACTS), you can give a smaller set of test lawsuit that ensure every pair of parameter value is screen at least erstwhile. This typically reduces the number of trial cases to around 10-20, count on the specific parameters and value.

Test Case Design Techniques For White-box System

White-box techniques apply when you feature access to the system 's national codification and require to validate execution paths, subdivision logic, and code construction, & nbsp; not simply evident behavior.

1. Control Flow Testing

Control flow testing is a white-box testing proficiency that emphasize create and fulfil test cases to cover predetermined execution path within the program 's code.

While control flow testing provides a eminent tier of thoroughness, it also show some challenges:

    • Path Explosion: The figure of possible path can become immense. Mod covering are typically so complex that quiz every possible control flow path exhaustively becomes practically unacceptable.
    • Implemented Paths Only: White-box testing only works with paths that have been apply. If a particular path is missing, it won ’ t be detected. For example, in the following code, there is no route for scores below 60:
Python
def calculate_inventory (order_dispatched, & nbsp; current_inventory): if & nbsp; order_dispatched & nbsp; & nbsp; & nbsp; & nbsp; return & nbsp; current_inventory & nbsp; + & nbsp; 1

To perform control flow testing, it ’ s important to understand the Control Flow Graph (CFG). A CFG visually represents all possible paths a program might lead during execution and is wide used in control flowing testing to analyze and translate the program ’ s structure.

A control flow graph consists of three main element:

1. Node: Represents single statements or blocks of code. For example, the following snip has three thickening:
Python
void exampleFunction (int x, int y) {& nbsp; & nbsp; & nbsp; if (x & gt; 0) {& nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; if (y & gt; 0) {& nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; printf (`` Both x and y are positive.\n ''); & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;} else {& nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; printf (`` x is positive, y is non-positive.\n ''); & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;} & nbsp; & nbsp; & nbsp;} else {& nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; printf (`` x is non-positive.\n ''); & nbsp; & nbsp; & nbsp;}}

Here we have7 nodes: 1 entry point, 1 exit point, 5 decision points.

  • 1: Entry point of exampleFunction.
  • 2: if (x & gt; 0).
  • 3: if (y & gt; 0).
  • 4: printf (`` Both x and y are positive. ``).
  • 5: printf (`` x is positive, y is non-positive. ``).
  • 6: printf (`` x is non-positive. ``).
  • 7: Exit point of exampleFunction.

Edges:

  • (1 - & gt; 2)
  • (2 - & gt; 3) if x & gt; 0
  • (2 - & gt; 6) if x & lt; = 0
  • (3 - & gt; 4) if y & gt; 0
  • (3 - & gt; 5) if y & lt; = 0
  • (4 - & gt; 7)
  • (5 - & gt; 7)
  • (6 - & gt; 7)

In this CFG, there are three possible execution paths to cover all consequence.


 2. Structured Testing (Basic Path Testing)

Structured testing, too cognize as basic path examination, is a white-box examination proficiency that focuses on identifying and screen all independent way within the software. The aim is to ensure that every potential executing route in a program is tested at least once.

A typical structured testing procedure follows these steps:

  1. Derive the control flow graph from the package module.
  2. Calculate the graph 's Cyclomatic Complexity (C).
  3. Select a set of C basis path.
  4. Create a test case for each basis path.
  5. Execute the test cases.

Cyclomatic Complexity is a software metric used to measure the complexity of a program 's control flow. It was introduced by Thomas J. McCabe, Sr. in 1976 and serves as a key index of the number of linearly independent paths through a program 's source code. The formula is:

C = Edges - Nodes + 2Let 's take a look at this Control Flow Graph:

There are in total 8 edges and 7 nodes, & nbsp; so the Cyclomatic Complexity would be: 

C = 8 - 7 + 2 = 3

This means there are 3 linearly self-governing paths through the program.

Here 's how you render the C metric:

  • C = 1-10: Simple program, low endangerment, leisurely to try and maintain.
  • C = 11-20: Moderate complexity, requiring more elaborate examination and review.
  • C = 21-50: High complexness, increased risk of errors, requiring extensive examination and support.
  • C > 50: Very high complexness, difficult to test and keep, probably in need of refactoring.

Based on the identified paths, we can create the undermentioned trial cases:

Test Case 1:

  • Inputs: x = 5, y = 2
  • Expected Output: Both x and y are positive.

Test Case 2:

  • Inputs: x = 5, y = -2
  • Expected Output: x is convinced, y is non-positive.

Test Case 3:

  • Inputs: x = -2
  • Expected Output: x is non-positive.

Conclusion

Moderntest example design techniquesare the backbone of efficient software test. They aid us go beyond just `` checking the boxes '' and assure we ’ re really digging into the area where bugs might enshroud. By balancing classic logic with AI-optimized tools and Shift-Left strategies, you 'll deliver faster, higher-quality releases.

Remember the three-step framework: determine system opacity firstly, then gibe the technique to your input character, then factor in resource restraint. For deep dives into any of the black-box techniques covered here, start with the— and for ECP specifically, the.

Explain

|

FAQs on Test Case Design

How do black-box and white-box systems vary the way you design test cases?

+

Black-box designing focuses onexternal behavior(inputs/outputs without know internals), while white-box design targetsinternal codification structure and execution pathutilise code-aware techniques. & nbsp;

How do I decide which exam cause design technique to use?

+

Start by ascertain system opacity: no codification entree signify black-box techniques; full code accession means white-box; fond access entail combine both. Then match the technique to your input type, & nbsp; ranges suggest ECP and BVA, complex business rules suggest Decision Tables, many parameter combinations suggest Pairwise, and code way propose Control Flow or Structured Testing. See thedecision fabric abovefor a full breakdown.



What is Equivalence Class (Partitioning) Testing, and why does it reduce tryout case tally?

+

It groups inputs intovalid/invalid equality classeswhere values should bear the like, then trialrepresentative valueper class—cutting redundant cases while keeping solid coverage. & nbsp;

How is Boundary Value Analysis associate to equivalence classes, and what does it target?

+

BVA is an propagation of equivalence partitioning that testsedge value(but below/at/just above edge) because defects are more likely at input range limits than in the middle. & nbsp;

When should you use Decision Table Testing vs Pairwise Testing?

+

Use Decision Tableswhen you havebusiness rulesmotor by combinations of conditions and actions (each rule becomes a test). UsePairwisewhen many parameters create combinatorial explosion and you desire reportage ofall pairswith far fewer tests. & nbsp;

What do Control Flow Testing and Structured (Basic Path) Testing verify in white-box testing?

+

They controlperformance paths using a Control Flow Graph (nodes/edges/branches); Structured Testing roleCyclomatic Complexity (Edges − Nodes + 2)to determine how manymain pathsto continue with test cases.

What is Cyclomatic Complexity and how is it used in test design?

+

Cyclomatic Complexity (C = Edges - Nodes + 2) measures the number of linearly independent paths through a broadcast. A C of 1–10 indicates a simple broadcast; 11–20 temperate complexity; 21–50 high complexity; above 50 propose the code likely needs refactoring. It tells you theminimum turn of test cases involvefor entire independent way coverage.

What is Shift-Left testing and how does it pertain to test case design?

+

Shift-Left testing means commence test design earlier in the growth rhythm — during requirements or pattern phases rather than after development. This allows teams to apply techniques like Equivalence Class Partitioning from API specs before any code is written, catching defects that cost up to 15x more to fix if found post-release.

Vincent N.
QA Consultant
Vincent Nguyen is a QA adviser with in-depth domain cognition in QA, software examination, and DevOps. He has 5+ years of experience in craft content that resonate with techies at all levels. His interests sweep from indite, technology, to building coolheaded clobber.

Automate This With SUSA

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts needed.

Try SUSA Free

Test Your App Autonomously

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts.

Try SUSA Free