SlideShare a Scribd company logo
1 of 34
© Copyright GlobalLogic 2009 1
Connect. Collaborate. Innovate.
ISTQB
Test design Techniques
Akshi Chawla
20th
June 2011
Internal
© Copyright GlobalLogic 2009 2
Connect. Collaborate. Innovate.
Switch off your Mobile phone
Or
Put the Mobile phone on silent
mode
© Copyright GlobalLogic 2009 3
Connect. Collaborate. Innovate.
Agenda
 Test design Techniques
 Static Testing
 Black Box Testing
 White Box testing
 Experience Based Testing
 Choosing a Testing Technique
 Q & A
© Copyright GlobalLogic 2009 4
Connect. Collaborate. Innovate.
Test Design Techniques
Static Dynamic
Structural based
Informal ReviewInformal Review
Technical ReviewTechnical Review
WalkthroughWalkthrough
Static AnalysisStatic Analysis
InspectionInspection
Experienced Based
Data FlowData Flow
Control FlowControl Flow
Multiple ConditionMultiple Condition
ConditionCondition
ExploratoryExploratory
Error GuessingError Guessing
DecisionDecision
StatementStatement
State TransitionState Transition
Decision tableDecision table
BVABVA
EQP
Specification basedSpecification based
Use CaseUse Case
© Copyright GlobalLogic 2009 5
Connect. Collaborate. Innovate.
Static Testing
 Non Execution Technique
 Used to Review Documents
 Review Process
• Informal Review
• Formal Review
• Walkthrough
• Technical Review
• Inspection
© Copyright GlobalLogic 2009 6
Connect. Collaborate. Innovate.
 Roles and Responsibilities
1. Moderator
2. Author
3. Scribe
4. Reviewers
5. Manager
 Phases of Formal Review
1. Planning
2. Kick Off
3. Preparation
4. Review Meetings
5. Rework
6. Follow up
Static Testing
© Copyright GlobalLogic 2009 7
Connect. Collaborate. Innovate.
Static Analysis: Cyclomatic Complexity
 Developed by Thomas J. McCabe
 Provide a quantitative measure of logical complexity of
program
 Cyclomatic complexity is computed using the control flow
graph of the program
© Copyright GlobalLogic 2009 8
Connect. Collaborate. Innovate.
Control flow graph (CFG)
 It is the way control flows through the program
 Three kinds of nodes:
Statement nodes: single-entry-single-exit
sequences of statements
Predicate (decision) nodes: conditions for
branching
 Auxiliary nodes: (optional) for easier
understanding (e.g. “merge points” for IF)
 Edges: possible flow of control
© Copyright GlobalLogic 2009 9
Connect. Collaborate. Innovate.
How to Draw CFG
int f1(int x,int y){
1. while (x != y){
2. if (x>y) then
3. x=x-y;
4. else y=y-x;
5. }
6. return x; }
© Copyright GlobalLogic 2009 10
Connect. Collaborate. Innovate.
Cyclomatic complexity Definition
 Cyclomatic Complexity V(G) for a graph (G)
• V(G) = E-N+2
E = Edges
N=Nodes
• V(G)= P+1
P= Predicate node.
• V(G) = Total number of bounded areas + 1
Any region enclosed by a nodes and edge sequence.
© Copyright GlobalLogic 2009 11
Connect. Collaborate. Innovate.
Example
The Flow Graph has 3 regions
V(G) = 2 predicate nodes +1= 3
V(G) = 7edges- 6 nodes +2 = 3
V(G) = 2 bounded area +1 = 3
11
22
33 44
55
66
© Copyright GlobalLogic 2009 13
Connect. Collaborate. Innovate.
Derivation of Test Cases
 Number of independent paths: 3
• 1, 6 test case (x=1, y=1)
• 1, 2, 3, 5, 1, 6 test case(x=1, y=2)
• 1, 2, 4, 5, 1, 6 test case(x=2, y=1)
© Copyright GlobalLogic 2009 15
Connect. Collaborate. Innovate.
Black box testing
Focuses on Functional and Non Functional requirement
requirements
outputs
events
inputs
© Copyright GlobalLogic 2009 16
Connect. Collaborate. Innovate.
Black Box Testing Types
 Equivalence class partitioning
 Boundary value analysis
 Decision table testing
 State Transition
© Copyright GlobalLogic 2009 17
Connect. Collaborate. Innovate.
Black Box - Equivalence Class Partitioning
 Input values to a program are partitioned into equivalence classes.
 Why we do Partitioning?
© Copyright GlobalLogic 2009 18
Connect. Collaborate. Innovate.
Example
 A program reads an input value in the range of 1 and 5000:
• computes the square root of the input number
SQRTSQRT
 There are three equivalence classes:
• the set of negative integers,
• set of integers in the range of 1 and 5000,
• integers larger than 5000.
© Copyright GlobalLogic 2009 19
Connect. Collaborate. Innovate.
Example (cont.)
 The test suite must include:
• representatives from each of the three equivalence classes:
• a possible test suite can be:
{-5,500,6000}.
11 50005000
© Copyright GlobalLogic 2009 20
Connect. Collaborate. Innovate.
Black Box - Boundary Value Analysis
 Some typical programming errors occur:
• at boundaries of equivalence classes
 Programmers often fail to see:
• special processing required at the boundaries of equivalence classes.
 Compute square root of an integer in the range of 1 and 5000:
• test cases : {0,1,5000,5001}.
11 50005000
© Copyright GlobalLogic 2009 21
Connect. Collaborate. Innovate.
Black Box - Decision Table
 A decision table is a good way to deal with combinations of things (e.g.
inputs).
 Known as ‘Cause-Effect' table.
 Testing all combinations may be impractical if not impossible
 How to Use Decision Table
