SlideShare a Scribd company logo
1 of 55
Test Design techniques: Structured and Experienced-based techniques Author: Khuong Nguyen
Structured based testing techniques Cyclomatic complexity Experienced based testing techniques Choosing appropriate testing techniques Sample exam Agenda
Understand and apply common Structured-Based Testing techniques Know how to calculate Cyclomatic Complexity Understand Experienced-Based Testing techniques Learn to choose appropriate testing techniques in specific circumstances Objectives
Software testing foundations Certified Tester Foundation Level Syllabus 2007 Software Testing Dictionary BS7925-2: Component Testing References
Structure-based techniques
Structure-based testing/white-box testing is based on an identified structure of the software or system It is a method for writing a set of white-box test cases that exercise the paths in the code  How to measure thoroughly the test cases exercise the code Introduction
Test coverage measures in some specific way the amount of testing performed by a set of tests. Wherever we can count things and can tell whether or not each of those things has been tested by some test, then we can measure coverage What is test coverage?
Statement testing and coverage Decision testing and coverage  Other structure-based techniques Basic white box test case design techniques
In component testing, statement coverage is the assessment of the percentage of executable statements that have been exercised by a test case suite. (TRUE OR FALSE) Statement testing derives test cases to execute specific statements, normally to increase statement coverage. Every statement is requested to be executed at least one  Definition of statement coverage
Translate the source code to control flow graph Defines nodes(Statement) and control flow between statements(edges) Conditional statements(IF, CASE) and loops(WHILE, FOR) have more than one edges going out Verify that each statement have been executed Steps
Examples IF 1 IF 2 WHILE 3 4 6 ENDIF 7 ENDIF 1  If (a>0) then  2       If (b<1) then 3           While (c<2)  4               c++; 5            End while End IF 7  End IF 5 Node, statement Edge, Control flow
Statement coverage IF 1 IF 2 WHILE 3 4 6 ENDIF 7 ENDIF 100%SC: All nodes can be reached by  a single test case 1, 2, 3, 4, 5, 6, 7 5
It is a very weak criterion Value of the technique: Unreachable source code (dead code) can be detected Empty ELSE-parts are not considered Statement Coverage Coverage is measured by using test tools
What is minimum number of test cases required for full statement coverage? 1 test for statement coverage 2 tests for statement coverage 3 tests for statement coverage Read P Read Q IF P+Q > 100 THEN 	Print “Large” ENDIF If P > 50 THEN 	Print “P Large” ENDIF Exercise
Decision coverage, related to branch coverage, is the assessment of the percentage of decision outcomes (TRUE and FALSE) Require every decision outcome: all possible cases-statement Decision testing is a form of control flow testing as it generates a specific flow of control through the decision points Definition of decision/branch coverage
Translate the source code to control flow graph Defines nodes(Statement) and control flow between statements(edges) Conditional statements(IF, CASE) and loops(WHILE, FOR) have more than one edges going out Verify that all possible branches of the control flow are tested Steps
It is a stronger criterion than statement coverage Be able to detect missing statement in empty branches Decision coverage is stronger than statement coverage: 100% decision coverage guarantees 100% statement coverage, but not vice versa. Decision coverage requires test of every decision outcome:  both THEN and ELSE in the IF-statement  all possibilities for the CASE-statement and fall-through case  both execution of the FOR loop and the bypass Decision/branch Coverage
Examples IF 1 IF 2 WHILE 3 4 6 ENDIF 7 ENDIF 1  If (a>0) then  2       If (b<1) then 3           While (c<2)  4               c++; 5           End while 6       End IF 7   End IF 5 Node, statement Edge, Control flow
Decision coverage IF 1 IF 2 WHILE 3 4 6 ENDIF 7 ENDIF 100%DC: All branches are executed Some edges are executed more than one 5 1, 2, 3, 5, 3, 4, 5, 6, 7 1, 2, 6, 7 1, 7 ,[object Object],[object Object]
For object-oriented system, statement as well as decision coverage is inadequate. ,[object Object], Tools often support determining coverage, coverage data can be used to detect uncalled methods or program parts Limitations of the techniques
Data flow Testing Branch Condition Testing Branch Condition Combination Testing Modified Condition Decision Testing LCSAJ Testing Other structure-based test techniques
There are stronger levels of structural coverage beyond decision coverage (condition coverage and multiple condition coverage) The concept of coverage can also be applied at other test levels (e.g. at integration level) where the percentage of modules, components or classes that have been exercised by a test case suite could be expressed as module, component or class coverage Tool support is useful for the structural testing of code The basis of white box techniques is the source code. Adequate test case design techniques chosen depending on the complexity of the program structure Other structure-based test techniques (cont.)
Testing contains the combination of different techniques The expected risk guides to select testing techniques and the intensity of execution Basis of the selection of the white box technique is the structure of the test object Which techniques should be chosen?
Cyclomatic Complexity
Cyclomatic complexity or conditional complexity: Was developed by McCabe  Is the software metric (measurement) to measure the complexity of the program’s source code Definition
M = E − N + 2P  M = cyclomatic complexity E = the number of edges (links) of the graph N = the number of nodes of the graph P = the number of connected components Number of predicates + 1 How to calculate
Examples of cyclomatic complexity E=1, N=2, P=1 M=1-2+2=1 E=4, N=4, P=1 M=4-4+2=2 E=2, N=4, P=2 M=2-4+4=2 E=4, N=5, P=1 M=4-5+2=1
Cyclomatic complexity of programming constructs 1 1 if E then 2    A    else    B 4 C 2 3 4 E = 4, N = 4, P =1  M = 2
C
C
Predicate notes P = ? Complexity C = ?
Predicate notes P = ? Complexity C = ?
Predicate notes P = ? Complexity C = ?
Complex systems are hard to understand hard to change hard to reuse McCabe found that modules with a cyclomatic complexity greater than 10 were hard to test and error prone. Look for procedures with high cyclomatic complexity and rewrite them, focus testing on them, or focus reviewing on them. Metrics view
Experience-based techniques
Experienced-based test design technique: Procedure to derive and/or select test cases based on the tester’s experience, knowledge and intuition The techniques can be useful in identifying special tests not easily captured by formal techniques, especially when applied after more formal approaches Definition
Tester select test cases to uncover expected problems based on the skills, experienced and knowledge of the tester The term of error guessing is used very often in practice A commonly used experienced-based technique is error guessing Introduction
Exploratory testing Error guessing Basic experience-based test techniques
Error guessing is a test design technique where the experience of the tester is used to anticipate what defect might be present in the system under test. Testers design tests specifically to expose errors Error Guessing - Definition
Error guessing is a technique that should be used as a  complement to other formal techniques Testers anticipate defects based on their experience, skills Knowledge in developing similar applications and using similar technologies are also used when designing test cases. “Guess” where errors happened based on intuition and experience of tester. Error guessing
These defect and failure lists can be built based on experience, available defect and failure data, and from common knowledge about why software fails. Error guessing
Exploratory testing is test design technique where the tester actively controls the design of the test as those tests are performed and uses information gained while testing to design new and better test Exploratory testing is exploring, finding out about the software: What it does What it doesn’t do What works What doesn’t work Definition of Exploratory testing
Exploratory testing is a hands-on approach in which testers are involved in minimum planning and maximum test execution Activities in exploratory testing is concurrent: Test planning  Test design Test execution Test logging Learning Main features of exploratory testing
Result of one test case influence the design and execution of further test cases During testing, a “mental” model of program under test is created. It contains: How the program works How it behaves  How it should behave Focus on finding further aspect/behavior of the program. Main features of exploratory testing
Planning: involve the creation of the test charter that includes: Test charter Short declaration of scope Time-boxed of effort Objectives and possible approaches to be used Test design and test execution are performed parallel: Do not have formal documents: test conditions, test cases, test scripts… Some notes written during exploratory testing session Test logging is undertaken as test execution is performed. The key aspect of exploratory testing is learning about the software, its strengths and weaknesses How to implement
Approach Execute few test cases Analyze results Consider “special” to next test cases Knowledge about the test object under test is collected
Possible elements of the test object are “explored” to decide which parts will be tested Result of Exploratory testing helps to determine which test techniques can be applied if there is time left The test of “test charter” should not take more than one or two hours of uninterrupted test time Benefit
The technique is applicable when: There no poor specification The time is severely restricted because it uses much less time than other techniques It can serves to complement formal testing It can serve to check on the test process, to help ensure that the most serious defects are found. When we use exploratory testing
Why? With which goal is the test run? What is to be tested? How? Which testing method should be used? Which problems should be found? Common questions for executing test charter
Choosing test techniques
What are the pros and cons of: Specification-based testing techniques Structure-based testing techniques Experience-based testing techniques What is the best practice? When to use what?
The choice of which test techniques to use depends on a number of factors: the type of system regulatory standards customer or contractual requirements level of risk, type of risk test objective, documentation available knowledge of the testers time and budget development life cycle, use case models previous experience of types of defects found.  Which techniques should be chosen?
Testing contains the combination of different techniques The critically and the expected risk guide to select testing techniques and the intensity of execution Basis of the selection of the white box technique is the structure of the test object Which techniques should be chosen?
Thank You KhuongNguyen, Senior Quality Control Engineer Post graduate student, Australian Business School, Funds Management, UNSW, 2032, AustraliaEmail: khuong0602@gmail.com; op_khuong_nguyen@yahoo.com
Test design techniques: Structured and Experienced-based techniques

