You are on page 1of 43

Software Testing Foundation

Test Techniques

6/12/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 1


Lesson Objectives

 Be introduced Test techniques


 Be introduced and practice with Black Box Test techniques: EP,
BVA, Decision Table and State Transition Testing
 Have chance to discuss with experience testers

6/12/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 2


AGENDA

• Test Techniques

• Equivalent Partitioning (EP)

• Boundary Value Analysis (BVA)

• Decision Table Testing

• State Transition Testing

6/12/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 3


Section 1
TEST TECHNIQUES

6/12/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 4


Taxonomy for test techniques

Testing

Dynamic
Static

Static Experience- Defect-


Review Black-box White-box based
analysis based

Dynamic
analysis

6/12/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 5


Black-box techniques

Black-box

Boundary Decision State


Equivalence Use Case Pairwise Classification
Values Table transition
Partitioning testing testing tree method
Analysis testing testing

6/12/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 6


White-box techniques

White-box

Statement Decision Path


testing testing
testing

6/12/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 7


Experience-base techniques

Experience
based

Checklist
Error Guessing
Exploratory Testing

6/12/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 8


Section 2
EQUIVALENT PARTITIONING (EP)

6/12/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 9


Equivalent Partitioning (EP)

 Definition:
Black-box test design technique in which test case are designed to
execute representatives from equivalence partitions.
 Equivalence partition:
A portion of an input or output domain for which the behavior of a
component or system is assumed to be the same, based on the
application.

6/12/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 10


Equivalent Partitioning (EP)

Equivalence classes can be determined based on


consideration of:
 Valid vs. invalid input values

 Similarity and difference of input values

 Similarity and difference of output values

 Similarity and difference of expected processing

6/12/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 11


Equivalent Partitioning (EP)

Equivalence Subset A
Set Partitioning
Subset B

Subset A
Equivalence
Set Partitioning Subset A

{}

6/12/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 12


Equivalent Partitioning (EP) - Example

• A savings account in a bank earns a different rate of interest depending


on the balance in the account
• If a balance in the range $0 up to $100 has a 3% interest rate, a
balance over $100 and up to $1000 has a 5% interest rate, and
balances of $1000 and over have a 7% interest rate, we would initially
identify three valid equivalence partitions and one invalid partition

6/12/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 13


Equivalent Partitioning (EP) - Example

Case 1: Valid Partition (For 3% interest) - input one or some values from
0.00 to 100.00 (e.g. 55)

Case 2: Valid Partition (For 5% interest) - input one or some values from
100.01 to 999.99 (e.g. 345.67)

Case 3: Valid Partition (For 7% interest) - input one or some values >
1000.00 (e.g. 2345)

Case 4: Invalid Partition - input one or some values < 00.00 (e.g. -0.01)

6/12/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 14


Equivalent Partitioning (EP) - Exercise

A program validates a numeric field as follows: values less than 10 are


rejected, values between 10 and 21 are accepted, values greater than or
equal to 22 are rejected. Which of the following input values cover all of the
equivalence partitions?

6/12/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 15


Equivalent Partitioning (EP) - Exercise

6/12/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 16


Equivalent Partitioning (EP) - Exercise

The exercise consists of two parts:


 Show the equivalence partitions for each of the three pieces of
information, indicating valid and invalid members.
 Create test cases to cover these partitions, keeping in mind the rules
about combinations of valid and invalid members.

6/12/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 17


Section 3
BOUNDARY VALUE ANALYSIS

6/12/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 18


Boundary Value Analysis

• Is a test case design technique to test boundary value


between partitions
• There are 2 ways to approach BVA:
• Two value testing
• Three value testing
• In Boundary Testing, Equivalence Class Partitioning plays a
good role. Boundary Testing comes after the Equivalence
Class Partitioning
• Tests can be designed to cover both valid and invalid
boundary values. When designing test cases, a test for each
boundary value is
6/12/2023
chosen
09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 19
Boundary Value Analysis

• There are 2 ways to approach BVA:


• Two value testing
• Three value testing

6/12/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 20


Boundary Value Analysis - Example

Let's consider the behavior of Order Pizza Text Box Below


Pizza values 1 to 10 is considered valid. A success message is shown.
While value 11 to 99 are considered invalid for order and an error message will
appear, "Only 10 Pizza can be ordered"

6/12/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 21


Boundary Value Analysis - Example

6/12/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 22


Boundary Value Analysis - Exercise

Assume postal rates for ‘light letters’ are:


$0.25 up to 10 grams
$0.35 up to 50 grams
$0.45 up to 75 grams
$0.55 up to 100 grams