• Identify the conditions
• Identify combination of true or false. Rules = 2n
(where n is number of conditions )
• Identify correct outcome for each combination
• Write Test Cases based for each rule
No ISTQB Exam fee is reimbursed to the employee until he attends the
training course. After attending the training, reimburse 50% for Band0
employee or 80% for Band 1 employee
© Copyright GlobalLogic 2009 22
Connect. Collaborate. Innovate.
Black Box - State Transition
 It focuses on how state transition from one stage to next depending on
events
 In this technique state of system is first recognized and then test cases are
written to test the transition from one state to another
© Copyright GlobalLogic 2009 23
Connect. Collaborate. Innovate.
Black Box - State Transition
 A website shopping basket start out as empty. As purchases are selected they are added to shopping
basket. Items can also be removed from shopping basket. When the customer decides to check out , a
summary of items in the basket and total cost are shown , for customer to say whether this is Ok or
not. If the content and prices are Ok, then you leave summary display and go to payment system .
Otherwise you go back to shopping ( so you can remove items if you want)
© Copyright GlobalLogic 2009 24
Connect. Collaborate. Innovate.
Black Box – N-Switch Testing
 0-switch coverage
• Coverage of all individual transitions
 l-switch coverage
• Coverage of transition pairs
 2-switch coverage
• Coverage of transition triples is, etc.
© Copyright GlobalLogic 2009 25
Connect. Collaborate. Innovate.
White Box Testing
 Focuses on Internal Knowledge
• Exercise all independent paths
• exercise all logical decisions
• execute all loops
© Copyright GlobalLogic 2009 26
Connect. Collaborate. Innovate.
White Box Testing Types
 Statement coverage
 Branch coverage
 Path coverage
 Condition coverage
© Copyright GlobalLogic 2009 27
Connect. Collaborate. Innovate.
White Box - Statement Coverage
 Methodology:
• Every statement is executed at least once.
 The principal idea:
• unless a statement is executed, we have no way of knowing if an error
exists in that statement
Number of Statement Exercised
Statement coverage = --------------------------------------------- x 100%
Total number of statements
© Copyright GlobalLogic 2009 28
Connect. Collaborate. Innovate.
Example
1 READ A
2 READ B
3 C =A + 2*B
4 IF C> 50 THEN
5 PRINT large C
6 ENDIF
11
22
33
44
55
66
© Copyright GlobalLogic 2009 29
Connect. Collaborate. Innovate.
White Box - Branch Coverage
 Test cases are designed such that:
• different branch conditions is given true and false values in turn.
 Branch testing guarantees statement coverage
© Copyright GlobalLogic 2009 30
Connect. Collaborate. Innovate.
Example
 Suppose that we write and
execute two test cases
 Case 1: 1-2-exit
 Case 2: 1-2-3-4-5-7-8-2-3-4-5-7-8-2-exit
11
22
33
44
55 66
77
88
© Copyright GlobalLogic 2009 31
Connect. Collaborate. Innovate.
White Box -Condition Coverage
 Test cases are designed such that:
• each component of a composite conditional expression given both true
and false values.
 Example
• Consider the conditional expression ((c1and c2) or c3):
• Each of c1, c2, and c3 are exercised at least once i.e. given true and
false values.
Number of Condition outcome exercised
Condition coverage = ---------------------------------------------------------- x 100%
Total number of Condition outcome
© Copyright GlobalLogic 2009 32
Connect. Collaborate. Innovate.
Branch testing Vs Condition testing
 Condition testing
• stronger testing than branch testing:
 Branch testing
• stronger than statement coverage testing.
© Copyright GlobalLogic 2009 34
Connect. Collaborate. Innovate.
Experienced Based
 Error Guessing
• The success of error guessing is very much dependent on the skill of
the tester
 Exploratory Testing
• Is a hands-on approach in which testers are involved in minimum
planning and maximum test execution.
© Copyright GlobalLogic 2009 35
Connect. Collaborate. Innovate.
Choosing a Testing Technique
 The internal factors
• Tester Knowledge /Experience
• Likely Defects
• Test Objective
• Documentation
• Life Cycle Model
 External Factor
• Risk
• Customer /contractual Requirement
• Time and budget
© Copyright GlobalLogic 2009 36
Connect. Collaborate. Innovate.
Any Questions
© Copyright GlobalLogic 2009 38
Connect. Collaborate. Innovate.
“Thank You” for your learning contribution!
Please submit Online Feedback to help L&D make continuous
improvement……participation credit will be given only on
feedback submission.
For any queries Dial @ Learning:
Noida: 4444, Nagpur:333, Pune:5222, Banglore:111
E mail: learning@globallogic.com
Check new L&D Reward & Recognition Policy
@ Confluence under Global Training
Check new L&D Reward & Recognition Policy
@ Confluence under Global Training

More Related Content

What's hot

Test design techniques: Structured and Experienced-based techniques
Test design techniques: Structured and Experienced-based techniquesTest design techniques: Structured and Experienced-based techniques
Test design techniques: Structured and Experienced-based techniquesKhuong Nguyen
 
An Overview of User Acceptance Testing (UAT)
An Overview of User Acceptance Testing (UAT)An Overview of User Acceptance Testing (UAT)
An Overview of User Acceptance Testing (UAT)Usersnap
 
Software testing.ppt
Software testing.pptSoftware testing.ppt
Software testing.pptKomal Garg
 
Sldie TÌM HIỂU CÁC KỸ THUẬT KIỂM THỬ PHẦN MỀM
Sldie TÌM HIỂU CÁC KỸ THUẬT KIỂM THỬ PHẦN MỀMSldie TÌM HIỂU CÁC KỸ THUẬT KIỂM THỬ PHẦN MỀM
Sldie TÌM HIỂU CÁC KỸ THUẬT KIỂM THỬ PHẦN MỀMNguyễn Anh
 
Presentation On Software Testing Bug Life Cycle
Presentation On Software Testing Bug Life CyclePresentation On Software Testing Bug Life Cycle
Presentation On Software Testing Bug Life CycleRajon
 
Test Case Design
Test Case DesignTest Case Design
Test Case Designacatalin
 
Regression and performance testing
Regression and performance testingRegression and performance testing
Regression and performance testingHimanshu
 
