SlideShare a Scribd company logo
Testing CompetencyTesting Competency 11
White Box & Black BoxWhite Box & Black Box
Testing TechniquesTesting Techniques
ManishManish
Roopa SRoopa S
Testing Competency 2
What does Test meanWhat does Test mean
 The word “TEST” is derived from the LatinThe word “TEST” is derived from the Latin
word “Testum” meaning a pottery vesselword “Testum” meaning a pottery vessel
used to measure or assessused to measure or assess
Testing Competency 3
Software TestingSoftware Testing
 Testing of software means assessing orTesting of software means assessing or
Measuring the software to determineMeasuring the software to determine
its QUALITYits QUALITY
 Area of testing is one of the key processArea of testing is one of the key process
areas of project life cycle in ensuringareas of project life cycle in ensuring
the QUALITY of the softwarethe QUALITY of the software
Testing Competency 4
QUALITYQUALITY
What is Quality product ?What is Quality product ?
 A quality product is one which is fit for use.A quality product is one which is fit for use.
 A quality product is one which is producedA quality product is one which is produced
as per pre-defined specifications.as per pre-defined specifications.
Testing Competency 5
Various TestingVarious Testing
TechniquesTechniques
 Structural & FunctionalStructural & Functional
 Verification & Validation (V&V)Verification & Validation (V&V)
 Static & DynamicStatic & Dynamic
 White-Box & Black-BoxWhite-Box & Black-Box
Testing Competency 6
Levels of TestingLevels of Testing
Levels of TestingLevels of Testing Testing TechniquesTesting Techniques
Unit TestingUnit Testing Structural Testing
IntegrationIntegration Structural & Functional
SystemSystem Functional, Risk based
AcceptanceAcceptance Functional, Risk based
Testing Competency 7
Test Design MethodsTest Design Methods
 Black-Box and White-Box are Test DesignBlack-Box and White-Box are Test Design
MethodsMethods
Testing Competency 8
Black-Box TestingBlack-Box Testing
 Black Box Testing is testing technique havingBlack Box Testing is testing technique having
no knowledge of the internalno knowledge of the internal
functionality/structure of the systemfunctionality/structure of the system
 Synonyms for Black-Box are Behavioral,Synonyms for Black-Box are Behavioral,
Functional, Opaque-Box, Closed-Box etc.Functional, Opaque-Box, Closed-Box etc.
Testing Competency 9
contd…contd…
 Black-box Testing focuses on testing theBlack-box Testing focuses on testing the
function of the program or application against itsfunction of the program or application against its
specificationspecification
 Determines whether combinations of inputs andDetermines whether combinations of inputs and
operations produce expected resultsoperations produce expected results
 When black box testing is applied to softwareWhen black box testing is applied to software
engineering, the tester would only know theengineering, the tester would only know the
"legal" inputs and what the expected outputs"legal" inputs and what the expected outputs
should be, but not how the program actuallyshould be, but not how the program actually
arrives at those outputsarrives at those outputs
Testing Competency 10
Focus of Black-Box TestingFocus of Black-Box Testing
 In this technique, we do not use the codeIn this technique, we do not use the code
to determine a test suite; rather, knowingto determine a test suite; rather, knowing
the problem that we're trying to solve, wethe problem that we're trying to solve, we
come up with four types of test data:come up with four types of test data:
 Easy-to-compute dataEasy-to-compute data
 Typical dataTypical data
 Boundary / extreme dataBoundary / extreme data
 Bogus dataBogus data
Testing Competency 11
Black-Box TestingBlack-Box Testing
TechniquesTechniques
 Equivalence PartitioningEquivalence Partitioning
 Boundary Value AnalysisBoundary Value Analysis
 Error GuessingError Guessing
 Cause-Effect GraphingCause-Effect Graphing
Testing Competency 12
Equivalence PartitioningEquivalence Partitioning
 An equivalence class is a subset of dataAn equivalence class is a subset of data
that is representative of a larger classthat is representative of a larger class
 Equivalence partitioning is a technique forEquivalence partitioning is a technique for
testing equivalence classes rather thantesting equivalence classes rather than
undertaking exhaustive testing of eachundertaking exhaustive testing of each
value of the larger classvalue of the larger class
Testing Competency 13
Example - EPExample - EP
 For example, a program which edits creditFor example, a program which edits credit
limits within a given range ($10,000 -limits within a given range ($10,000 -
$15,000) would have three equivalence$15,000) would have three equivalence
classesclasses
 < $10,000 (invalid)< $10,000 (invalid)
 Between $10,000 and $15,000 (valid)Between $10,000 and $15,000 (valid)
 > $15,000 (invalid)> $15,000 (invalid)
Testing Competency 14
Boundary AnalysisBoundary Analysis
 This technique consists of developing testThis technique consists of developing test
cases and data that focus on the input andcases and data that focus on the input and
output boundaries of a given functionoutput boundaries of a given function
Testing Competency 15
Example – Boundary AnalysisExample – Boundary Analysis
 In the same credit limit example, boundaryIn the same credit limit example, boundary
analysis would test.analysis would test.
 Low boundary -/+ one ($9,999 and $10,001)Low boundary -/+ one ($9,999 and $10,001)
 On the boundary ($10,000 and $15,000)On the boundary ($10,000 and $15,000)
 Upper boundary -/+ one ($14,999 andUpper boundary -/+ one ($14,999 and
$15,001)$15,001)
Testing Competency 16
Error GuessingError Guessing
 Test cases can be developed based uponTest cases can be developed based upon
the intuition and experience of the testerthe intuition and experience of the tester
 For example, where one of the inputs isFor example, where one of the inputs is
the date, a tester may try February 29,the date, a tester may try February 29,
20012001
Testing Competency 17
Cause-Effect GraphingCause-Effect Graphing
 Cause-effect graphing is a technique forCause-effect graphing is a technique for
