Test Case Design
Test Case Design
Test Case Design
SBR
(Scenario Based
Requirements)
Mary Larson
Testing
Services
INTERNAL January 2009
Testing is an organized activity that:
and
INTERNAL
Verification
INTERNAL
Testing Guidelines
We can not test everything.
INTERNAL
What is a Test Case?
INTERNAL
Anatomy of a Test Case
Test Name and Unique ID
Linked to one or more Requirements
Pre-conditions
Input Data
Post-conditions
Test Steps
Step Name
Expected Result
INTERNAL
Test Case Best Practices
A good test case….
Begin each test case with a Login step, initiate batch job step or other
common starting point.
Design test cases that are independent of other test cases (stand on their
own).
Test Cases must be assigned to Test Sets before execution can occur.
For details on how to create test sets and add test cases to them, refer
to Quality Center eLearning
Contact TTS.Mercury for specific question on Quality Center usage
INTERNAL
Identifying Potential Test Cases
Derive Primary Test Case (happy path)
Highest frequency of execution.
INTERNAL
Eliminate Redundancy
Testing redundancy often occurs due to a
lack of planning and communication.
INTERNAL
Developing Test Cases with SBR
Scenarios specify the behavior of a system
from a user’s perspective.
INTERNAL
User Acceptance Testing
High-Level Requirements (REQs) are often used to
create test cases.
INTERNAL
Quality Center Test Case (Design Steps) Example
Quality Center is Target’s Test Management and Defect
Tracking Tool
Provides a central repository for test cases, test execution results and
defects
Customized fields and reports to support TSD best practices and
adherence
Integrated with CaliberRM (Target’s Requirements Management Tool)
INTERNAL
Test Case Translation Techniques
Requirements to Test Cases
Functionally decompose requirements into test cases.
Use Verify streams: e.g. Verify that when a change
request is created a unique ID is assigned to it.
INTERNAL
Creating Detailed Test Cases
Test Cases should be derived from Requirements,
Business Rules and Functional Specifications.
To ensure traceability Requirements should be linked to Test Cases
Note: Some test case details may not be discovered until technical design.
Requirement A
+
Functional Specification Flow(s)
+
Business Rule(s)
Note: Requirement A and Test Case 1 (2) are made up names for this
example. Requirement and test case name should be descriptive and
unique.
INTERNAL
Creating Test Cases using SBR
INTERNAL
Using Copy/Paste to Clone similar Test Case
Created Test Case 1 in Quality Center (see previous slide)
Test Case derived from:
2.1 REQ - Ability to search for existing customer information
FL-1.1 Search Customer (Call Rep and Customer Service Manager)
INTERNAL
Creating Test Cases using SBR (Con’t)
Item Description
Requirement A 2.1 REQ - Ability to search for existing customer information
+ Business Rule2 RUL - A wildcard search must be available for all search
criteria
+ Functional Spec - FL-1.1 Search Customer (Call Rep and Customer Service
Manager)
Step # Step
1 On home page user indicates call starts by clicking on Start Call button. The system records the Call start time and Call Rep
2 The user clicks the Start button and the Customer Search Page displayed.
a.Last Name – data entry, required
b.State – dropdown menu of all states, required, defaulted to (Select One)
3 The user enters all of the required information and clicks the Search button
4 The system refreshes the Customer Search page with data pre-populated in the results table
= Test Case 2 (covers 2.1 REQ, FL-1.1 and 2 RUL) *focus is on applying 2 RUL
INTERNAL
Test Case Attributes (in QC Con’t)
Actual Result
Actual Result of the test step, as compared to the Expected Result. The actual result
determines the test step status – Pass or Fail
Test Case Pre Conditions
Pre-conditions determine conditions or state the system should be in before executing
the test case
For Ex. To Test the assignment of resources to a Project, the resources should exist in the System.
For Ex. To Test Post Timesheet, there should be at least one Timesheet in Approved status for the test user.
Linked Requirement
The linked requirement(s) for which the Test case is designed to be executed. Linking
requirements to test cases helps to assess requirements coverage and traceability.
Test Case Post Condition
The state of the system after successful execution of the test case
For Ex. Project Created
For Ex. Time sheet in Approved Status
Not required for every test case
Can assist with planning and ordering test cases for execution.
Additional attributes like Test Stage, Test Type, Priority are available in Quality
Center. INTERNAL
Quality Center User’s Reference Site
http://sharepoint.target.com/sites/qualitycenter/default.aspx
INTERNAL
Quality Center Process Flow
Link on Quality Center User’s Reference Site
INTERNAL
Test Case Design Techniques
Black Box – Equivalence Partitioning Example
Exam Marks
0 ≥ Marks ≤ 100
… -1 101 …
Equivalence Partitioning
Identify the different logic conditions for this example
Group possible Test Cases based on conditions. Executing one Test Case in the
group is equivalent to executing other Test Cases in the same group.
INTERNAL
Test Case Design Techniques
Black Box Testing – Case Study
INTERNAL
Test Case Design Techniques
Black Box Testing – Case Study
Case Study
DPS Summary
The system generates warnings and notifications while processing the Fiscal Month
End Process.
Develop Test cases using Equivalence class and Boundary value analysis.
INTERNAL
Test Case Design Techniques
Black Box – Boundary Value Analysis by example
Generate E Mail
… >3 36 24 <24 …
6
INTERNAL
Test Case Design Techniques
Test Case – Error Handling
Error Handling
Tests that ensure the System doesn't crash, lose data, or otherwise break
when users do something that wasn't planned or anticipated by developers.
For Ex. Attempt to enter data outside the boundaries. The software
should not permit this.
Make illegal combination choices. The software should prevent the
action by disabling fields, and/or display an appropriate error message.
Turn off the computer during a transaction. The software should not
lose data.
INTERNAL
Q&A
INTERNAL