So you think you can write a test case
So you think you can write a test caseSo you think you can write a test case
So you think you can write a test caseSrilu Balla
 
Software Testing - Boundary Value Analysis, Equivalent Class Partition, Decis...
Software Testing - Boundary Value Analysis, Equivalent Class Partition, Decis...Software Testing - Boundary Value Analysis, Equivalent Class Partition, Decis...
Software Testing - Boundary Value Analysis, Equivalent Class Partition, Decis...priyasoundar
 
Defect life cycle and Defect Status Life Cycle
Defect life cycle and Defect Status Life CycleDefect life cycle and Defect Status Life Cycle
Defect life cycle and Defect Status Life Cyclepavansmiles
 
Test case techniques
Test case techniquesTest case techniques
Test case techniquesPina Parmar
 

What's hot (20)

Black Box Testing
Black Box TestingBlack Box Testing
Black Box Testing
 
Test Design with Action-based Testing Methodology - Ngo Hoang Minh
Test Design with Action-based Testing Methodology - Ngo Hoang MinhTest Design with Action-based Testing Methodology - Ngo Hoang Minh
Test Design with Action-based Testing Methodology - Ngo Hoang Minh
 
Test design techniques: Structured and Experienced-based techniques
Test design techniques: Structured and Experienced-based techniquesTest design techniques: Structured and Experienced-based techniques
Test design techniques: Structured and Experienced-based techniques
 
An Overview of User Acceptance Testing (UAT)
An Overview of User Acceptance Testing (UAT)An Overview of User Acceptance Testing (UAT)
An Overview of User Acceptance Testing (UAT)
 
Effective Software Test Case Design Approach
Effective Software Test Case Design ApproachEffective Software Test Case Design Approach
Effective Software Test Case Design Approach
 
Software testing.ppt
Software testing.pptSoftware testing.ppt
Software testing.ppt
 
Testing ppt
Testing pptTesting ppt
Testing ppt
 
Black box and white box testing
Black box and white box testingBlack box and white box testing
Black box and white box testing
 
Sldie TÌM HIỂU CÁC KỸ THUẬT KIỂM THỬ PHẦN MỀM
Sldie TÌM HIỂU CÁC KỸ THUẬT KIỂM THỬ PHẦN MỀMSldie TÌM HIỂU CÁC KỸ THUẬT KIỂM THỬ PHẦN MỀM
Sldie TÌM HIỂU CÁC KỸ THUẬT KIỂM THỬ PHẦN MỀM
 
Presentation On Software Testing Bug Life Cycle
Presentation On Software Testing Bug Life CyclePresentation On Software Testing Bug Life Cycle
Presentation On Software Testing Bug Life Cycle
 
Types of testing
Types of testingTypes of testing
Types of testing
 
Test Case Design
Test Case DesignTest Case Design
Test Case Design
 
Introduction to Agile Testing
Introduction to Agile TestingIntroduction to Agile Testing
Introduction to Agile Testing
 
Regression and performance testing
Regression and performance testingRegression and performance testing
Regression and performance testing
 
So you think you can write a test case
So you think you can write a test caseSo you think you can write a test case
So you think you can write a test case
 
Software Testing - Boundary Value Analysis, Equivalent Class Partition, Decis...
Software Testing - Boundary Value Analysis, Equivalent Class Partition, Decis...Software Testing - Boundary Value Analysis, Equivalent Class Partition, Decis...
Software Testing - Boundary Value Analysis, Equivalent Class Partition, Decis...
 
Testing techniques
Testing techniquesTesting techniques
Testing techniques
 
Defect life cycle and Defect Status Life Cycle
Defect life cycle and Defect Status Life CycleDefect life cycle and Defect Status Life Cycle
Defect life cycle and Defect Status Life Cycle
 
Test case techniques
Test case techniquesTest case techniques
Test case techniques
 
Test design
Test designTest design
Test design
 

Viewers also liked

States, state graphs and transition testing
States, state graphs and transition testingStates, state graphs and transition testing
States, state graphs and transition testinggeethawilliam
 
Test design techniques
Test design techniquesTest design techniques
Test design techniquesOksana
 
Test design techniques
Test design techniquesTest design techniques
Test design techniquesBipul Roy Bpl
 
Decision table
Decision tableDecision table
Decision tablejeebala
 
Software test management overview for managers
Software test management overview for managersSoftware test management overview for managers
Software test management overview for managersTJamesLeDoux
 
Writing Test Cases 20110808
Writing Test Cases 20110808Writing Test Cases 20110808
Writing Test Cases 20110808slovejoy
 