More Related Content

What's hot

Chapter 1 - Fundamentals of Testing
Chapter 1 - Fundamentals of TestingChapter 1 - Fundamentals of Testing
Chapter 1 - Fundamentals of TestingNeeraj Kumar Singh
 
Boundary value analysis
Boundary value analysisBoundary value analysis
Boundary value analysisVadym Muliavka
 
Basic software-testing-concepts
Basic software-testing-conceptsBasic software-testing-concepts
Basic software-testing-conceptsmedsherb
 
Software Testing Fundamentals
Software Testing FundamentalsSoftware Testing Fundamentals
Software Testing FundamentalsChankey Pathak
 
Types of Software Testing | Edureka
Types of Software Testing | EdurekaTypes of Software Testing | Edureka
Types of Software Testing | EdurekaEdureka!
 
Chapter 6 - Tool Support for Testing
Chapter 6 - Tool Support for TestingChapter 6 - Tool Support for Testing
Chapter 6 - Tool Support for TestingNeeraj Kumar Singh
 
Hardware/Software Integration Testing
Hardware/Software Integration TestingHardware/Software Integration Testing
Hardware/Software Integration TestingJohan Hoberg
 
Structural and functional testing
Structural and functional testingStructural and functional testing
Structural and functional testingHimanshu
 
