0% found this document useful (0 votes)
2 views8 pages

Testing Techniques

Uploaded by

waleedikram1012
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views8 pages

Testing Techniques

Uploaded by

waleedikram1012
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

1 Equivalence and Boundary Value

Example 1: Equivalence and Boundary Value


 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”

Order Pizza:
Here is the test condition

1. Any Number greater than 10 entered in the Order Pizza field(let say
11) is considered invalid.
2. Any Number less than 1 that is 0 or below, then it is considered
invalid.
3. Numbers 1 to 10 are considered valid
4. Any 3 Digit Number say -100 is invalid.

We cannot test all the possible values because if done, the number of
test cases will be more than 100. To address this problem, we use
equivalence partitioning hypothesis where we divide the possible values
of tickets into groups or sets as shown below where the system behavior
can be considered the same.
The divided sets are called Equivalence Partitions or Equivalence
Classes. Then we pick only one value from each partition for testing. The
hypothesis behind this technique is that if one condition/value in a
partition passes all others will also pass. Likewise, if one condition in
a partition fails, all other conditions in that partition will fail.

2 Boundary Value Analysis– in Boundary Value Analysis, you test


boundaries between equivalence partitions

In our earlier equivalence partitioning example, instead of checking one


value for each partition, you will check the values at the partitions like 0,
1, 10, 11 and so on. As you may observe, you test values at both valid
and invalid boundaries. Boundary Value Analysis is also called range
checking.

Equivalence partitioning and boundary value analysis(BVA) are closely


related and can be used together at all levels of testing.

Example 2: Equivalence and Boundary Value


Following password field accepts minimum 6 characters and maximum
10 characters

That means results for values in partitions 0-5, 6-10, 11-14 should be
equivalent

Enter Password:

Expected
Test Case # Test Case Description
Outcome
System should
1 Enter 0 to 5 characters in password field
not accept
System should
2 Enter 6 to 10 characters in password field
accept
System should
3 Enter 11 to 14 character in password field
not accept
Examples 3: Input Box should accept the Number 1 to 10
Here we will see the Boundary Value Test Cases

Test Case Description Expected Outcome


Boundary Value = 0 System should NOT accept
Boundary Value = 1 System should accept
Boundary Value = 2 System should accept
Boundary Value = 9 System should accept
Boundary Value = 10 System should accept
Boundary Value = 11 System should NOT accept
Why Equivalence & Boundary Analysis Testing
1. This testing is used to reduce a very large number of test cases to
manageable chunks.
2. Appropriate for calculation-intensive applications with a large
number of variables/inputs

3 Decision Table Testing (Example)


Example 1: How to make Decision Base Table for Login
Screen
Let’s create a decision table for a login screen.

The condition is simple if the user provides the correct username and
password the user will be redirected to the homepage. If any of the input
is wrong, an error message will be displayed.

Conditions Rule 1 Rule 2 Rule 3 Rule


4

Username (T/F) F T F T

Password (T/F) F F T T

Output (E/H) E E E H
Legend:

 T – Correct username/password
 F – Wrong username/password
 E – Error message is displayed
 H – Home screen is displayed

Interpretation:

 Case 1 – Username and password both were wrong. The user is


shown an error message.
 Case 2 – Username was correct, but the password was wrong. The
user is shown an error message.
 Case 3 – Username was wrong, but the password was correct. The
user is shown an error message.
 Case 4 – Username and password both were correct, and the user
navigated to the homepage

Advantages of Decision Table Testing


 When the system behavior is different for different inputs and not
the same for a range of inputs, both equivalent partitioning, and
boundary value analysis won’t help, but a decision table can be
used.
 The representation is simple so that it can be easily interpreted and
is used for development and business as well.
 This table will help to make effective combinations and can ensure
better coverage for testing
 Any complex business conditions can be easily turned into decision
tables
 In a case we are going for 100% coverage typically when the input
combinations are low, this technique can ensure the coverage.

Disadvantages of Decision Table Testing


The main disadvantage is that when the number of inputs increases the
table will become more complex

4 State Transition Example:


In the following example, if the user enters a valid password in any of the
first three attempts the user will be able to log in successfully. If the user
enters the invalid password in the first or second try, the user will be
prompted to re-enter the password. When the user enters password
incorrectly 3rd time, the action has taken, and the account will be
blocked.

State Transition Diagram


In this diagram when the user gives the correct PIN number, he or she is
moved to Access granted state. Following Table is created based on the
diagram above-

State Transition Table


States Correct PIN Incorrect PIN

S1) Start S2 S2

S2) 1st attempt S5 S3

S3) 2nd attempt S5 S4

S4) 3rd attempt S5 S6

S5) Access Granted – –

S6) Account blocked – –


In the above-given table when the user enters the correct PIN, the state
is transitioned to Access granted. And if the user enters an incorrect
password, he or she is moved to next state. If he does the same 3rd time,
he will reach the account blocked state.

You might also like