Which test inputs (in grams) would be selected using boundary value analysis?

6/12/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 23


Section 4
DECISION TABLE TESTING

6/12/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 24


Decision Table Testing

 is a black box technique


 is a good way to deal with combinations of things
(e.g. inputs)
 is sometimes also referred to as a ’cause-effect’ table

6/12/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 25


Decision Table
Combinations
Causes Values 1 2 3 4 5 6 7 8  Decision table
Cause 1 Y, N Y Y Y Y NNNN consists of three
Cause 2 Y, N Y Y NNY Y NN parts:
Cause 3 Y, N Y NY NY NY N
 Condition rows
Effects
 Action rows
Effect 1 X X X
Effect 2 X X X  Combinations or
Rules

Cause = condition = input fields


Effect = action = expected results
6/12/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 26
Decision Table

1. Identify Conditions and Values


2. Identify possible actions
3. Compute max number of rules
(combinations)
4. Enter all possible rules
5. Define actions for each rule
6. Review the decision table
7. Simplify the table

6/12/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 27


Decision Table - Example

A company wants to unify the way orders are


handled:
 All orders of non star-clients with bad credit
should be
rejected.
 If there is enough product in stock, orders
should be accepted;
otherwise order is put in waiting list

6/12/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 28


Decision Table - Example

Step1: Condition and values


A company wants to unify the way orders are handled:
 All orders of non star-clients with bad credit should be
rejected.
 If there is enough product in stock, orders should be accepted;
otherwise order is put in waiting list

Conditions and values


1. Condition: Star-clients; Values: (Yes, No)
2. Condition: credit; Values: (good, bad)
3. Condition: product in stock; Values: (sufficient, insufficient)
6/12/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 29
Decision Table - Example

Step2: Actions
A company wants to unify the way orders are handled:
 All orders of non star-clients with bad credit should be
rejected.
 If there is enough product in stock, orders should be
accepted;
otherwise order is put in waiting list

Actions: reject, accept, waiting

6/12/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 30


Decision Table - Example

Step 3: Compute combinations

Decision table
8 columns = max number of different rules

6/12/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 31


Decision Table - Example

Step 4: Enter all possible rules


Algorithm:
1. Determine Repeating Factor (RF): divide remaining combinations by the
number of possible values for that cause
2. Write RF times the first value, then RF times the next etc. until row is full
3. Next row, go to 1 with remaining combinations = RF
Decision table

6/12/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 32


Section 5
STATE TRANSITION TESTING

6/12/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 33


Black-box techniques

Black-box

Boundary Decision State


Equivalence Use Case Pairwise Classification
Values Table transition
Partitioning testing testing tree method
Analysis testing testing

6/12/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 34


State Transition Testing

 State transition testing: a black box test design technique in


which test cases are designed to execute valid and invalid
state transition
 State-based testing is ideal when we have sequences of
events that occur and conditions that apply to those events
and the proper handling of a particular event/condition
situation depends on the events and conditions that have
occurred in the past

6/12/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 35


State Transition Testing – Example

An example of entering a Personal Identity Number (PIN) to a


bank account.

6/12/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 36


State Transition Diagram

A state transition diagram has four basic parts


 The states that the software may occupy (open/closed or
funded/insufficient funds);
 The transitions from one state to another (not all transitions
are allowed);
 The events that cause a transition (closing a file or
withdrawing money);
 The actions that result from a transition (an error message or
being given your cash).

6/12/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 37


State Transition Diagram – Example

6/12/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 38


State Transition Testing – Design TC

1. Adopt a rule for where a test procedure or test step must start
and where it may or must end. An example is to say that a test
step must start in an initial state and may only end in a final state.
2. From an allowed test starting state, define a sequence of
event/condition combinations that leads to an allowed test ending
state. For each transition that will occur, capture the expected
action that the system should take. This is the expect result.
3. As you visit each state and traverse each transition, mark it as
covered.
4. Repeat steps 2 and 3 until all states have been visited and all
transitions traversed—in other words, every node and arrow has
been marked with the marker.

6/12/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 39


State Transition Testing – Exercise

 Design test case for the workflow

6/12/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 40


References
 https://www.istqb.org/ , Foundations of Software Testing,
Chapter 4

6/12/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 41


Lesson Summary

• Session 1: Test Techniques

• Session 2: Equivalent Partitioning (EP)

• Session 3: Boundary Value Analysis (BVA)

• Session 4: Decision Table Testing

• Session 5: State Transition Testing

6/12/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 42


Thank you

6/12/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 43

You might also like