developing test cases for programs fromdeveloping test cases for programs from
the high-level specifications (A high-levelthe high-level specifications (A high-level
specification states desired characteristicsspecification states desired characteristics
of the system)of the system)
 These characteristics can be used toThese characteristics can be used to
derive test dataderive test data
Testing Competency 18
Example – Cause EffectExample – Cause Effect
 For example, a program that has specifiedFor example, a program that has specified
responses to eight characteristic stimuli (calledresponses to eight characteristic stimuli (called
causes) given some input has 256 "types" ofcauses) given some input has 256 "types" of
input (i.e., those with characteristics 1 & 3; 5, 7input (i.e., those with characteristics 1 & 3; 5, 7
& 8 etc.)& 8 etc.)
 A poor approach is to generate 256 test casesA poor approach is to generate 256 test cases
 A more methodical approach is to use theA more methodical approach is to use the
program specifications to analyze the program'sprogram specifications to analyze the program's
effect on the various types of inputseffect on the various types of inputs
Testing Competency 19
contd…contd…
 The program's output domain can be partitionedThe program's output domain can be partitioned
into various classes called effectsinto various classes called effects
 For example, inputs with characteristic 2 mightFor example, inputs with characteristic 2 might
be subsumed by those with characteristics 3 &be subsumed by those with characteristics 3 &
4. Hence, it would not be necessary to test4. Hence, it would not be necessary to test
inputs with characteristic 2 and characteristics 3inputs with characteristic 2 and characteristics 3
& 4, for they cause the same effect& 4, for they cause the same effect
 This analysis results in a partitioning of theThis analysis results in a partitioning of the
causes according to their corresponding effectscauses according to their corresponding effects
Testing Competency 20
contd…contd…
 A limited entry decision table is then constructedA limited entry decision table is then constructed
from the directed graph reflecting thesefrom the directed graph reflecting these
dependencies (i.e., causes 2 & 3 result in effectdependencies (i.e., causes 2 & 3 result in effect
4; causes 2, 3 & 5 result in effect 6 etc.)4; causes 2, 3 & 5 result in effect 6 etc.)
 The decision table is then reduced and testThe decision table is then reduced and test
cases chosen to exercise each column of thecases chosen to exercise each column of the
tabletable
 Since many aspects of the cause-effect graphingSince many aspects of the cause-effect graphing
can be automated, it is an attractive tool forcan be automated, it is an attractive tool for
aiding in the generation of Functional Test casesaiding in the generation of Functional Test cases
Testing Competency 21
Advantages of Black-BoxAdvantages of Black-Box
TestingTesting
 More effective on larger units of code thanMore effective on larger units of code than
glass box testingglass box testing
 Tester needs no knowledge ofTester needs no knowledge of
implementation, including specificimplementation, including specific
programming languagesprogramming languages
 Tester and programmer are independentTester and programmer are independent
of each otherof each other
Testing Competency 22
Advantages of Black-BoxAdvantages of Black-Box
Testing Contd…Testing Contd…
 Tests are done from a user's point of viewTests are done from a user's point of view
 Will help to expose any ambiguities orWill help to expose any ambiguities or
inconsistencies in the specificationsinconsistencies in the specifications
 Test cases can be designed as soon asTest cases can be designed as soon as
the specifications are completethe specifications are complete
Testing Competency 23
Disadvantages of Black-BoxDisadvantages of Black-Box
TestingTesting
 Only a small number of possible inputs canOnly a small number of possible inputs can
actually be tested, to test every possible inputactually be tested, to test every possible input
stream would take nearly foreverstream would take nearly forever
 Without clear and concise specifications, testWithout clear and concise specifications, test
cases are hard to designcases are hard to design
 There may be unnecessary repetition of testThere may be unnecessary repetition of test
inputs if the tester is not informed of test casesinputs if the tester is not informed of test cases
the programmer has already triedthe programmer has already tried
Testing Competency 24
Disadvantages of Black-Box TestingDisadvantages of Black-Box Testing
Contd…Contd…
 May leave many program paths untestedMay leave many program paths untested
 Cannot be directed toward specificCannot be directed toward specific
segments of code which may be verysegments of code which may be very
complex (and therefore more error prone)complex (and therefore more error prone)
Testing Competency 25
White-Box TestingWhite-Box Testing
 White-box test design allows one to peekWhite-box test design allows one to peek
inside the "box“inside the "box“
 Synonyms for White-box are Structural,Synonyms for White-box are Structural,
Glass-box and Clear-boxGlass-box and Clear-box
Testing Competency 26
cont…cont…
 White-box Testing assumes that the pathWhite-box Testing assumes that the path
of logic in a unit or program is knownof logic in a unit or program is known
 White-box Testing consists of testingWhite-box Testing consists of testing
paths, branch by branch, to producepaths, branch by branch, to produce
predictable resultspredictable results
 Focuses specifically on using internalFocuses specifically on using internal
knowledge of the software to guide theknowledge of the software to guide the
selection of test dataselection of test data
Testing Competency 27
White-Box TestingWhite-Box Testing
TechniquesTechniques
 Statement CoverageStatement Coverage
 execute all statements at least onceexecute all statements at least once
 Decision CoverageDecision Coverage
 execute each decision direction at least onceexecute each decision direction at least once
 Condition CoverageCondition Coverage
 execute each decision with all possibleexecute each decision with all possible
outcomes at least onceoutcomes at least once
Testing Competency 28
cont…cont…
 Decision/Condition CoverageDecision/Condition Coverage
 execute all possible combinations of conditionexecute all possible combinations of condition
outcomes in each decisionoutcomes in each decision
 Multiple Condition CoverageMultiple Condition Coverage
 invoke each point of entry at least onceinvoke each point of entry at least once
Choose the combinations of techniquesChoose the combinations of techniques
appropriate for the applicationappropriate for the application
Testing Competency 29
Statement CoverageStatement Coverage
 Necessary but not sufficient, doesn’t address allNecessary but not sufficient, doesn’t address all
outcomes of decisionsoutcomes of decisions
 For exampleFor example