Design Test Case Technique (Equivalence partitioning And Boundary value analy...
Design Test Case Technique (Equivalence partitioning And Boundary value analy...Design Test Case Technique (Equivalence partitioning And Boundary value analy...
Design Test Case Technique (Equivalence partitioning And Boundary value analy...Ryan Tran
 

Viewers also liked (9)

States, state graphs and transition testing
States, state graphs and transition testingStates, state graphs and transition testing
States, state graphs and transition testing
 
Test design techniques
Test design techniquesTest design techniques
Test design techniques
 
Test design techniques
Test design techniquesTest design techniques
Test design techniques
 
Test design techniques
Test design techniquesTest design techniques
Test design techniques
 
Test design techniques
Test design techniquesTest design techniques
Test design techniques
 
Decision table
Decision tableDecision table
Decision table
 
Software test management overview for managers
Software test management overview for managersSoftware test management overview for managers
Software test management overview for managers
 
Writing Test Cases 20110808
Writing Test Cases 20110808Writing Test Cases 20110808
Writing Test Cases 20110808
 
Design Test Case Technique (Equivalence partitioning And Boundary value analy...
Design Test Case Technique (Equivalence partitioning And Boundary value analy...Design Test Case Technique (Equivalence partitioning And Boundary value analy...
Design Test Case Technique (Equivalence partitioning And Boundary value analy...
 

Similar to Test design techniques

Unit 2 Unit level testing.ppt
Unit 2 Unit level testing.pptUnit 2 Unit level testing.ppt
Unit 2 Unit level testing.pptPerfectMe2
 
LlosengCh10E2.ppt
LlosengCh10E2.pptLlosengCh10E2.ppt
LlosengCh10E2.pptSaba651353
 
Stephan berg track f
Stephan berg   track fStephan berg   track f
Stephan berg track fAlona Gradman
 
Software Engineering : Software testing
Software Engineering : Software testingSoftware Engineering : Software testing
Software Engineering : Software testingAjit Nayak
 
Fundamental Test Design Techniques
Fundamental Test Design TechniquesFundamental Test Design Techniques
Fundamental Test Design TechniquesTechWell
 
Design and development of automated tests for the IoT
Design and development of automated tests for the IoTDesign and development of automated tests for the IoT
Design and development of automated tests for the IoTAxel Rennoch
 
Dynamic Testing
Dynamic TestingDynamic Testing
Dynamic TestingJimi Patel
 
CS8494 SOFTWARE ENGINEERING Unit-4
CS8494 SOFTWARE ENGINEERING Unit-4CS8494 SOFTWARE ENGINEERING Unit-4
CS8494 SOFTWARE ENGINEERING Unit-4SIMONTHOMAS S
 
White-box Testing: When Quality Really Matters
White-box Testing: When Quality Really MattersWhite-box Testing: When Quality Really Matters
White-box Testing: When Quality Really MattersTechWell
 
Software Engineering (Testing techniques)
Software Engineering (Testing techniques)Software Engineering (Testing techniques)
Software Engineering (Testing techniques)ShudipPal
 
Software Engineering (Testing techniques)
Software Engineering (Testing techniques)Software Engineering (Testing techniques)
Software Engineering (Testing techniques)ShudipPal
 
Whitebox testing
Whitebox testingWhitebox testing
Whitebox testingOana Feidi
 
White boxvsblackbox
White boxvsblackboxWhite boxvsblackbox
White boxvsblackboxsanerjjd
 
Module5 Testing and Verification.pdf
Module5 Testing and Verification.pdfModule5 Testing and Verification.pdf
Module5 Testing and Verification.pdfBhavanaHN5
 
Effective Test Suites for ! Mixed Discrete-Continuous Stateflow Controllers
Effective Test Suites for ! Mixed Discrete-Continuous Stateflow ControllersEffective Test Suites for ! Mixed Discrete-Continuous Stateflow Controllers
Effective Test Suites for ! Mixed Discrete-Continuous Stateflow ControllersLionel Briand
 
addressing tim/quality trade-off in view maintenance
addressing tim/quality trade-off in view maintenanceaddressing tim/quality trade-off in view maintenance
addressing tim/quality trade-off in view maintenanceSoheila Dehghanzadeh
 
What are Software Testing Methodologies | Software Testing Techniques | Edureka
What are Software Testing Methodologies | Software Testing Techniques | EdurekaWhat are Software Testing Methodologies | Software Testing Techniques | Edureka
What are Software Testing Methodologies | Software Testing Techniques | EdurekaEdureka!
 

Similar to Test design techniques (20)

Unit 2 Unit level testing.ppt
Unit 2 Unit level testing.pptUnit 2 Unit level testing.ppt
Unit 2 Unit level testing.ppt
 
11 whiteboxtesting
11 whiteboxtesting11 whiteboxtesting
11 whiteboxtesting
 
LlosengCh10E2.ppt
LlosengCh10E2.pptLlosengCh10E2.ppt
LlosengCh10E2.ppt
 
Stephan berg track f
Stephan berg   track fStephan berg   track f
Stephan berg track f
 
st_unit_2.ppt
st_unit_2.pptst_unit_2.ppt
st_unit_2.ppt
 
Software Engineering : Software testing
Software Engineering : Software testingSoftware Engineering : Software testing
Software Engineering : Software testing
 
Fundamental Test Design Techniques
Fundamental Test Design TechniquesFundamental Test Design Techniques
Fundamental Test Design Techniques
 
Design and development of automated tests for the IoT
Design and development of automated tests for the IoTDesign and development of automated tests for the IoT
Design and development of automated tests for the IoT
 
Dynamic Testing
Dynamic TestingDynamic Testing
Dynamic Testing
 
CS8494 SOFTWARE ENGINEERING Unit-4
CS8494 SOFTWARE ENGINEERING Unit-4CS8494 SOFTWARE ENGINEERING Unit-4
CS8494 SOFTWARE ENGINEERING Unit-4
 
White-box Testing: When Quality Really Matters
White-box Testing: When Quality Really MattersWhite-box Testing: When Quality Really Matters
White-box Testing: When Quality Really Matters
 
Software Engineering (Testing techniques)
Software Engineering (Testing techniques)Software Engineering (Testing techniques)
Software Engineering (Testing techniques)
 
Software Engineering (Testing techniques)
Software Engineering (Testing techniques)Software Engineering (Testing techniques)
Software Engineering (Testing techniques)
 
Whitebox testing
Whitebox testingWhitebox testing
Whitebox testing
 
Coverage and Introduction to UVM
Coverage and Introduction to UVMCoverage and Introduction to UVM
Coverage and Introduction to UVM
 
White boxvsblackbox
White boxvsblackboxWhite boxvsblackbox
White boxvsblackbox
 
Module5 Testing and Verification.pdf
Module5 Testing and Verification.pdfModule5 Testing and Verification.pdf
Module5 Testing and Verification.pdf
 
Effective Test Suites for ! Mixed Discrete-Continuous Stateflow Controllers
Effective Test Suites for ! Mixed Discrete-Continuous Stateflow ControllersEffective Test Suites for ! Mixed Discrete-Continuous Stateflow Controllers
Effective Test Suites for ! Mixed Discrete-Continuous Stateflow Controllers
 
addressing tim/quality trade-off in view maintenance
addressing tim/quality trade-off in view maintenanceaddressing tim/quality trade-off in view maintenance
addressing tim/quality trade-off in view maintenance
 
What are Software Testing Methodologies | Software Testing Techniques | Edureka
What are Software Testing Methodologies | Software Testing Techniques | EdurekaWhat are Software Testing Methodologies | Software Testing Techniques | Edureka
What are Software Testing Methodologies | Software Testing Techniques | Edureka
 

More from Pragya Rastogi

More from Pragya Rastogi (7)

Testing tool classification
Testing tool classificationTesting tool classification
Testing tool classification
 
Test management
Test managementTest management
Test management
 
Network Testing ques
Network Testing quesNetwork Testing ques
Network Testing ques
 
Vb script reference
Vb script referenceVb script reference
Vb script reference
 
Vb script
Vb scriptVb script
Vb script
 
Qtp 11 notes
Qtp 11 notesQtp 11 notes
Qtp 11 notes
 
Qtp tutorial
Qtp tutorialQtp tutorial
Qtp tutorial
 

Test design techniques

  • 1. © Copyright GlobalLogic 2009 1 Connect. Collaborate. Innovate. ISTQB Test design Techniques Akshi Chawla 20th June 2011 Internal
  • 2. © Copyright GlobalLogic 2009 2 Connect. Collaborate. Innovate. Switch off your Mobile phone Or Put the Mobile phone on silent mode
  • 3. © Copyright GlobalLogic 2009 3 Connect. Collaborate. Innovate. Agenda  Test design Techniques  Static Testing  Black Box Testing  White Box testing  Experience Based Testing  Choosing a Testing Technique  Q & A
  • 4. © Copyright GlobalLogic 2009 4 Connect. Collaborate. Innovate. Test Design Techniques Static Dynamic Structural based Informal ReviewInformal Review Technical ReviewTechnical Review WalkthroughWalkthrough Static AnalysisStatic Analysis InspectionInspection Experienced Based Data FlowData Flow Control FlowControl Flow Multiple ConditionMultiple Condition ConditionCondition ExploratoryExploratory Error GuessingError Guessing DecisionDecision StatementStatement State TransitionState Transition Decision tableDecision table BVABVA EQP Specification basedSpecification based Use CaseUse Case
  • 5. © Copyright GlobalLogic 2009 5 Connect. Collaborate. Innovate. Static Testing  Non Execution Technique  Used to Review Documents  Review Process • Informal Review • Formal Review • Walkthrough • Technical Review • Inspection
  • 6. © Copyright GlobalLogic 2009 6 Connect. Collaborate. Innovate.  Roles and Responsibilities 1. Moderator 2. Author 3. Scribe 4. Reviewers 5. Manager  Phases of Formal Review 1. Planning 2. Kick Off 3. Preparation 4. Review Meetings 5. Rework 6. Follow up Static Testing
  • 7. © Copyright GlobalLogic 2009 7 Connect. Collaborate. Innovate. Static Analysis: Cyclomatic Complexity  Developed by Thomas J. McCabe  Provide a quantitative measure of logical complexity of program  Cyclomatic complexity is computed using the control flow graph of the program
  • 8. © Copyright GlobalLogic 2009 8 Connect. Collaborate. Innovate. Control flow graph (CFG)  It is the way control flows through the program  Three kinds of nodes: Statement nodes: single-entry-single-exit sequences of statements Predicate (decision) nodes: conditions for branching  Auxiliary nodes: (optional) for easier understanding (e.g. “merge points” for IF)  Edges: possible flow of control
  • 9. © Copyright GlobalLogic 2009 9 Connect. Collaborate. Innovate. How to Draw CFG int f1(int x,int y){ 1. while (x != y){ 2. if (x>y) then 3. x=x-y; 4. else y=y-x; 5. } 6. return x; }
  • 10. © Copyright GlobalLogic 2009 10 Connect. Collaborate. Innovate. Cyclomatic complexity Definition  Cyclomatic Complexity V(G) for a graph (G) • V(G) = E-N+2 E = Edges N=Nodes • V(G)= P+1 P= Predicate node. • V(G) = Total number of bounded areas + 1 Any region enclosed by a nodes and edge sequence.
  • 11. © Copyright GlobalLogic 2009 11 Connect. Collaborate. Innovate. Example The Flow Graph has 3 regions V(G) = 2 predicate nodes +1= 3 V(G) = 7edges- 6 nodes +2 = 3 V(G) = 2 bounded area +1 = 3 11 22 33 44 55 66
  • 12. © Copyright GlobalLogic 2009 13 Connect. Collaborate. Innovate. Derivation of Test Cases  Number of independent paths: 3 • 1, 6 test case (x=1, y=1) • 1, 2, 3, 5, 1, 6 test case(x=1, y=2) • 1, 2, 4, 5, 1, 6 test case(x=2, y=1)
  • 13. © Copyright GlobalLogic 2009 15 Connect. Collaborate. Innovate. Black box testing Focuses on Functional and Non Functional requirement requirements outputs events inputs
  • 14. © Copyright GlobalLogic 2009 16 Connect. Collaborate. Innovate. Black Box Testing Types  Equivalence class partitioning  Boundary value analysis  Decision table testing  State Transition
  • 15. © Copyright GlobalLogic 2009 17 Connect. Collaborate. Innovate. Black Box - Equivalence Class Partitioning  Input values to a program are partitioned into equivalence classes.  Why we do Partitioning?
  • 16. © Copyright GlobalLogic 2009 18 Connect. Collaborate. Innovate. Example  A program reads an input value in the range of 1 and 5000: • computes the square root of the input number SQRTSQRT  There are three equivalence classes: • the set of negative integers, • set of integers in the range of 1 and 5000, • integers larger than 5000.
  • 17. © Copyright GlobalLogic 2009 19 Connect. Collaborate. Innovate. Example (cont.)  The test suite must include: • representatives from each of the three equivalence classes: • a possible test suite can be: {-5,500,6000}. 11 50005000
  • 18. © Copyright GlobalLogic 2009 20 Connect. Collaborate. Innovate. Black Box - Boundary Value Analysis  Some typical programming errors occur: • at boundaries of equivalence classes  Programmers often fail to see: • special processing required at the boundaries of equivalence classes.  Compute square root of an integer in the range of 1 and 5000: • test cases : {0,1,5000,5001}. 11 50005000
  • 19. © Copyright GlobalLogic 2009 21 Connect. Collaborate. Innovate. Black Box - Decision Table  A decision table is a good way to deal with combinations of things (e.g. inputs).  Known as ‘Cause-Effect' table.  Testing all combinations may be impractical if not impossible  How to Use Decision Table • Identify the conditions • Identify combination of true or false. Rules = 2n (where n is number of conditions ) • Identify correct outcome for each combination • Write Test Cases based for each rule No ISTQB Exam fee is reimbursed to the employee until he attends the training course. After attending the training, reimburse 50% for Band0 employee or 80% for Band 1 employee
  • 20. © Copyright GlobalLogic 2009 22 Connect. Collaborate. Innovate. Black Box - State Transition  It focuses on how state transition from one stage to next depending on events  In this technique state of system is first recognized and then test cases are written to test the transition from one state to another
  • 21. © Copyright GlobalLogic 2009 23 Connect. Collaborate. Innovate. Black Box - State Transition  A website shopping basket start out as empty. As purchases are selected they are added to shopping basket. Items can also be removed from shopping basket. When the customer decides to check out , a summary of items in the basket and total cost are shown , for customer to say whether this is Ok or not. If the content and prices are Ok, then you leave summary display and go to payment system . Otherwise you go back to shopping ( so you can remove items if you want)
  • 22. © Copyright GlobalLogic 2009 24 Connect. Collaborate. Innovate. Black Box – N-Switch Testing  0-switch coverage • Coverage of all individual transitions  l-switch coverage • Coverage of transition pairs  2-switch coverage • Coverage of transition triples is, etc.
  • 23. © Copyright GlobalLogic 2009 25 Connect. Collaborate. Innovate. White Box Testing  Focuses on Internal Knowledge • Exercise all independent paths • exercise all logical decisions • execute all loops
  • 24. © Copyright GlobalLogic 2009 26 Connect. Collaborate. Innovate. White Box Testing Types  Statement coverage  Branch coverage  Path coverage  Condition coverage
  • 25. © Copyright GlobalLogic 2009 27 Connect. Collaborate. Innovate. White Box - Statement Coverage  Methodology: • Every statement is executed at least once.  The principal idea: • unless a statement is executed, we have no way of knowing if an error exists in that statement Number of Statement Exercised Statement coverage = --------------------------------------------- x 100% Total number of statements
  • 26. © Copyright GlobalLogic 2009 28 Connect. Collaborate. Innovate. Example 1 READ A 2 READ B 3 C =A + 2*B 4 IF C> 50 THEN 5 PRINT large C 6 ENDIF 11 22 33 44 55 66
  • 27. © Copyright GlobalLogic 2009 29 Connect. Collaborate. Innovate. White Box - Branch Coverage  Test cases are designed such that: • different branch conditions is given true and false values in turn.  Branch testing guarantees statement coverage
  • 28. © Copyright GlobalLogic 2009 30 Connect. Collaborate. Innovate. Example  Suppose that we write and execute two test cases  Case 1: 1-2-exit  Case 2: 1-2-3-4-5-7-8-2-3-4-5-7-8-2-exit 11 22 33 44 55 66 77 88
  • 29. © Copyright GlobalLogic 2009 31 Connect. Collaborate. Innovate. White Box -Condition Coverage  Test cases are designed such that: • each component of a composite conditional expression given both true and false values.  Example • Consider the conditional expression ((c1and c2) or c3): • Each of c1, c2, and c3 are exercised at least once i.e. given true and false values. Number of Condition outcome exercised Condition coverage = ---------------------------------------------------------- x 100% Total number of Condition outcome
  • 30. © Copyright GlobalLogic 2009 32 Connect. Collaborate. Innovate. Branch testing Vs Condition testing  Condition testing • stronger testing than branch testing:  Branch testing • stronger than statement coverage testing.
  • 31. © Copyright GlobalLogic 2009 34 Connect. Collaborate. Innovate. Experienced Based  Error Guessing • The success of error guessing is very much dependent on the skill of the tester  Exploratory Testing • Is a hands-on approach in which testers are involved in minimum planning and maximum test execution.
  • 32. © Copyright GlobalLogic 2009 35 Connect. Collaborate. Innovate. Choosing a Testing Technique  The internal factors • Tester Knowledge /Experience • Likely Defects • Test Objective • Documentation • Life Cycle Model  External Factor • Risk • Customer /contractual Requirement • Time and budget
  • 33. © Copyright GlobalLogic 2009 36 Connect. Collaborate. Innovate. Any Questions
  • 34. © Copyright GlobalLogic 2009 38 Connect. Collaborate. Innovate. “Thank You” for your learning contribution! Please submit Online Feedback to help L&D make continuous improvement……participation credit will be given only on feedback submission. For any queries Dial @ Learning: Noida: 4444, Nagpur:333, Pune:5222, Banglore:111 E mail: learning@globallogic.com Check new L&D Reward & Recognition Policy @ Confluence under Global Training Check new L&D Reward & Recognition Policy @ Confluence under Global Training

Editor's Notes

  1. Equivalence partitioning is a black-box testing method that divides the input domain of a program into classes of data from which test cases can be derived. An ideal test case single-handedly uncovers a class of errors (e.g., incorrect processing of all character data) that might otherwise require many cases to be executed before the general error is observed. Equivalence partitioning strives to define a test case that uncovers classes of errors, thereby reducing the total number of test cases that must be developed. An equivalence class represents a set of valid or invalid states for input conditions. Typically, an input condition is either a specific numeric value, a range of values, a set of related values, or a Boolean condition. Equivalence partitioning is a software testing technique that divides the input data of a software unit into partition of data from which test cases can be derived. In principle, test cases are designed to cover each partition at least once. Partitioning is done such that: program behaves in similar ways to every input value belonging to an equivalence class.
  2. flow graph node, represents one or more procedural statements. The arrows on the flow graph, called edges or links
  3. How to draw control flow graph Number all the statements of a program. Numbered statements: represent nodes of the control flow graph. An edge from one node to another node exists: if execution of the statement representing the first node can result in transfer of control to the other node.
  4. Selects test paths of a program: according to the locations of definitions and uses of different variables in a program. Variation of the control flow graph A node represents a single statement, not a single-entry-single-exit chain of statements
  5. Black-box testing, also called behavioral testing, focuses on the functional requirements of the software. That is, black-box testing enables the software engineer to derive sets of input conditions that will fully exercise all functional requirements for a program. Black-box testing is not an alternative to white-box techniques. Rather, it is a complementary approach that is likely to uncover a different class of errors than white-box methods. Black-box testing attempts to find errors in the following categories: (1) incorrect or missing functions, (2) interface errors, (3) errors in data structures or external data base access, (4) behavior or performance errors, and (5) initialization and termination errors. Black Box Testing is not a type of testing; it instead is a testing strategy, which does not need any knowledge of internal design or code etc. As the name "black box" suggests, no knowledge of internal logic or code structure is required. The types of testing under this strategy are totally based/focused on the testing for requirements and functionality of the work product/software application. Black box testing is sometimes also called as "Opaque Testing", "Functional/Behavioral Testing" and "Closed Box Testing". Checks Actual results are according top specified behaviour or not.
  6. The equivalence partitions are usually derived from the requirements specification for input attributes that influence the processing of the test object. An input has certain ranges which are valid and other ranges which are invalid. Invalid data here does not mean that the data is incorrect, it means that this data lies outside of specific partition.
  7. greater number of errors tends to occur at the boundaries of the input domain rather than in the "center." It is for this reason that boundary value analysis (BVA) has been developed as a testing technique Experience has shown that the boundaries of input and output ranges of a software component are common locations for errors that result in software faults. Boundary value analysis assists with the design of test cases that will exercise these boundaries in an attempt to uncover faults in the software during the testing process. Programmers may improperly use < instead of <= Boundary value analysis: select test cases at the boundaries of different equivalence classes.
  8. greater number of errors tends to occur at the boundaries of the input domain rather than in the "center." It is for this reason that boundary value analysis (BVA) has been developed as a testing technique Experience has shown that the boundaries of input and output ranges of a software component are common locations for errors that result in software faults. Boundary value analysis assists with the design of test cases that will exercise these boundaries in an attempt to uncover faults in the software during the testing process. Programmers may improperly use < instead of <= Boundary value analysis: select test cases at the boundaries of different equivalence classes.
  9. greater number of errors tends to occur at the boundaries of the input domain rather than in the "center." It is for this reason that boundary value analysis (BVA) has been developed as a testing technique Experience has shown that the boundaries of input and output ranges of a software component are common locations for errors that result in software faults. Boundary value analysis assists with the design of test cases that will exercise these boundaries in an attempt to uncover faults in the software during the testing process. Programmers may improperly use < instead of <= Boundary value analysis: select test cases at the boundaries of different equivalence classes.
  10. greater number of errors tends to occur at the boundaries of the input domain rather than in the "center." It is for this reason that boundary value analysis (BVA) has been developed as a testing technique Experience has shown that the boundaries of input and output ranges of a software component are common locations for errors that result in software faults. Boundary value analysis assists with the design of test cases that will exercise these boundaries in an attempt to uncover faults in the software during the testing process. Programmers may improperly use < instead of <= Boundary value analysis: select test cases at the boundaries of different equivalence classes.
  11. greater number of errors tends to occur at the boundaries of the input domain rather than in the "center." It is for this reason that boundary value analysis (BVA) has been developed as a testing technique Experience has shown that the boundaries of input and output ranges of a software component are common locations for errors that result in software faults. Boundary value analysis assists with the design of test cases that will exercise these boundaries in an attempt to uncover faults in the software during the testing process. Programmers may improperly use < instead of <= Boundary value analysis: select test cases at the boundaries of different equivalence classes.
  12. This testing is based on knowledge of the internal logic of an application’s code. Also known as Glass box Testing. Internal software and code working should be known for this type of testing. Tests are based on coverage of code statements, branches, paths, conditions. Using white-box testing methods, the software engineer can derive test cases that (1) guarantee that all independent paths within a module have been exercised at least once, (2) exercise all logical decisions on their true and false sides, (3) execute all loops at their boundaries and within their operational bounds, and (4) exercise internal data structures to ensure their validity.
  13. White-box testing, sometimes called glass-box testing, is a test case design method that uses the control structure of the procedural design to derive test cases. Using A reasonable question might be posed at this juncture: "Why spend time and energy worrying about (and testing) logical minutiae when we might better expend effort White box testing (a.k.a. clear box testing, glass box testing, transparent box testing, translucent box testing or structural testing) uses an internal perspective of the system to design test cases based on internal structure. It requires programming skills to identify all paths through the software. While white box testing is applicable at the unit, integration and system levels of the software testing process, it is typically applied to the unit. it might not detect unimplemented parts of the specification or missing requirements, but one can be sure that all paths through the test object are executed.
  14. Statement coverage methodology: design test cases so that every statement in a program is executed at least once. The principal idea: unless a statement is executed, we have no way of knowing if an error exists in that statement
  15. Suppose that we write and execute two test cases Test case #1: follows path 1-2-exit Test case #2: 1-2-3-4-5-7-8-2-3-4-5-7-8-2-exit (loop twice, and both times take the true branch) Problem: node 6 is never executed,so we don’t have 100% statement coverage
  16. ranch coverage (sometimes called Decision Coverage) measures which possible branches in flow control structures are followed Branch testing guarantees statement coverage: a stronger testing compared to the statement coverage-based testing. A branch is the outcome of a decision, so branch coverage simply measures which decision outcomes have been tested. This sounds great because it takes a more in-depth view of the source code than simple statement coverage, but branch coverage can also leave you wanting more. Determining the number of branches in a method is easy. Boolean decisions obviously have two outcomes, true and false, whereas switches have one outcome for each case—and don't forget the default case! The total number of decision outcomes in a method is therefore equal to the number of branches that need to be covered plus the entry branch in the method (after all, even methods with straight line code have one branch). In the example above, returnInput() has seven branches—three true, three false, and one invisible branch for the method entry. You can cover the six true and false branches with two test cases:
  17. Suppose that we write and execute two test cases Test case #1: follows path 1-2-exit Test case #2: 1-2-3-4-5-7-8-2-3-4-5-7-8-2-exit (loop twice, and both times take the true branch) Problem: node 6 is never executed,so we don’t have 100% statement coverage
  18. Condition testing is a test case design method that exercises the logical conditions contained in a program module. A simple condition is a Boolean variable or a relational expression, possibly preceded with one NOT (¬) operator.
  19. A path is a unique sequence of branches from the function entry to the exit.Path coverage has the advantage of requiring very thorough testing. Path coverage has two severe disadvantages. The first is that the number of paths is exponential to the number of branches. For example a function containing 10 if-statements has 1024 paths to test. Adding just one more if-statement doubles the count to 2048. The second disadvantage is that many paths are impossible to exercise due to relationships of data. For example consider the following C/C++ code fragment:if (success) statement1;statement2;if (success) statement3;Path coverage considers this fragment to contain 4 paths. In fact only two are feasible: success false and success true. A path represents the flow of execution from the start of a method to its exit. A method with N decisions has 2^N possible paths, and if the method contains a loop, it may have an infinite number of paths. Fortunately, you can use a metric called cyclomatic complexity to reduce the number of paths you need to test. The cyclomatic complexity of a method is one plus the number of unique decisions in the method. Cyclomatic complexity helps you define the number of linearly independent paths, called the basis set, through a method. The definition of linear independence is beyond the scope of this article, but, in summary, the basis set is the smallest set of paths that can be combined to create every other possible path through a method. Like branch coverage, testing the basis set of paths ensures that you test every decision outcome, but, unlike branch coverage, basis path coverage ensures that you test all decision outcomes independently of one another. In other words, each new basis path "flips" exactly one previously executed decision, leaving all other executed branches unchanged. This is the crucial factor that makes basis path coverage more robust than branch coverage, and allows you to see how changing that one decision affects the method's behavior.
  20. A path is a unique sequence of branches from the function entry to the exit.Path coverage has the advantage of requiring very thorough testing. Path coverage has two severe disadvantages. The first is that the number of paths is exponential to the number of branches. For example a function containing 10 if-statements has 1024 paths to test. Adding just one more if-statement doubles the count to 2048. The second disadvantage is that many paths are impossible to exercise due to relationships of data. For example consider the following C/C++ code fragment:if (success) statement1;statement2;if (success) statement3;Path coverage considers this fragment to contain 4 paths. In fact only two are feasible: success false and success true. A path represents the flow of execution from the start of a method to its exit. A method with N decisions has 2^N possible paths, and if the method contains a loop, it may have an infinite number of paths. Fortunately, you can use a metric called cyclomatic complexity to reduce the number of paths you need to test. The cyclomatic complexity of a method is one plus the number of unique decisions in the method. Cyclomatic complexity helps you define the number of linearly independent paths, called the basis set, through a method. The definition of linear independence is beyond the scope of this article, but, in summary, the basis set is the smallest set of paths that can be combined to create every other possible path through a method. Like branch coverage, testing the basis set of paths ensures that you test every decision outcome, but, unlike branch coverage, basis path coverage ensures that you test all decision outcomes independently of one another. In other words, each new basis path "flips" exactly one previously executed decision, leaving all other executed branches unchanged. This is the crucial factor that makes basis path coverage more robust than branch coverage, and allows you to see how changing that one decision affects the method's behavior.
  21. A path is a unique sequence of branches from the function entry to the exit.Path coverage has the advantage of requiring very thorough testing. Path coverage has two severe disadvantages. The first is that the number of paths is exponential to the number of branches. For example a function containing 10 if-statements has 1024 paths to test. Adding just one more if-statement doubles the count to 2048. The second disadvantage is that many paths are impossible to exercise due to relationships of data. For example consider the following C/C++ code fragment:if (success) statement1;statement2;if (success) statement3;Path coverage considers this fragment to contain 4 paths. In fact only two are feasible: success false and success true. A path represents the flow of execution from the start of a method to its exit. A method with N decisions has 2^N possible paths, and if the method contains a loop, it may have an infinite number of paths. Fortunately, you can use a metric called cyclomatic complexity to reduce the number of paths you need to test. The cyclomatic complexity of a method is one plus the number of unique decisions in the method. Cyclomatic complexity helps you define the number of linearly independent paths, called the basis set, through a method. The definition of linear independence is beyond the scope of this article, but, in summary, the basis set is the smallest set of paths that can be combined to create every other possible path through a method. Like branch coverage, testing the basis set of paths ensures that you test every decision outcome, but, unlike branch coverage, basis path coverage ensures that you test all decision outcomes independently of one another. In other words, each new basis path "flips" exactly one previously executed decision, leaving all other executed branches unchanged. This is the crucial factor that makes basis path coverage more robust than branch coverage, and allows you to see how changing that one decision affects the method's behavior.
  22. greater number of errors tends to occur at the boundaries of the input domain rather than in the "center." It is for this reason that boundary value analysis (BVA) has been developed as a testing technique Experience has shown that the boundaries of input and output ranges of a software component are common locations for errors that result in software faults. Boundary value analysis assists with the design of test cases that will exercise these boundaries in an attempt to uncover faults in the software during the testing process. Programmers may improperly use < instead of <= Boundary value analysis: select test cases at the boundaries of different equivalence classes.