You are on page 1of 43

First Vietnamese QA Firm

© Lotus Quality Assurance 2016 1


Black Box Testing

PRESENTED BY: TUVU

© Lotus Quality Assurance 2016 2


AGENDA
 Purpose: Introduce black box testing and techniques
 Audience: Testers

 Content:
• Test Techniques Taxonomy
• Categories of Test Design Techniques
• Specification-based or Black-box Techniques
» Equivalent Partitioning
» Boundary Value Analysis
» Decision Table
» State Transition Testing
» Use case Testing
© Lotus Quality Assurance 2016 3
Test techniques taxonomy

Testing

Dynamic
Static

Static Experience- Defect-


Review Black-box White-box based
analysis based

© Lotus Quality Assurance 2016 4


Categories of Test Design Techniques

© Lotus Quality Assurance 2016 5


BLACK BOX TEST

© Lotus Quality Assurance 2016 6


Black Box Testing
• Focuses on WHAT a system does not HOW it does it
• Focuses on the functional capabilities of the system
• It also know as functional testing

© Lotus Quality Assurance 2016 7


Black Box Test Techniques
• Test techniques for Black Box Test (Specification-Based) can be:
– Equivalent Partitioning
– Boundary Value
– Decision Table/Pairwise testing
– State Transition

 BBT Techniques can be used in any test levels


 Using BBT techniques to design test cases

© Lotus Quality Assurance 2016 8


Equivalence Partitioning - Definition

• A technique in black box testing.


• It is designed to minimize the number of test cases by
dividing tests in such a way that the system is expected
to act the same way for all tests of each equivalence
partition. Test inputs are selected from each class. Every
possible input belongs to one and only one equivalence
partition

© Lotus Quality Assurance 2016 9


Equivalence Partitioning - How To?

 There are 2 major steps we need to do in order to use


equivalence class partitioning:
 Identify the equivalence classes of input or output. Take
each input's or output's condition that is described in the
specification and derive at least 2 classes for it:
• One class that satisfies the condition – the valid
class.
• Second class that doesn't satisfy the condition – the
invalid class.
 Design test cases based on the equivalence classes.

© Lotus Quality Assurance 2016 10


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

© Lotus Quality Assurance 2016 11


Case Study
 Calculate Payment Application
 

 Time: 15’

© Lotus Quality Assurance 2016 12


Case Study (2)
In a system designed to work out the tax to be paid:
An employee has £4000 of salary tax free.
The next £1500 is taxed at 10%.
The next £28000 after that is taxed at 22%.
Any further amount is taxed at 40%.
To the nearest whole pound, which of these groups of numbers fall
into three DIFFERENT equivalence classes?
a)    £4000; £5000; £5500
b)    £32001; £34000; £36500
c)    £28000; £28001; £32001
d)    £4000; £4200; £5600

Time: 5’
© Lotus Quality Assurance 2016 13
Boundary Value Analysis - Definition

• A technique in black box testing.


• Is the process of selecting test cases (or test data) by
understanding boundaries that differentiate between
valid and invalid conditions. Tests are run to check the
inside and outside edges of these boundaries, in
addition to the actual boundary points.

© Lotus Quality Assurance 2016 14


Boundary Value Analysis - How To?

 There are 2 major steps we need to do in order to use BVA:


 Identify the boundary points (a, b)
 Design test cases based on boundary points

Test case Value Expected result

1 a-1 Invalid
2 a Valid
3 B Valid
4 b+1 Invalid

© Lotus Quality Assurance 2016 15


Example
Sample: consider a printer that has an input
option of

 To apply boundary value analysis, we will take the minimum and maximum
(boundary) values from the valid partition (1 and 99 in this case) together with the
number of copies to be made, from 1 to 99
 The first or last value respectively in each of the invalid partitions adjacent to the
valid partition (0 and 100 in this case). In this example we would have three
equivalence partitioning tests (one from each of the three partitions) and four
boundary value tests.

© Lotus Quality Assurance 2016 16


Case Study
In a system designed to work out the tax to be paid:
 An employee has £4000 of salary tax free. The next £1500 is
taxed at 10%
 The next £28000 is taxed at 22%
 Any further amount is taxed at 40%
To the nearest whole pound, which of these is a valid Boundary
Value Analysis test case?
• A. £1500
• B. £32001
• C. £33501
• D. £28000
Time: 5’

© Lotus Quality Assurance 2016 17


Why Both EP and BVA?
• Because:
– Every boundary is in some partition, if you did only
boundary value analysis you would also have tested
every equivalence partition.
– If only testing boundaries we would probably not
give the users much confidence as we are using
extreme values rather than normal values

© Lotus Quality Assurance 2016 18


Decision Table

 Decision table is a good way to deal with combinations of things


(e.g. inputs)
 Decision tables aid the systematic selection of effective test
cases and can have the beneficial side-effect of finding
problems and ambiguities in the specification
 It is a technique that works well in conjunction with
equivalence partitioning. The combination of conditions
explored may be combinations of equivalence partitions

© Lotus Quality Assurance 2016 19


Components of decision table
Rules

R1 R2 R3 R4 R5 R6 R7 R8
T T T T F F F F
Conditions C1
/Causes T T F F T T F F Values of Conditions
C2