…………..
Begin()Begin()
If (function1())If (function1())
OpenFile1()OpenFile1()
ElseElse
Shutdown();Shutdown();
………………
 Here if the first IF statement is true thenHere if the first IF statement is true then
Shutdown will never occurShutdown will never occur
Testing Competency 30
Decision CoverageDecision Coverage
 Validates the Branch Statements in softwareValidates the Branch Statements in software
 Overcomes the drawbacks of statementOvercomes the drawbacks of statement
coveragecoverage
 Each decision is tested for a TrueEach decision is tested for a True && FalseFalse
valuevalue
 Each branch direction must be traversed atEach branch direction must be traversed at
least onceleast once
 Branches like if…else, while, for do...whileBranches like if…else, while, for do...while
are to be evaluated for both true and falseare to be evaluated for both true and false
 Test cases will be arrived with the help of aTest cases will be arrived with the help of a
Decision tableDecision table
Testing Competency 31
Cont…Cont…
Decision TableDecision Table
• Table which helps to derive the test casesTable which helps to derive the test cases
StepsSteps
• Identify the variables which are responsible forIdentify the variables which are responsible for
decisiondecision
• Identify the total number of decisions (GiveIdentify the total number of decisions (Give
numbers to them like IF1, IF2… While1, While2numbers to them like IF1, IF2… While1, While2
etc)etc)
• Put thePut the variablesvariables as rows andas rows and decisionsdecisions asas
verticalsverticals
• Start to map the values for each variablesStart to map the values for each variables
corresponding to each decisionscorresponding to each decisions
Testing Competency 32
An ExampleAn Example
Procedure liability (age, sex, married, premium);Procedure liability (age, sex, married, premium);
beginbegin
premium=500;premium=500;
If ((age<25) and (sex=male) and (not married))If ((age<25) and (sex=male) and (not married))  IF-1IF-1
thenthen
premium=Premium+1500;premium=Premium+1500;
elseelse
(if (married or (sex=female))(if (married or (sex=female))  IF-2IF-2
thenthen
premium=premium-200;premium=premium-200;
If( (age>45) and (age<65))If( (age>45) and (age<65))  IF-3IF-3
thenthen
premium= premium-100;premium= premium-100;
end;end;
Here variables areHere variables are age, sexage, sex andand marriedmarried
Decisions are IF1; IF2 ; IF3Decisions are IF1; IF2 ; IF3
Testing Competency 33
DecisionDecision
CoverageCoverage
AgeAge SexSex MarriedMarried TestTest
casecase
IF-1IF-1 <25<25 MaleMale FalseFalse (1) 23 M F(1) 23 M F
IF-1IF-1 <25<25 FemaleFemale FalseFalse (2) 23 F F(2) 23 F F
IF-2IF-2 ** FemaleFemale ** (2)(2)
IF-2IF-2 >=25>=25 MaleMale FalseFalse (3) 50 M F(3) 50 M F
IF-3IF-3 <=45<=45 FemaleFemale ** (2)(2)
IF-3IF-3 >45>45
<65<65
** ** (3)(3)
Decision TableDecision Table
Testing Competency 34
Condition CoverageCondition Coverage
 Validates logical relations and conditionsValidates logical relations and conditions
 All the conditions should be executed at leastAll the conditions should be executed at least
once for the both false and trueonce for the both false and true
 Conditions using relational and logical operatorsConditions using relational and logical operators
should be checked for all possible outcomesshould be checked for all possible outcomes
 Condition coverage checks for true and falseCondition coverage checks for true and false
outcome of each Boolean sub expressionoutcome of each Boolean sub expression
 Test cases will be arrived from using sameTest cases will be arrived from using same
Decision table by putting conditions in place ofDecision table by putting conditions in place of
decisionsdecisions
Testing Competency 35
Test conditionsTest conditions
ConditionCondition
CoverageCoverage
AgeAge SexSex MarriedMarried Test CaseTest Case
IF-1IF-1 <25<25 FemaleFemale FalseFalse (1) 23 F F(1) 23 F F
IF-1IF-1 >=25>=25 MaleMale TrueTrue (2) 30 M T(2) 30 M T
IF-2IF-2 ** MaleMale TrueTrue (2)(2)
IF-2IF-2 ** FemaleFemale FalseFalse (1)(1)
IF-3IF-3 <=45<=45 ** ** (1)(1)
IF-3IF-3 >45>45 ** ** (3) 70 F F(3) 70 F F
IF-3IF-3 <65<65 ** ** (2)(2)
IF-3IF-3 >=65>=65 ** ** (3)(3)
Testing Competency 36
Condition/Decision Coverage
 We may not always get result either in
decision coverage or condition coverage.
In such cases, go in for decision &
condition coverage
 Test cases will be arrived form both
decision as well as condition coverage
Testing Competency 37
Condition/Decision Test caseCondition/Decision Test case
Decision/condition coverageDecision/condition coverage AgeAge SexSex MarriedMarried Test CaseTest Case
IF-1(decision)IF-1(decision) <25<25 MaleMale FalseFalse (1) 23 M F(1) 23 M F
IF-1(decision)IF-1(decision) <25<25 FemaleFemale FalseFalse (2) 23 F F(2) 23 F F
IF-1(condition)IF-1(condition) <25<25 FemaleFemale FalseFalse (2)(2)
IF-1(condition)IF-1(condition) >=25>=25 MaleMale TrueTrue (3) 70 M T(3) 70 M T
IF-2(decision)IF-2(decision) ** FemaleFemale ** (2)(2)
IF-2(decision)IF-2(decision) >=25>=25 MaleMale FalseFalse (4) 50 M F(4) 50 M F
IF-2(condition)IF-2(condition) ** MaleMale TrueTrue (3)(3)
IF-2(condition)IF-2(condition) ** FemaleFemale FalseFalse (2)(2)
IF-3(decision)IF-3(decision) <=45<=45 ** ** (2)(2)
IF-3(decision)IF-3(decision) >45, <65>45, <65 ** ** (4)(4)
IF-3(condition)IF-3(condition) <=45<=45 ** ** (2)(2)
IF-3(condition)IF-3(condition) >45>45 ** ** (4)(4)
IF-3(condition)IF-3(condition) <65<65 ** ** (4)(4)
IF-3(condition)IF-3(condition) >=65>=65 ** ** (3)(3)
Testing Competency 38
Multiple ConditionMultiple Condition
CoverageCoverage
 Checks whether every possible combination ofChecks whether every possible combination of
Boolean sub expression occurs at least onceBoolean sub expression occurs at least once
(2n), where “n” is the number of variables in a(2n), where “n” is the number of variables in a
given branchgiven branch
 Test cases required for this method can beTest cases required for this method can be
arrived at by using truth table of the conditionsarrived at by using truth table of the conditions
 Large number of test cases may be required forLarge number of test cases may be required for
full multiple condition coveragefull multiple condition coverage
Testing Competency 39
Multiple Conditions Coverage –
Test cases
Multiple condition coverageMultiple condition coverage AgeAge SexSex MarriedMarried Test CaseTest Case
IF-1IF-1 <25<25 MaleMale TrueTrue (1) 23 M T(1) 23 M T
IF-1IF-1 <25<25 MaleMale FalseFalse (2) 23 M F(2) 23 M F
IF-1IF-1 <25<25 FemaleFemale TrueTrue (3) 23 F T(3) 23 F T
IF-1IF-1 <25<25 FemaleFemale FalseFalse (4) 23 F F(4) 23 F F
IF-1IF-1 >=25>=25 MaleMale TrueTrue (5) 30 M T(5) 30 M T
IF-1IF-1 >=25>=25 MaleMale FalseFalse (6) 70 M F(6) 70 M F
IF-1IF-1 >=25>=25 FemaleFemale TrueTrue (7) 50 F T(7) 50 F T
IF-1IF-1 >=25>=25 FemaleFemale FalseFalse (8) 30 F F(8) 30 F F
IF-2IF-2 ** MaleMale TrueTrue (5)(5)
IF-2IF-2 ** MaleMale FalseFalse (6)(6)
IF-2IF-2 ** FemaleFemale TrueTrue (7)(7)
IF-2IF-2 ** FemaleFemale FalseFalse (8)(8)
IF-3IF-3 <=45, >=65<=45, >=65 ** ** ImpossibleImpossible
IF-3IF-3 <=45,<65<=45,<65 ** ** (8)(8)
IF-3IF-3 >45, >=65>45, >=65 ** ** (6)(6)
IF-3IF-3 >45, <65>45, <65 ** ** (7)(7)
Testing Competency 40
Gray-Box TestingGray-Box Testing
: An Introduction: An Introduction
 Blending of Structural and FunctionalBlending of Structural and Functional
Testing methods throughout the entireTesting methods throughout the entire
testing proceduretesting procedure
 Examines the activity of back-endExamines the activity of back-end
components during test case executioncomponents during test case execution
Testing Competency 41
Thank you !Thank you !

More Related Content

PPTX
Black box software testing
PPT
Whitebox testing
PPSX
Principles of Software testing
PPTX
Software testing ppt
PPTX
WHITE BOX TESTING ashu.pptx
PPTX
White Box Testing
PPT
Black Box Testing
PDF
Software Testing Techniques: An Overview
Black box software testing
Whitebox testing
Principles of Software testing
Software testing ppt
WHITE BOX TESTING ashu.pptx
White Box Testing
Black Box Testing
Software Testing Techniques: An Overview

What's hot (20)

PDF
Black Box Testing
PPT
Software Testing
PPTX
Waterfall model ppt final
PPTX
Software Development Life Cycle-SDLC
PDF
What is Integration Testing? | Edureka
PPTX
Software process
PPT
PDF
Testing methodology
PPTX
PPTX
Software Process Models
PPTX
Software testing life cycle
PPTX
Test case techniques
PPTX
System testing
PPTX
System testing
PPT
Testing fundamentals
PPTX
Software testing & Quality Assurance
PPTX
Software Engineering - Spiral Model
PPTX
Unified process Model
PPT
Testing concepts ppt
PDF
STLC (Software Testing Life Cycle)
Black Box Testing
Software Testing
Waterfall model ppt final
Software Development Life Cycle-SDLC
What is Integration Testing? | Edureka
Software process
Testing methodology
Software Process Models
Software testing life cycle
Test case techniques
System testing
System testing
Testing fundamentals
Software testing & Quality Assurance
Software Engineering - Spiral Model
Unified process Model
Testing concepts ppt
STLC (Software Testing Life Cycle)
Ad

Similar to Black box & white-box testing technique (20)

PPTX
Lavenya Testing.pptx
PPT
Dynamic Testing
PPSX
Test Case Design and Technique
PPTX
Test Case Design
PPTX
Test Case Design & Technique
PPTX
Test Case Design and Technique
PPSX
Test Case Design and Technique
PPTX
presentation_testing_1455044600_187410.pptx
PPTX
Blackbox
PPT
Dynamic analysis in Software Testing
PPTX
Black box testing
PDF
Paper 06
PPTX
PPTX
5 black box and grey box testing
PPT
Testing
PPTX
Unit2 for st
PPTX
White box & black box testing
PPTX
ISTQB Foundation Level – Chapter 4: Test Design Techniques
PPT
&lt;p>Software Testing&lt;/p>
Lavenya Testing.pptx
Dynamic Testing
Test Case Design and Technique
Test Case Design
Test Case Design & Technique
Test Case Design and Technique
Test Case Design and Technique
presentation_testing_1455044600_187410.pptx
Blackbox
Dynamic analysis in Software Testing
Black box testing
Paper 06
5 black box and grey box testing
Testing
Unit2 for st
White box & black box testing
ISTQB Foundation Level – Chapter 4: Test Design Techniques
&lt;p>Software Testing&lt;/p>
Ad

More from SivaprasanthRentala1975 (20)

PPT
Testing using load runner performance testing
PPT
Why contract savings are missing
PPT
PPT
The new mainframe
PPT
Test execution may_04_2006
PPT
Telecom testing
PPT
PPT
Pt presentation1
PPT
Pp employee learnnig initiative-iss-220-g tle 2007
PPT
Performance testing and rpt
PPT
Xpediter kanbay
PPS
Copy of good quotes.ppt
PPT
Contract savings new
PPT
Contract savings schema
PPT
Contract savings may 10th 2004 by gm euro
Testing using load runner performance testing
Why contract savings are missing
The new mainframe
Test execution may_04_2006
Telecom testing
Pt presentation1
Pp employee learnnig initiative-iss-220-g tle 2007
Performance testing and rpt
Xpediter kanbay
Copy of good quotes.ppt
Contract savings new
Contract savings schema
Contract savings may 10th 2004 by gm euro

Recently uploaded (20)

PPTX
Software Engineering BSC DS UNIT 1 .pptx
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
Piense y hagase Rico - Napoleon Hill Ccesa007.pdf
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
Landforms and landscapes data surprise preview
PPTX
Cardiovascular Pharmacology for pharmacy students.pptx
PPTX
How to Manage Bill Control Policy in Odoo 18
PDF
Insiders guide to clinical Medicine.pdf
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PPTX
NOI Hackathon - Summer Edition - GreenThumber.pptx
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
PDF
Cell Biology Basics: Cell Theory, Structure, Types, and Organelles | BS Level...
PDF
Mga Unang Hakbang Tungo Sa Tao by Joe Vibar Nero.pdf
PPTX
Congenital Hypothyroidism pptx
PPTX
Introduction and Scope of Bichemistry.pptx
PDF
From loneliness to social connection charting
PPTX
Nursing Management of Patients with Disorders of Ear, Nose, and Throat (ENT) ...
PPTX
COMPUTERS AS DATA ANALYSIS IN PRECLINICAL DEVELOPMENT.pptx
PPTX
How to Manage Starshipit in Odoo 18 - Odoo Slides
Software Engineering BSC DS UNIT 1 .pptx
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Piense y hagase Rico - Napoleon Hill Ccesa007.pdf
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Landforms and landscapes data surprise preview
Cardiovascular Pharmacology for pharmacy students.pptx
How to Manage Bill Control Policy in Odoo 18
Insiders guide to clinical Medicine.pdf
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
NOI Hackathon - Summer Edition - GreenThumber.pptx
Abdominal Access Techniques with Prof. Dr. R K Mishra
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
Cell Biology Basics: Cell Theory, Structure, Types, and Organelles | BS Level...
Mga Unang Hakbang Tungo Sa Tao by Joe Vibar Nero.pdf
Congenital Hypothyroidism pptx
Introduction and Scope of Bichemistry.pptx
From loneliness to social connection charting
Nursing Management of Patients with Disorders of Ear, Nose, and Throat (ENT) ...
COMPUTERS AS DATA ANALYSIS IN PRECLINICAL DEVELOPMENT.pptx
How to Manage Starshipit in Odoo 18 - Odoo Slides

Black box & white-box testing technique

  • 1. Testing CompetencyTesting Competency 11 White Box & Black BoxWhite Box & Black Box Testing TechniquesTesting Techniques ManishManish Roopa SRoopa S
  • 2. Testing Competency 2 What does Test meanWhat does Test mean  The word “TEST” is derived from the LatinThe word “TEST” is derived from the Latin word “Testum” meaning a pottery vesselword “Testum” meaning a pottery vessel used to measure or assessused to measure or assess
  • 3. Testing Competency 3 Software TestingSoftware Testing  Testing of software means assessing orTesting of software means assessing or Measuring the software to determineMeasuring the software to determine its QUALITYits QUALITY  Area of testing is one of the key processArea of testing is one of the key process areas of project life cycle in ensuringareas of project life cycle in ensuring the QUALITY of the softwarethe QUALITY of the software
  • 4. Testing Competency 4 QUALITYQUALITY What is Quality product ?What is Quality product ?  A quality product is one which is fit for use.A quality product is one which is fit for use.  A quality product is one which is producedA quality product is one which is produced as per pre-defined specifications.as per pre-defined specifications.
  • 5. Testing Competency 5 Various TestingVarious Testing TechniquesTechniques  Structural & FunctionalStructural & Functional  Verification & Validation (V&V)Verification & Validation (V&V)  Static & DynamicStatic & Dynamic  White-Box & Black-BoxWhite-Box & Black-Box
  • 6. Testing Competency 6 Levels of TestingLevels of Testing Levels of TestingLevels of Testing Testing TechniquesTesting Techniques Unit TestingUnit Testing Structural Testing IntegrationIntegration Structural & Functional SystemSystem Functional, Risk based AcceptanceAcceptance Functional, Risk based
  • 7. Testing Competency 7 Test Design MethodsTest Design Methods  Black-Box and White-Box are Test DesignBlack-Box and White-Box are Test Design MethodsMethods
  • 8. Testing Competency 8 Black-Box TestingBlack-Box Testing  Black Box Testing is testing technique havingBlack Box Testing is testing technique having no knowledge of the internalno knowledge of the internal functionality/structure of the systemfunctionality/structure of the system  Synonyms for Black-Box are Behavioral,Synonyms for Black-Box are Behavioral, Functional, Opaque-Box, Closed-Box etc.Functional, Opaque-Box, Closed-Box etc.
  • 9. Testing Competency 9 contd…contd…  Black-box Testing focuses on testing theBlack-box Testing focuses on testing the function of the program or application against itsfunction of the program or application against its specificationspecification  Determines whether combinations of inputs andDetermines whether combinations of inputs and operations produce expected resultsoperations produce expected results  When black box testing is applied to softwareWhen black box testing is applied to software engineering, the tester would only know theengineering, the tester would only know the "legal" inputs and what the expected outputs"legal" inputs and what the expected outputs should be, but not how the program actuallyshould be, but not how the program actually arrives at those outputsarrives at those outputs
  • 10. Testing Competency 10 Focus of Black-Box TestingFocus of Black-Box Testing  In this technique, we do not use the codeIn this technique, we do not use the code to determine a test suite; rather, knowingto determine a test suite; rather, knowing the problem that we're trying to solve, wethe problem that we're trying to solve, we come up with four types of test data:come up with four types of test data:  Easy-to-compute dataEasy-to-compute data  Typical dataTypical data  Boundary / extreme dataBoundary / extreme data  Bogus dataBogus data
  • 11. Testing Competency 11 Black-Box TestingBlack-Box Testing TechniquesTechniques  Equivalence PartitioningEquivalence Partitioning  Boundary Value AnalysisBoundary Value Analysis  Error GuessingError Guessing  Cause-Effect GraphingCause-Effect Graphing
  • 12. Testing Competency 12 Equivalence PartitioningEquivalence Partitioning  An equivalence class is a subset of dataAn equivalence class is a subset of data that is representative of a larger classthat is representative of a larger class  Equivalence partitioning is a technique forEquivalence partitioning is a technique for testing equivalence classes rather thantesting equivalence classes rather than undertaking exhaustive testing of eachundertaking exhaustive testing of each value of the larger classvalue of the larger class
  • 13. Testing Competency 13 Example - EPExample - EP  For example, a program which edits creditFor example, a program which edits credit limits within a given range ($10,000 -limits within a given range ($10,000 - $15,000) would have three equivalence$15,000) would have three equivalence classesclasses  < $10,000 (invalid)< $10,000 (invalid)  Between $10,000 and $15,000 (valid)Between $10,000 and $15,000 (valid)  > $15,000 (invalid)> $15,000 (invalid)
  • 14. Testing Competency 14 Boundary AnalysisBoundary Analysis  This technique consists of developing testThis technique consists of developing test cases and data that focus on the input andcases and data that focus on the input and output boundaries of a given functionoutput boundaries of a given function
  • 15. Testing Competency 15 Example – Boundary AnalysisExample – Boundary Analysis  In the same credit limit example, boundaryIn the same credit limit example, boundary analysis would test.analysis would test.  Low boundary -/+ one ($9,999 and $10,001)Low boundary -/+ one ($9,999 and $10,001)  On the boundary ($10,000 and $15,000)On the boundary ($10,000 and $15,000)  Upper boundary -/+ one ($14,999 andUpper boundary -/+ one ($14,999 and $15,001)$15,001)
  • 16. Testing Competency 16 Error GuessingError Guessing  Test cases can be developed based uponTest cases can be developed based upon the intuition and experience of the testerthe intuition and experience of the tester  For example, where one of the inputs isFor example, where one of the inputs is the date, a tester may try February 29,the date, a tester may try February 29, 20012001
  • 17. Testing Competency 17 Cause-Effect GraphingCause-Effect Graphing  Cause-effect graphing is a technique forCause-effect graphing is a technique for developing test cases for programs fromdeveloping test cases for programs from the high-level specifications (A high-levelthe high-level specifications (A high-level specification states desired characteristicsspecification states desired characteristics of the system)of the system)  These characteristics can be used toThese characteristics can be used to derive test dataderive test data
  • 18. Testing Competency 18 Example – Cause EffectExample – Cause Effect  For example, a program that has specifiedFor example, a program that has specified responses to eight characteristic stimuli (calledresponses to eight characteristic stimuli (called causes) given some input has 256 "types" ofcauses) given some input has 256 "types" of input (i.e., those with characteristics 1 & 3; 5, 7input (i.e., those with characteristics 1 & 3; 5, 7 & 8 etc.)& 8 etc.)  A poor approach is to generate 256 test casesA poor approach is to generate 256 test cases  A more methodical approach is to use theA more methodical approach is to use the program specifications to analyze the program'sprogram specifications to analyze the program's effect on the various types of inputseffect on the various types of inputs
  • 19. Testing Competency 19 contd…contd…  The program's output domain can be partitionedThe program's output domain can be partitioned into various classes called effectsinto various classes called effects  For example, inputs with characteristic 2 mightFor example, inputs with characteristic 2 might be subsumed by those with characteristics 3 &be subsumed by those with characteristics 3 & 4. Hence, it would not be necessary to test4. Hence, it would not be necessary to test inputs with characteristic 2 and characteristics 3inputs with characteristic 2 and characteristics 3 & 4, for they cause the same effect& 4, for they cause the same effect  This analysis results in a partitioning of theThis analysis results in a partitioning of the causes according to their corresponding effectscauses according to their corresponding effects
  • 20. Testing Competency 20 contd…contd…  A limited entry decision table is then constructedA limited entry decision table is then constructed from the directed graph reflecting thesefrom the directed graph reflecting these dependencies (i.e., causes 2 & 3 result in effectdependencies (i.e., causes 2 & 3 result in effect 4; causes 2, 3 & 5 result in effect 6 etc.)4; causes 2, 3 & 5 result in effect 6 etc.)  The decision table is then reduced and testThe decision table is then reduced and test cases chosen to exercise each column of thecases chosen to exercise each column of the tabletable  Since many aspects of the cause-effect graphingSince many aspects of the cause-effect graphing can be automated, it is an attractive tool forcan be automated, it is an attractive tool for aiding in the generation of Functional Test casesaiding in the generation of Functional Test cases
  • 21. Testing Competency 21 Advantages of Black-BoxAdvantages of Black-Box TestingTesting  More effective on larger units of code thanMore effective on larger units of code than glass box testingglass box testing  Tester needs no knowledge ofTester needs no knowledge of implementation, including specificimplementation, including specific programming languagesprogramming languages  Tester and programmer are independentTester and programmer are independent of each otherof each other
  • 22. Testing Competency 22 Advantages of Black-BoxAdvantages of Black-Box Testing Contd…Testing Contd…  Tests are done from a user's point of viewTests are done from a user's point of view  Will help to expose any ambiguities orWill help to expose any ambiguities or inconsistencies in the specificationsinconsistencies in the specifications  Test cases can be designed as soon asTest cases can be designed as soon as the specifications are completethe specifications are complete
  • 23. Testing Competency 23 Disadvantages of Black-BoxDisadvantages of Black-Box TestingTesting  Only a small number of possible inputs canOnly a small number of possible inputs can actually be tested, to test every possible inputactually be tested, to test every possible input stream would take nearly foreverstream would take nearly forever  Without clear and concise specifications, testWithout clear and concise specifications, test cases are hard to designcases are hard to design  There may be unnecessary repetition of testThere may be unnecessary repetition of test inputs if the tester is not informed of test casesinputs if the tester is not informed of test cases the programmer has already triedthe programmer has already tried
  • 24. Testing Competency 24 Disadvantages of Black-Box TestingDisadvantages of Black-Box Testing Contd…Contd…  May leave many program paths untestedMay leave many program paths untested  Cannot be directed toward specificCannot be directed toward specific segments of code which may be verysegments of code which may be very complex (and therefore more error prone)complex (and therefore more error prone)
  • 25. Testing Competency 25 White-Box TestingWhite-Box Testing  White-box test design allows one to peekWhite-box test design allows one to peek inside the "box“inside the "box“  Synonyms for White-box are Structural,Synonyms for White-box are Structural, Glass-box and Clear-boxGlass-box and Clear-box
  • 26. Testing Competency 26 cont…cont…  White-box Testing assumes that the pathWhite-box Testing assumes that the path of logic in a unit or program is knownof logic in a unit or program is known  White-box Testing consists of testingWhite-box Testing consists of testing paths, branch by branch, to producepaths, branch by branch, to produce predictable resultspredictable results  Focuses specifically on using internalFocuses specifically on using internal knowledge of the software to guide theknowledge of the software to guide the selection of test dataselection of test data
  • 27. Testing Competency 27 White-Box TestingWhite-Box Testing TechniquesTechniques  Statement CoverageStatement Coverage  execute all statements at least onceexecute all statements at least once  Decision CoverageDecision Coverage  execute each decision direction at least onceexecute each decision direction at least once  Condition CoverageCondition Coverage  execute each decision with all possibleexecute each decision with all possible outcomes at least onceoutcomes at least once
  • 28. Testing Competency 28 cont…cont…  Decision/Condition CoverageDecision/Condition Coverage  execute all possible combinations of conditionexecute all possible combinations of condition outcomes in each decisionoutcomes in each decision  Multiple Condition CoverageMultiple Condition Coverage  invoke each point of entry at least onceinvoke each point of entry at least once Choose the combinations of techniquesChoose the combinations of techniques appropriate for the applicationappropriate for the application
  • 29. Testing Competency 29 Statement CoverageStatement Coverage  Necessary but not sufficient, doesn’t address allNecessary but not sufficient, doesn’t address all outcomes of decisionsoutcomes of decisions  For exampleFor example ………….. Begin()Begin() If (function1())If (function1()) OpenFile1()OpenFile1() ElseElse Shutdown();Shutdown(); ………………  Here if the first IF statement is true thenHere if the first IF statement is true then Shutdown will never occurShutdown will never occur
  • 30. Testing Competency 30 Decision CoverageDecision Coverage  Validates the Branch Statements in softwareValidates the Branch Statements in software  Overcomes the drawbacks of statementOvercomes the drawbacks of statement coveragecoverage  Each decision is tested for a TrueEach decision is tested for a True && FalseFalse valuevalue  Each branch direction must be traversed atEach branch direction must be traversed at least onceleast once  Branches like if…else, while, for do...whileBranches like if…else, while, for do...while are to be evaluated for both true and falseare to be evaluated for both true and false  Test cases will be arrived with the help of aTest cases will be arrived with the help of a Decision tableDecision table
  • 31. Testing Competency 31 Cont…Cont… Decision TableDecision Table • Table which helps to derive the test casesTable which helps to derive the test cases StepsSteps • Identify the variables which are responsible forIdentify the variables which are responsible for decisiondecision • Identify the total number of decisions (GiveIdentify the total number of decisions (Give numbers to them like IF1, IF2… While1, While2numbers to them like IF1, IF2… While1, While2 etc)etc) • Put thePut the variablesvariables as rows andas rows and decisionsdecisions asas verticalsverticals • Start to map the values for each variablesStart to map the values for each variables corresponding to each decisionscorresponding to each decisions
  • 32. Testing Competency 32 An ExampleAn Example Procedure liability (age, sex, married, premium);Procedure liability (age, sex, married, premium); beginbegin premium=500;premium=500; If ((age<25) and (sex=male) and (not married))If ((age<25) and (sex=male) and (not married))  IF-1IF-1 thenthen premium=Premium+1500;premium=Premium+1500; elseelse (if (married or (sex=female))(if (married or (sex=female))  IF-2IF-2 thenthen premium=premium-200;premium=premium-200; If( (age>45) and (age<65))If( (age>45) and (age<65))  IF-3IF-3 thenthen premium= premium-100;premium= premium-100; end;end; Here variables areHere variables are age, sexage, sex andand marriedmarried Decisions are IF1; IF2 ; IF3Decisions are IF1; IF2 ; IF3
  • 33. Testing Competency 33 DecisionDecision CoverageCoverage AgeAge SexSex MarriedMarried TestTest casecase IF-1IF-1 <25<25 MaleMale FalseFalse (1) 23 M F(1) 23 M F IF-1IF-1 <25<25 FemaleFemale FalseFalse (2) 23 F F(2) 23 F F IF-2IF-2 ** FemaleFemale ** (2)(2) IF-2IF-2 >=25>=25 MaleMale FalseFalse (3) 50 M F(3) 50 M F IF-3IF-3 <=45<=45 FemaleFemale ** (2)(2) IF-3IF-3 >45>45 <65<65 ** ** (3)(3) Decision TableDecision Table
  • 34. Testing Competency 34 Condition CoverageCondition Coverage  Validates logical relations and conditionsValidates logical relations and conditions  All the conditions should be executed at leastAll the conditions should be executed at least once for the both false and trueonce for the both false and true  Conditions using relational and logical operatorsConditions using relational and logical operators should be checked for all possible outcomesshould be checked for all possible outcomes  Condition coverage checks for true and falseCondition coverage checks for true and false outcome of each Boolean sub expressionoutcome of each Boolean sub expression  Test cases will be arrived from using sameTest cases will be arrived from using same Decision table by putting conditions in place ofDecision table by putting conditions in place of decisionsdecisions
  • 35. Testing Competency 35 Test conditionsTest conditions ConditionCondition CoverageCoverage AgeAge SexSex MarriedMarried Test CaseTest Case IF-1IF-1 <25<25 FemaleFemale FalseFalse (1) 23 F F(1) 23 F F IF-1IF-1 >=25>=25 MaleMale TrueTrue (2) 30 M T(2) 30 M T IF-2IF-2 ** MaleMale TrueTrue (2)(2) IF-2IF-2 ** FemaleFemale FalseFalse (1)(1) IF-3IF-3 <=45<=45 ** ** (1)(1) IF-3IF-3 >45>45 ** ** (3) 70 F F(3) 70 F F IF-3IF-3 <65<65 ** ** (2)(2) IF-3IF-3 >=65>=65 ** ** (3)(3)
  • 36. Testing Competency 36 Condition/Decision Coverage  We may not always get result either in decision coverage or condition coverage. In such cases, go in for decision & condition coverage  Test cases will be arrived form both decision as well as condition coverage
  • 37. Testing Competency 37 Condition/Decision Test caseCondition/Decision Test case Decision/condition coverageDecision/condition coverage AgeAge SexSex MarriedMarried Test CaseTest Case IF-1(decision)IF-1(decision) <25<25 MaleMale FalseFalse (1) 23 M F(1) 23 M F IF-1(decision)IF-1(decision) <25<25 FemaleFemale FalseFalse (2) 23 F F(2) 23 F F IF-1(condition)IF-1(condition) <25<25 FemaleFemale FalseFalse (2)(2) IF-1(condition)IF-1(condition) >=25>=25 MaleMale TrueTrue (3) 70 M T(3) 70 M T IF-2(decision)IF-2(decision) ** FemaleFemale ** (2)(2) IF-2(decision)IF-2(decision) >=25>=25 MaleMale FalseFalse (4) 50 M F(4) 50 M F IF-2(condition)IF-2(condition) ** MaleMale TrueTrue (3)(3) IF-2(condition)IF-2(condition) ** FemaleFemale FalseFalse (2)(2) IF-3(decision)IF-3(decision) <=45<=45 ** ** (2)(2) IF-3(decision)IF-3(decision) >45, <65>45, <65 ** ** (4)(4) IF-3(condition)IF-3(condition) <=45<=45 ** ** (2)(2) IF-3(condition)IF-3(condition) >45>45 ** ** (4)(4) IF-3(condition)IF-3(condition) <65<65 ** ** (4)(4) IF-3(condition)IF-3(condition) >=65>=65 ** ** (3)(3)
  • 38. Testing Competency 38 Multiple ConditionMultiple Condition CoverageCoverage  Checks whether every possible combination ofChecks whether every possible combination of Boolean sub expression occurs at least onceBoolean sub expression occurs at least once (2n), where “n” is the number of variables in a(2n), where “n” is the number of variables in a given branchgiven branch  Test cases required for this method can beTest cases required for this method can be arrived at by using truth table of the conditionsarrived at by using truth table of the conditions  Large number of test cases may be required forLarge number of test cases may be required for full multiple condition coveragefull multiple condition coverage
  • 39. Testing Competency 39 Multiple Conditions Coverage – Test cases Multiple condition coverageMultiple condition coverage AgeAge SexSex MarriedMarried Test CaseTest Case IF-1IF-1 <25<25 MaleMale TrueTrue (1) 23 M T(1) 23 M T IF-1IF-1 <25<25 MaleMale FalseFalse (2) 23 M F(2) 23 M F IF-1IF-1 <25<25 FemaleFemale TrueTrue (3) 23 F T(3) 23 F T IF-1IF-1 <25<25 FemaleFemale FalseFalse (4) 23 F F(4) 23 F F IF-1IF-1 >=25>=25 MaleMale TrueTrue (5) 30 M T(5) 30 M T IF-1IF-1 >=25>=25 MaleMale FalseFalse (6) 70 M F(6) 70 M F IF-1IF-1 >=25>=25 FemaleFemale TrueTrue (7) 50 F T(7) 50 F T IF-1IF-1 >=25>=25 FemaleFemale FalseFalse (8) 30 F F(8) 30 F F IF-2IF-2 ** MaleMale TrueTrue (5)(5) IF-2IF-2 ** MaleMale FalseFalse (6)(6) IF-2IF-2 ** FemaleFemale TrueTrue (7)(7) IF-2IF-2 ** FemaleFemale FalseFalse (8)(8) IF-3IF-3 <=45, >=65<=45, >=65 ** ** ImpossibleImpossible IF-3IF-3 <=45,<65<=45,<65 ** ** (8)(8) IF-3IF-3 >45, >=65>45, >=65 ** ** (6)(6) IF-3IF-3 >45, <65>45, <65 ** ** (7)(7)
  • 40. Testing Competency 40 Gray-Box TestingGray-Box Testing : An Introduction: An Introduction  Blending of Structural and FunctionalBlending of Structural and Functional Testing methods throughout the entireTesting methods throughout the entire testing proceduretesting procedure  Examines the activity of back-endExamines the activity of back-end components during test case executioncomponents during test case execution
  • 41. Testing Competency 41 Thank you !Thank you !