Intro to Manual Testing
Intro to Manual TestingIntro to Manual Testing
Intro to Manual TestingAyah Soufan
 
Introduction to software testing
Introduction to software testingIntroduction to software testing
Introduction to software testingHadi Fadlallah
 
Software Testing - Part 1 (Techniques, Types, Levels, Methods, STLC, Bug Life...
Software Testing - Part 1 (Techniques, Types, Levels, Methods, STLC, Bug Life...Software Testing - Part 1 (Techniques, Types, Levels, Methods, STLC, Bug Life...
Software Testing - Part 1 (Techniques, Types, Levels, Methods, STLC, Bug Life...Ankit Prajapati
 
Software testing.ppt
Software testing.pptSoftware testing.ppt
Software testing.pptKomal Garg
 

What's hot (20)

Software testing
Software testingSoftware testing
Software testing
 
Chapter 1 - Fundamentals of Testing
Chapter 1 - Fundamentals of TestingChapter 1 - Fundamentals of Testing
Chapter 1 - Fundamentals of Testing
 
Boundary value analysis
Boundary value analysisBoundary value analysis
Boundary value analysis
 
Basic software-testing-concepts
Basic software-testing-conceptsBasic software-testing-concepts
Basic software-testing-concepts
 
Chapter 5 - Test Management
Chapter 5 - Test ManagementChapter 5 - Test Management
Chapter 5 - Test Management
 
Software Testing Fundamentals
Software Testing FundamentalsSoftware Testing Fundamentals
Software Testing Fundamentals
 
Testing
TestingTesting
Testing
 
Static Testing
Static TestingStatic Testing
Static Testing
 
Types of testing
Types of testingTypes of testing
Types of testing
 
Types of Software Testing | Edureka
Types of Software Testing | EdurekaTypes of Software Testing | Edureka
Types of Software Testing | Edureka
 
Chapter 6 - Tool Support for Testing
Chapter 6 - Tool Support for TestingChapter 6 - Tool Support for Testing
Chapter 6 - Tool Support for Testing
 
Hardware/Software Integration Testing
Hardware/Software Integration TestingHardware/Software Integration Testing
Hardware/Software Integration Testing
 
Structural and functional testing
Structural and functional testingStructural and functional testing
Structural and functional testing
 
Intro to Manual Testing
Intro to Manual TestingIntro to Manual Testing
Intro to Manual Testing
 
Introduction to software testing
Introduction to software testingIntroduction to software testing
Introduction to software testing
 
Software Testing
Software TestingSoftware Testing
Software Testing
 
Software Testing - Part 1 (Techniques, Types, Levels, Methods, STLC, Bug Life...
Software Testing - Part 1 (Techniques, Types, Levels, Methods, STLC, Bug Life...Software Testing - Part 1 (Techniques, Types, Levels, Methods, STLC, Bug Life...
Software Testing - Part 1 (Techniques, Types, Levels, Methods, STLC, Bug Life...
 
SOFTWARE TESTING
SOFTWARE TESTINGSOFTWARE TESTING
SOFTWARE TESTING
 
Software testing.ppt
Software testing.pptSoftware testing.ppt
Software testing.ppt
 
Types of testing
Types of testingTypes of testing
Types of testing
 

Viewers also liked

structured programming Introduction to c fundamentals
structured programming Introduction to c fundamentalsstructured programming Introduction to c fundamentals
structured programming Introduction to c fundamentalsOMWOMA JACKSON
 
Equivalence Class Testing [8] - Software Testing Techniques (CIS640)
Equivalence Class Testing [8] - Software Testing Techniques (CIS640)Equivalence Class Testing [8] - Software Testing Techniques (CIS640)
Equivalence Class Testing [8] - Software Testing Techniques (CIS640)Venkatesh Prasad Ranganath
 
Equivalence partitioning
Equivalence partitioningEquivalence partitioning
Equivalence partitioningSarjana Muda
 
4. The Software Development Process - Testing
4. The Software Development Process - Testing4. The Software Development Process - Testing
4. The Software Development Process - TestingForrester High School
 
1. The Software Development Process - Analysis
1. The Software Development Process - Analysis1. The Software Development Process - Analysis
1. The Software Development Process - AnalysisForrester High School
 
Reporting On The Testing Process
Reporting On The Testing ProcessReporting On The Testing Process
Reporting On The Testing Processgavhays
 
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
 
Organization theories
Organization theoriesOrganization theories
Organization theoriesSSBinny
 

Viewers also liked (11)

structured programming Introduction to c fundamentals
structured programming Introduction to c fundamentalsstructured programming Introduction to c fundamentals
structured programming Introduction to c fundamentals
 
Arrays in C
Arrays in CArrays in C
Arrays in C
 
Masters Guide to Container Securing
 Masters Guide to Container Securing Masters Guide to Container Securing
Masters Guide to Container Securing
 
Equivalence Class Testing [8] - Software Testing Techniques (CIS640)
Equivalence Class Testing [8] - Software Testing Techniques (CIS640)Equivalence Class Testing [8] - Software Testing Techniques (CIS640)
Equivalence Class Testing [8] - Software Testing Techniques (CIS640)
 
Equivalence partitioning
Equivalence partitioningEquivalence partitioning
Equivalence partitioning
 
4. The Software Development Process - Testing
4. The Software Development Process - Testing4. The Software Development Process - Testing
4. The Software Development Process - Testing
 
1. The Software Development Process - Analysis
1. The Software Development Process - Analysis1. The Software Development Process - Analysis
1. The Software Development Process - Analysis
 
Reporting On The Testing Process
Reporting On The Testing ProcessReporting On The Testing Process
Reporting On The Testing Process
 
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...
 
Organization theories
Organization theoriesOrganization theories
Organization theories
 
Warehousing
WarehousingWarehousing
Warehousing
 

Similar to Test design techniques: Structured and Experienced-based techniques

SOFTWARE QUALITY ASSURANCE AND TESTING - SHORT NOTES
SOFTWARE QUALITY ASSURANCE AND TESTING - SHORT NOTESSOFTWARE QUALITY ASSURANCE AND TESTING - SHORT NOTES
SOFTWARE QUALITY ASSURANCE AND TESTING - SHORT NOTESsuthi
 
ISTQB, ISEB Lecture Notes
ISTQB, ISEB Lecture NotesISTQB, ISEB Lecture Notes
ISTQB, ISEB Lecture Notesonsoftwaretest
 
ISTQB / ISEB Foundation Exam Practice -1
ISTQB / ISEB Foundation Exam Practice -1ISTQB / ISEB Foundation Exam Practice -1
ISTQB / ISEB Foundation Exam Practice -1Yogindernath Gupta
 
Test Case Design
Test Case DesignTest Case Design
Test Case DesignVidya-QA
 
Test Case Design and Technique
Test Case Design and TechniqueTest Case Design and Technique
Test Case Design and TechniqueFayis-QA
 
Test Case Design and Technique
Test Case Design and TechniqueTest Case Design and Technique
Test Case Design and TechniqueANKUR-BA
 
Test Case Design & Technique
Test Case Design & TechniqueTest Case Design & Technique
Test Case Design & TechniqueRajesh-QA
 
ISTQB, ISEB Lecture Notes- 4
ISTQB, ISEB Lecture Notes- 4ISTQB, ISEB Lecture Notes- 4
ISTQB, ISEB Lecture Notes- 4onsoftwaretest
 
Automating The Process For Building Reliable Software
Automating The Process For Building Reliable SoftwareAutomating The Process For Building Reliable Software
Automating The Process For Building Reliable Softwareguest8861ff
 
AJRA Test Strategy Discussion
AJRA Test Strategy DiscussionAJRA Test Strategy Discussion
AJRA Test Strategy Discussionajrhem
 
Manual Testing Interview Questions & Answers.docx
Manual Testing Interview Questions & Answers.docxManual Testing Interview Questions & Answers.docx
Manual Testing Interview Questions & Answers.docxssuser305f65
 
types of testing with descriptions and examples
types of testing with descriptions and examplestypes of testing with descriptions and examples
types of testing with descriptions and examplesMani Deepak Choudhry
 
Whitepaper Test Case Design and Testing Techniques- Factors to Consider
Whitepaper Test Case Design and Testing Techniques- Factors to ConsiderWhitepaper Test Case Design and Testing Techniques- Factors to Consider
Whitepaper Test Case Design and Testing Techniques- Factors to ConsiderRapidValue
 

Similar to Test design techniques: Structured and Experienced-based techniques (20)

Testing
TestingTesting
Testing
 
SOFTWARE QUALITY ASSURANCE AND TESTING - SHORT NOTES
SOFTWARE QUALITY ASSURANCE AND TESTING - SHORT NOTESSOFTWARE QUALITY ASSURANCE AND TESTING - SHORT NOTES
SOFTWARE QUALITY ASSURANCE AND TESTING - SHORT NOTES
 
Unit2 for st
Unit2 for stUnit2 for st
Unit2 for st
 
ISTQB, ISEB Lecture Notes
ISTQB, ISEB Lecture NotesISTQB, ISEB Lecture Notes
ISTQB, ISEB Lecture Notes
 
ISTQB / ISEB Foundation Exam Practice -1
ISTQB / ISEB Foundation Exam Practice -1ISTQB / ISEB Foundation Exam Practice -1
ISTQB / ISEB Foundation Exam Practice -1
 
Testing
TestingTesting
Testing
 
Test Case Design
Test Case DesignTest Case Design
Test Case Design
 
Test Case Design and Technique
Test Case Design and TechniqueTest Case Design and Technique
Test Case Design and Technique
 
Test Case Design and Technique
Test Case Design and TechniqueTest Case Design and Technique
Test Case Design and Technique
 
Test Case Design & Technique
Test Case Design & TechniqueTest Case Design & Technique
Test Case Design & Technique
 
ISTQB, ISEB Lecture Notes- 4
ISTQB, ISEB Lecture Notes- 4ISTQB, ISEB Lecture Notes- 4
ISTQB, ISEB Lecture Notes- 4
 
Automating The Process For Building Reliable Software
Automating The Process For Building Reliable SoftwareAutomating The Process For Building Reliable Software
Automating The Process For Building Reliable Software
 
testing
testingtesting
testing
 
Testing
TestingTesting
Testing
 
AJRA Test Strategy Discussion
AJRA Test Strategy DiscussionAJRA Test Strategy Discussion
AJRA Test Strategy Discussion
 
software testing
software testingsoftware testing
software testing
 
Chapter 8 Testing Tactics.ppt
Chapter 8 Testing Tactics.pptChapter 8 Testing Tactics.ppt
Chapter 8 Testing Tactics.ppt
 
Manual Testing Interview Questions & Answers.docx
Manual Testing Interview Questions & Answers.docxManual Testing Interview Questions & Answers.docx
Manual Testing Interview Questions & Answers.docx
 
types of testing with descriptions and examples
types of testing with descriptions and examplestypes of testing with descriptions and examples
types of testing with descriptions and examples
 
Whitepaper Test Case Design and Testing Techniques- Factors to Consider
Whitepaper Test Case Design and Testing Techniques- Factors to ConsiderWhitepaper Test Case Design and Testing Techniques- Factors to Consider
Whitepaper Test Case Design and Testing Techniques- Factors to Consider
 

Recently uploaded

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 

Recently uploaded (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 

Test design techniques: Structured and Experienced-based techniques

  • 1. Test Design techniques: Structured and Experienced-based techniques Author: Khuong Nguyen
  • 2. Structured based testing techniques Cyclomatic complexity Experienced based testing techniques Choosing appropriate testing techniques Sample exam Agenda
  • 3. Understand and apply common Structured-Based Testing techniques Know how to calculate Cyclomatic Complexity Understand Experienced-Based Testing techniques Learn to choose appropriate testing techniques in specific circumstances Objectives
  • 4. Software testing foundations Certified Tester Foundation Level Syllabus 2007 Software Testing Dictionary BS7925-2: Component Testing References
  • 6. Structure-based testing/white-box testing is based on an identified structure of the software or system It is a method for writing a set of white-box test cases that exercise the paths in the code How to measure thoroughly the test cases exercise the code Introduction
  • 7. Test coverage measures in some specific way the amount of testing performed by a set of tests. Wherever we can count things and can tell whether or not each of those things has been tested by some test, then we can measure coverage What is test coverage?
  • 8. Statement testing and coverage Decision testing and coverage Other structure-based techniques Basic white box test case design techniques
  • 9. In component testing, statement coverage is the assessment of the percentage of executable statements that have been exercised by a test case suite. (TRUE OR FALSE) Statement testing derives test cases to execute specific statements, normally to increase statement coverage. Every statement is requested to be executed at least one Definition of statement coverage
  • 10. Translate the source code to control flow graph Defines nodes(Statement) and control flow between statements(edges) Conditional statements(IF, CASE) and loops(WHILE, FOR) have more than one edges going out Verify that each statement have been executed Steps
  • 11. Examples IF 1 IF 2 WHILE 3 4 6 ENDIF 7 ENDIF 1 If (a>0) then 2 If (b<1) then 3 While (c<2) 4 c++; 5 End while End IF 7 End IF 5 Node, statement Edge, Control flow
  • 12. Statement coverage IF 1 IF 2 WHILE 3 4 6 ENDIF 7 ENDIF 100%SC: All nodes can be reached by a single test case 1, 2, 3, 4, 5, 6, 7 5
  • 13. It is a very weak criterion Value of the technique: Unreachable source code (dead code) can be detected Empty ELSE-parts are not considered Statement Coverage Coverage is measured by using test tools
  • 14. What is minimum number of test cases required for full statement coverage? 1 test for statement coverage 2 tests for statement coverage 3 tests for statement coverage Read P Read Q IF P+Q > 100 THEN Print “Large” ENDIF If P > 50 THEN Print “P Large” ENDIF Exercise
  • 15. Decision coverage, related to branch coverage, is the assessment of the percentage of decision outcomes (TRUE and FALSE) Require every decision outcome: all possible cases-statement Decision testing is a form of control flow testing as it generates a specific flow of control through the decision points Definition of decision/branch coverage
  • 16. Translate the source code to control flow graph Defines nodes(Statement) and control flow between statements(edges) Conditional statements(IF, CASE) and loops(WHILE, FOR) have more than one edges going out Verify that all possible branches of the control flow are tested Steps
  • 17. It is a stronger criterion than statement coverage Be able to detect missing statement in empty branches Decision coverage is stronger than statement coverage: 100% decision coverage guarantees 100% statement coverage, but not vice versa. Decision coverage requires test of every decision outcome: both THEN and ELSE in the IF-statement all possibilities for the CASE-statement and fall-through case both execution of the FOR loop and the bypass Decision/branch Coverage
  • 18. Examples IF 1 IF 2 WHILE 3 4 6 ENDIF 7 ENDIF 1 If (a>0) then 2 If (b<1) then 3 While (c<2) 4 c++; 5 End while 6 End IF 7 End IF 5 Node, statement Edge, Control flow
  • 19.
  • 20.
  • 21. Data flow Testing Branch Condition Testing Branch Condition Combination Testing Modified Condition Decision Testing LCSAJ Testing Other structure-based test techniques
  • 22. There are stronger levels of structural coverage beyond decision coverage (condition coverage and multiple condition coverage) The concept of coverage can also be applied at other test levels (e.g. at integration level) where the percentage of modules, components or classes that have been exercised by a test case suite could be expressed as module, component or class coverage Tool support is useful for the structural testing of code The basis of white box techniques is the source code. Adequate test case design techniques chosen depending on the complexity of the program structure Other structure-based test techniques (cont.)
  • 23. Testing contains the combination of different techniques The expected risk guides to select testing techniques and the intensity of execution Basis of the selection of the white box technique is the structure of the test object Which techniques should be chosen?
  • 25. Cyclomatic complexity or conditional complexity: Was developed by McCabe Is the software metric (measurement) to measure the complexity of the program’s source code Definition
  • 26. M = E − N + 2P M = cyclomatic complexity E = the number of edges (links) of the graph N = the number of nodes of the graph P = the number of connected components Number of predicates + 1 How to calculate
  • 27. Examples of cyclomatic complexity E=1, N=2, P=1 M=1-2+2=1 E=4, N=4, P=1 M=4-4+2=2 E=2, N=4, P=2 M=2-4+4=2 E=4, N=5, P=1 M=4-5+2=1
  • 28. Cyclomatic complexity of programming constructs 1 1 if E then 2 A else B 4 C 2 3 4 E = 4, N = 4, P =1 M = 2
  • 29. C
  • 30. C
  • 31. Predicate notes P = ? Complexity C = ?
  • 32. Predicate notes P = ? Complexity C = ?
  • 33. Predicate notes P = ? Complexity C = ?
  • 34. Complex systems are hard to understand hard to change hard to reuse McCabe found that modules with a cyclomatic complexity greater than 10 were hard to test and error prone. Look for procedures with high cyclomatic complexity and rewrite them, focus testing on them, or focus reviewing on them. Metrics view
  • 36. Experienced-based test design technique: Procedure to derive and/or select test cases based on the tester’s experience, knowledge and intuition The techniques can be useful in identifying special tests not easily captured by formal techniques, especially when applied after more formal approaches Definition
  • 37. Tester select test cases to uncover expected problems based on the skills, experienced and knowledge of the tester The term of error guessing is used very often in practice A commonly used experienced-based technique is error guessing Introduction
  • 38. Exploratory testing Error guessing Basic experience-based test techniques
  • 39. Error guessing is a test design technique where the experience of the tester is used to anticipate what defect might be present in the system under test. Testers design tests specifically to expose errors Error Guessing - Definition
  • 40. Error guessing is a technique that should be used as a complement to other formal techniques Testers anticipate defects based on their experience, skills Knowledge in developing similar applications and using similar technologies are also used when designing test cases. “Guess” where errors happened based on intuition and experience of tester. Error guessing
  • 41. These defect and failure lists can be built based on experience, available defect and failure data, and from common knowledge about why software fails. Error guessing
  • 42. Exploratory testing is test design technique where the tester actively controls the design of the test as those tests are performed and uses information gained while testing to design new and better test Exploratory testing is exploring, finding out about the software: What it does What it doesn’t do What works What doesn’t work Definition of Exploratory testing
  • 43. Exploratory testing is a hands-on approach in which testers are involved in minimum planning and maximum test execution Activities in exploratory testing is concurrent: Test planning Test design Test execution Test logging Learning Main features of exploratory testing
  • 44. Result of one test case influence the design and execution of further test cases During testing, a “mental” model of program under test is created. It contains: How the program works How it behaves How it should behave Focus on finding further aspect/behavior of the program. Main features of exploratory testing
  • 45. Planning: involve the creation of the test charter that includes: Test charter Short declaration of scope Time-boxed of effort Objectives and possible approaches to be used Test design and test execution are performed parallel: Do not have formal documents: test conditions, test cases, test scripts… Some notes written during exploratory testing session Test logging is undertaken as test execution is performed. The key aspect of exploratory testing is learning about the software, its strengths and weaknesses How to implement
  • 46. Approach Execute few test cases Analyze results Consider “special” to next test cases Knowledge about the test object under test is collected
  • 47. Possible elements of the test object are “explored” to decide which parts will be tested Result of Exploratory testing helps to determine which test techniques can be applied if there is time left The test of “test charter” should not take more than one or two hours of uninterrupted test time Benefit
  • 48. The technique is applicable when: There no poor specification The time is severely restricted because it uses much less time than other techniques It can serves to complement formal testing It can serve to check on the test process, to help ensure that the most serious defects are found. When we use exploratory testing
  • 49. Why? With which goal is the test run? What is to be tested? How? Which testing method should be used? Which problems should be found? Common questions for executing test charter
  • 51. What are the pros and cons of: Specification-based testing techniques Structure-based testing techniques Experience-based testing techniques What is the best practice? When to use what?
  • 52. The choice of which test techniques to use depends on a number of factors: the type of system regulatory standards customer or contractual requirements level of risk, type of risk test objective, documentation available knowledge of the testers time and budget development life cycle, use case models previous experience of types of defects found. Which techniques should be chosen?
  • 53. Testing contains the combination of different techniques The critically and the expected risk guide to select testing techniques and the intensity of execution Basis of the selection of the white box technique is the structure of the test object Which techniques should be chosen?
  • 54. Thank You KhuongNguyen, Senior Quality Control Engineer Post graduate student, Australian Business School, Funds Management, UNSW, 2032, AustraliaEmail: khuong0602@gmail.com; op_khuong_nguyen@yahoo.com

Editor's Notes

  1. what is test case coverage? What is code coverage? How can you ensure that your test case covers all requirements? could you name some coverage items? + coverage items may be requirements, function calls, modules, objects, menu options, screens, buttons, transition steps, dropdown items, business transactions… + EP: percentage of equivalence partitions exercised + BVA: percentage of boundaries exercised + Decision tables: percentage of business rules or decision table columns tested + State transition testing: Percentage of states visited Percentage of (valid) transitions exercised Percentage of pairs of valid transitions exercised (1-switch coverage, 2-switch coverage) Percentage of invalid transitions exercised (state table)- What is the coverage interested by business analysts, testers or users?- What is the coverage interested by developers?
  2. In reality, 100% statement coverage is time-consuming and could be achieved only by strict requirement from client. Normally, 80% of code coverage is good enough.
  3. - To reach 100%SC, choose what test data? How about 1, 7? Test data? How many percentage? How about 1, 2, 6, 7? Test data? How many percentage?
  4. Answer: aP = 40, Q = 70, %SC = ?  7/8P = 60, Q = 60, %SC = ?  8/8
  5. Answer: b1, 2, 3, 4, 51, 2, 3, 5Outlook does not disappear, %DC = 50%
  6. Reference BS7925-2, Software Testing Foundations (ISTQB)
  7. a= (b+c) counts as 1 predicate
  8. Answer: P = 4, C = 5
  9. Answer: P = 5, C = 6
  10. Answer: P = 5, C = 6
  11. One drawback of code coverage measurement is that it measures coverage of what has been written, i.e. the code itself; it cannot say anything about the software that has not been written. If a specified function has not been implemented, specification-based testing techniques will reveal this. If a function was omitted from the specification, then experience-based techniques may find it. But structure-based techniques can only look at a structure which is already there. Best practice is to use all those techniques: spec-based and structure-based followed by exp-based testing techniques. Keep in the mind of objective of each technique.
  12. Test objective is the most important