C3 T F T F T F T F

a1 x x x x

a2 x x
Actions
Actions taken
/Outputs a3 x x
a4 x x x x

a5 x x

© Lotus Quality Assurance 2016 20


Steps to create a decision table

1. List all Conditions/Inputs


2. Calculate the number of Possible
Combinations (Rules)
3. Place all of the Combinations into
the Table
4. Reduce test combinations and
decide test cases

© Lotus Quality Assurance 2016 21


State Transition Testing

 State transition testing focuses on the testing of


transitions from one state (e.g., open, closed) of an
object (e.g., an account) to another state

 State Transition applies for finite state systems

 Use a state transition chart to identify state transitions


that can occur in the real business world and state
transitions that cannot occur

© Lotus Quality Assurance 2016 22


A state transition model

A state transition model 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).

© Lotus Quality Assurance 2016 23


Example
Electronic clock example
 A simple electronic clock has four modes, display time, change

time, display date and change date


 The change mode button switches between display time and

display date
 The reset button switches from display time to adjust time or

display date to adjust date


 The set button returns from adjust time to display time or

adjust date to display date

© Lotus Quality Assurance 2016 24


Example

© Lotus Quality Assurance 2016 25


Case Study
Given the following state transition diagram, which of the following series
of stat e transitions contains an INVALID transition which may indicate
a fault in the system design?

• A. Login Browse Basket Checkout Basket Checkout Pay Logout.


• B. Login Browse Basket Checkout Pay Logout.
• C. Login Browse Basket Checkout Basket Logout.
• D. Login Browse Basket Browse Basket Checkout Pay Logout
Time: 5’

© Lotus Quality Assurance 2016 26


Use case testing
 Use case testing: is a black-box design technique in which
test cases are designed to execute user scenarios
 Use case: is a sequence of transactions/steps in a dialogue
between a user/actor and system with tangible result.
 Use case language and term of the business rather than
technical term, and the user here business user
 Use case can cover the integration defects
 Test case derived from use cases good for finding defect in
real world of the system.

© Lotus Quality Assurance 2016 27


Example

© Lotus Quality Assurance 2016 28


TEST CASE

© Lotus Quality Assurance 2016 29


Test Case Specification
• A set of test inputs, execution conditions, and expected results
developed for a particular objective, such as to exercise a
particular program path or to verify compliance with a specific
requirement

© Lotus Quality Assurance 2016 30


Why Test Case

• Detail of test design to describe how to deploy test


design
• Predict expected result
• Help new testers familiar with existing
application/system without reading requirement

© Lotus Quality Assurance 2016 31


Good Test Case

• Has a high probability of finding errors


• Clear of purpose
• Well organized
• Reviewable
• Maintainable
• Useful to other testers

© Lotus Quality Assurance 2016 32


Test Case Elements

• Test case ID
• Test case Title
• Pre-Condition
• Test Case Description
• Expected Output
• Test Result

© Lotus Quality Assurance 2016 33


Test Case ID

Unique number to identify test case. It should be ID to:


- Easy to say it belong to which module
- Easy to add new one into one module and don’t change
ID of other
- Should not replaced by deleted one
For example:
- USER_MGT_Create_01
- USER_MGT_Create_02
- …
Note: If using test management tool then test case ID is
automatically generated

© Lotus Quality Assurance 2016 34


Test case Title

The description of objective or


condition
For example:
 Add user successfully or
 Can not add user with special characters or
 Can not add duplicated user name

© Lotus Quality Assurance 2016 35


Pre-requisite

A status must be in before run a test case


A set of actions need to be done before run a case.
It may be set for one or a set of test cases
For example:
1. Open IE
2. Access to http://10.16.51.8/TestInsight
3. Login with Admin role (admin/admin)
4. Select Admin menu and then User menu item
5. Search to ensure that user test not existed (E.g. “test”)

© Lotus Quality Assurance 2016 36


Test Case Description

A set of steps/actions need to be run to complete a


particular objective or condition

For example:
1. On User list screen, click on [+] button
2. Input username that not existed (E.g. “test”)
3. Input Full name, email (E.g. “test”,
testinsight@fsoft.com.vn)
4. Use other values by default and click on [Save] button

© Lotus Quality Assurance 2016 37


Expected Output

A set of output/result after run

For example:
1. Create User screen is displayed
4. “test” is displayed in User list with order of username,
number of list increase one

© Lotus Quality Assurance 2016 38


Tips for good Test case

• Structure of TC is clear and reasonable.


• Follow requirement closely.
• Cover all of cases that can occur.
• Title easy to understand and cover requirement (as user, I
can do or can’t do…)
• Test step and expected result is a step by step process

© Lotus Quality Assurance 2016 39


QnA/Discussion

© Lotus Quality Assurance 2016 40


© Lotus Quality Assurance 2016 41
REFERENCE
 http://www.istqb.org/
 Foundations of Software Testing_ISTQB Certification, Chapter 4
 Foundation Syllabus_2011

© Lotus Quality Assurance 2016 42


Contact Us!

Website: http://lqa.com.vn
Email: hello@lqa.com.vn
Phone: +84 90 414 0881
© Lotus Quality Assurance 2016 43

You might also like