SlideShare a Scribd company logo
Software testing
White box testing
White box (structural) testing
 White box testing concept requires verification of every program
statement and comment
White box testing includes:
 Software qualification tests
 Reusability tests
 Maintainability tests
 Data processing and calculations correctness tests
Software Qualification Tests
 To quickly review, software that qualifies is coded and
documented according to standards, procedures and work
instructions.
 It facilitates the followings:
 The team leader to check the software
 The replacement programmer to comprehend the code and
continue coding tasks
 The maintenance programmer to correct bugs and/or update or
change the program upon request
Software Qualification Tests
 It answers the following questions:
 Does the code fulfil the code structure instructions and procedures,
such as module size, application of reused code, etc.?
 Does the coding style fulfil coding style procedures?
 Do the internal program documentation and “help” sections
fulfil coding style procedures?
 Specialized software packages (called code auditors) can now
perform a portion of the qualification tests
Reusability Test
 Software reusability substantially reduces project resources
requirements
 It improves the quality of new software systems
 Reusability shortens the development period
 Reusability testing is used to determine whether the packaging
and documentation of the programs and modules to be reused
conform to the standards and procedures demanded for
inclusion in the reusable software library.
Data processing and calculation correctness tests
In order to perform data processing and calculation correctness tests
(“white box correctness test”), every computational operation in the
sequence of operations created by each test case (“path”) must be
examined
 This type of verification allows us to decide whether the processing
operations and their sequences were programmed correctly for the
path in question
 Raises the question of coverage of a vast number of possible
processing paths and the multitudes of lines of code.
Data processing and calculation correctness tests
Two alternative approaches have emerged:
 “Path Coverage” – to plan our test to cover all the possible paths,
where coverage is measured by percentage of paths covered.
 “Line/Statement Coverage” – to plan our tests to cover all the
program code lines, where coverage is measured by percentage of
lines covered.
Correctness tests and path coverage
 Different paths in a software module are created by the choice in
conditional statements, such as IF–THEN–ELSE or DO WHILE..
 Path testing is motivated by the aspiration to achieve complete
coverage of a program by testing all its possible paths.
 Path test’s completeness is defined as the percentage of the program
paths executed during the test.
 It is impractical in most of the cases because of the vast resources
required for its performance
Correctness tests and path coverage
 Example:
 Let us calculate the number of possible paths created by a
module containing 10 conditional statements, each allowing for
only two options (e.g., IF–THEN–ELSE and DO WHILE).
 This simple module contains 1024 different paths
 To obtain full path coverage for this module (probably 25–50
lines of code) one should prepare at least 1024 test cases
 This indicates the impracticality of wide use of path
testing
 Its application is directed mainly to high risk software
modules, where the costs of failure resulting from
software error fully warrant the costs of path testing
Correctness tests and line coverage
 Weaker coverage concept as compared to path coverage
 The line coverage concept requires far fewer test cases but,
as expected, leaves most of the possible paths untested
 Every line of code be executed at least once during the
process of testing.
 The line coverage metrics for completeness of a line-testing
(“basic path testing”) plan are defined as the percentage of
lines indeed executed – that is, covered – during the tests.
Correctness tests and line coverage
Flow chart and a program flow graph can be helpful
 In a flow chart, diamonds present the options covered
by conditional statements (decisions)
 Rectangles represent the software sections connecting
those conditional statements.
Correctness tests and line coverage
 In program flow graphs, nodes represent software
sections and thus replace one or more flow chart
rectangles.
 The edges indicate the sequence of software sections.
 Nodes having two or more leaving edges represent
conditional statements
Example – the Imperial Taxi Services (ITS) taximeter
 Imperial Taxi Services (ITS) serves one-time passengers and regular
clients (identified by a taxi card). The ITS taxi fares for one-time
passengers are calculated as follows:
1. Minimal fare: $2. This fare covers the distance traveled up to 1000 yards
and waiting time (stopping for traffic lights or traffic jams, etc.) of up to
3 minutes.
2. For every additional 250 yards or part of it: 25 cents.
3. For every additional 2 minutes of stopping or waiting or part thereof: 20
cents.
4. One suitcase: no charge; each additional suitcase: $1.
5. Night supplement: 25%, effective for journeys between 21.00 and 06.00.
Regular clients are entitled to a 10% discount and are not charged the night
supplement.
Example – the Imperial Taxi Services (ITS) taximeter
 When planning the basic path testing plan of the new taximeter
module
 Prepare a flow chart and a program flow graph for the taxi
fare calculation process
 Figure represents a calculation process that includes five
decisions
 Full path coverage requires that all the possible paths be
executed at least once
ITS flow chart
ITS :Program flow graph of the module
Software Testing Part 3.pptx or black box tsting
Line Coverage of ITS flow graph
 The program flow graph allows us to observe that full line
coverage of the ITS software module can be reached by
inspecting the minimum number of paths – a total of three
Line Coverage of ITS flow graph
 The proportion of test cases required to test the system
by full line coverage of three test cases versus full
path coverage of 24 test cases is 1:8! This ratio grows
rapidly with program complexity.
McCabe’s cyclomatic complexity metrics
 Cyclomatic complexity is a software metric (measurement). It
is used to indicate the complexity of a program.
 It directly measures the number of linearly independent paths
through a program's source code.
 Independent Path: Any path on the program flow graph that
includes at least one edge that is not included in any of the
former independent paths
 Cyclomatic complexity is computed using the control flow
graph of the program
 Cyclomatic complexity may also be applied to individual
functions, modules, methods or classes within a program.
 Called Basis Path Testing by McCabe who first proposed it
Software Testing Part 3.pptx or black box tsting
McCabe’s cyclomatic complexity metrics
 If the source code contained no decision points such as IF
statements or FOR loops, the complexity would be 1. Since
there is only a single path through the code.
 If the code had a single IF statement containing a single
condition there would be two paths through the code, one path
where the IF statement is evaluated as TRUE and one path
where the IF statement is evaluated as FALSE.
McCabe’s cyclomatic complexity metrics
 The cyclomatic complexity metric (V(G)) is expressed in
three different ways, all of which are based on the
program flow graph
 (1) V(G) = ER + 1
 (2) V(G) = E – N + 2
 (3) V(G) = P + 1
 Compute the Cyclomatic complexity of ITS flow graph
and identify the maximum number of independent paths
Formula: V(G) = E – N + 2
E = 21, N = 17
V(G) = E – N + 2 = 21 – 17 + 2 = 6
Decision Coverage
 With Decision coverage the possible outcomes of each
condition and of the decision are tested at least once.
 In other words we cover that all conditions are one
time TRUE and one time FALSE and we cover one
time the THEN and one time the ELSE.
Brach Coverage and Multiple Condition Coverage
 Branch Coverage: This guarantees that, during
testing, every decision point (branch) in the program
is evaluated as true or false at least once.
 Multiple condition testing: It involves testing both
simple and complicated condition combinations inside
decision points.

More Related Content

PPT
Qat09 presentations dxw07u
PDF
A WHITE BOX TESTING TECHNIQUE IN SOFTWARE TESTING : BASIS PATH TESTING
PPT
2. Lect 27 to 28 White box s/w testing.ppt
PPTX
Control Flow Testing
PPTX
stm unit-1part-II-1.pptx about software testing tools
PDF
Tools and techniques of code coverage testing
PPTX
Unit 3 Control Flow Testing
PPTX
SE UNIT 5 part 2 (1).pptx
Qat09 presentations dxw07u
A WHITE BOX TESTING TECHNIQUE IN SOFTWARE TESTING : BASIS PATH TESTING
2. Lect 27 to 28 White box s/w testing.ppt
Control Flow Testing
stm unit-1part-II-1.pptx about software testing tools
Tools and techniques of code coverage testing
Unit 3 Control Flow Testing
SE UNIT 5 part 2 (1).pptx

Similar to Software Testing Part 3.pptx or black box tsting (20)

PPT
PDF
Software Testing Exam imp Ques Notes.pdf
PPTX
SWE-6 TESTING.pptx
PPTX
Calculation of Cyclomatic complexity
PPTX
Automating The Process For Building Reliable Software
PPT
Role+Of+Testing+In+Sdlc
PPT
Machine Learning Approach to Report Prioritization with an ...
DOCX
Mi0033 software engineering...
PPT
vu-sqa-lecture26 of principle of management.ppt
PPTX
Sta unit 4(abimanyu)
PPT
7-White Box Testing.ppt
PDF
Software Testing and Quality Assurance Assignment 2
PPTX
OOAD - Ch.09 - Software Project Estimation.pptx
PPT
Path testing, data flow testing
PDF
Aa03101540158
PPTX
Unit3_Software-MDFJHGFUGJFSJDFMHGSAD,MFKJASDFH,ADSFGAKSIF,AWKJEHGF,Aetrics.pptx
PPT
white box testing.ppt
PPT
Software Engineering
PPT
Software Engineering (Testing techniques)
PPT
Software Engineering (Testing techniques)
Software Testing Exam imp Ques Notes.pdf
SWE-6 TESTING.pptx
Calculation of Cyclomatic complexity
Automating The Process For Building Reliable Software
Role+Of+Testing+In+Sdlc
Machine Learning Approach to Report Prioritization with an ...
Mi0033 software engineering...
vu-sqa-lecture26 of principle of management.ppt
Sta unit 4(abimanyu)
7-White Box Testing.ppt
Software Testing and Quality Assurance Assignment 2
OOAD - Ch.09 - Software Project Estimation.pptx
Path testing, data flow testing
Aa03101540158
Unit3_Software-MDFJHGFUGJFSJDFMHGSAD,MFKJASDFH,ADSFGAKSIF,AWKJEHGF,Aetrics.pptx
white box testing.ppt
Software Engineering
Software Engineering (Testing techniques)
Software Engineering (Testing techniques)
Ad

More from MaryamMahjabeenYouni (7)

PPTX
katalonstudiopresentation-221225172808-8179c016 (1).pptx
PPTX
Lecture9 10.pptx or software testing pptx
PPTX
Informed Search by the artificial intelligence
PPTX
Agent Adaptability in a machine learning
PPTX
2-SE Process Models.pptx
PPTX
3-SE Agility and Process-2.pptx
PPTX
Lecture 1 SE.pptx
katalonstudiopresentation-221225172808-8179c016 (1).pptx
Lecture9 10.pptx or software testing pptx
Informed Search by the artificial intelligence
Agent Adaptability in a machine learning
2-SE Process Models.pptx
3-SE Agility and Process-2.pptx
Lecture 1 SE.pptx
Ad

Recently uploaded (20)

PDF
Computing-Curriculum for Schools in Ghana
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
O7-L3 Supply Chain Operations - ICLT Program
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
Cell Types and Its function , kingdom of life
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PPTX
GDM (1) (1).pptx small presentation for students
PPTX
master seminar digital applications in india
PPTX
Lesson notes of climatology university.
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
Computing-Curriculum for Schools in Ghana
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
O7-L3 Supply Chain Operations - ICLT Program
human mycosis Human fungal infections are called human mycosis..pptx
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
O5-L3 Freight Transport Ops (International) V1.pdf
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Cell Types and Its function , kingdom of life
102 student loan defaulters named and shamed – Is someone you know on the list?
STATICS OF THE RIGID BODIES Hibbelers.pdf
202450812 BayCHI UCSC-SV 20250812 v17.pptx
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Final Presentation General Medicine 03-08-2024.pptx
Chinmaya Tiranga quiz Grand Finale.pdf
GDM (1) (1).pptx small presentation for students
master seminar digital applications in india
Lesson notes of climatology university.
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE

Software Testing Part 3.pptx or black box tsting

  • 2. White box (structural) testing  White box testing concept requires verification of every program statement and comment White box testing includes:  Software qualification tests  Reusability tests  Maintainability tests  Data processing and calculations correctness tests
  • 3. Software Qualification Tests  To quickly review, software that qualifies is coded and documented according to standards, procedures and work instructions.  It facilitates the followings:  The team leader to check the software  The replacement programmer to comprehend the code and continue coding tasks  The maintenance programmer to correct bugs and/or update or change the program upon request
  • 4. Software Qualification Tests  It answers the following questions:  Does the code fulfil the code structure instructions and procedures, such as module size, application of reused code, etc.?  Does the coding style fulfil coding style procedures?  Do the internal program documentation and “help” sections fulfil coding style procedures?  Specialized software packages (called code auditors) can now perform a portion of the qualification tests
  • 5. Reusability Test  Software reusability substantially reduces project resources requirements  It improves the quality of new software systems  Reusability shortens the development period  Reusability testing is used to determine whether the packaging and documentation of the programs and modules to be reused conform to the standards and procedures demanded for inclusion in the reusable software library.
  • 6. Data processing and calculation correctness tests In order to perform data processing and calculation correctness tests (“white box correctness test”), every computational operation in the sequence of operations created by each test case (“path”) must be examined  This type of verification allows us to decide whether the processing operations and their sequences were programmed correctly for the path in question  Raises the question of coverage of a vast number of possible processing paths and the multitudes of lines of code.
  • 7. Data processing and calculation correctness tests Two alternative approaches have emerged:  “Path Coverage” – to plan our test to cover all the possible paths, where coverage is measured by percentage of paths covered.  “Line/Statement Coverage” – to plan our tests to cover all the program code lines, where coverage is measured by percentage of lines covered.
  • 8. Correctness tests and path coverage  Different paths in a software module are created by the choice in conditional statements, such as IF–THEN–ELSE or DO WHILE..  Path testing is motivated by the aspiration to achieve complete coverage of a program by testing all its possible paths.  Path test’s completeness is defined as the percentage of the program paths executed during the test.  It is impractical in most of the cases because of the vast resources required for its performance
  • 9. Correctness tests and path coverage  Example:  Let us calculate the number of possible paths created by a module containing 10 conditional statements, each allowing for only two options (e.g., IF–THEN–ELSE and DO WHILE).  This simple module contains 1024 different paths  To obtain full path coverage for this module (probably 25–50 lines of code) one should prepare at least 1024 test cases  This indicates the impracticality of wide use of path testing  Its application is directed mainly to high risk software modules, where the costs of failure resulting from software error fully warrant the costs of path testing
  • 10. Correctness tests and line coverage  Weaker coverage concept as compared to path coverage  The line coverage concept requires far fewer test cases but, as expected, leaves most of the possible paths untested  Every line of code be executed at least once during the process of testing.  The line coverage metrics for completeness of a line-testing (“basic path testing”) plan are defined as the percentage of lines indeed executed – that is, covered – during the tests.
  • 11. Correctness tests and line coverage Flow chart and a program flow graph can be helpful  In a flow chart, diamonds present the options covered by conditional statements (decisions)  Rectangles represent the software sections connecting those conditional statements.
  • 12. Correctness tests and line coverage  In program flow graphs, nodes represent software sections and thus replace one or more flow chart rectangles.  The edges indicate the sequence of software sections.  Nodes having two or more leaving edges represent conditional statements
  • 13. Example – the Imperial Taxi Services (ITS) taximeter  Imperial Taxi Services (ITS) serves one-time passengers and regular clients (identified by a taxi card). The ITS taxi fares for one-time passengers are calculated as follows: 1. Minimal fare: $2. This fare covers the distance traveled up to 1000 yards and waiting time (stopping for traffic lights or traffic jams, etc.) of up to 3 minutes. 2. For every additional 250 yards or part of it: 25 cents. 3. For every additional 2 minutes of stopping or waiting or part thereof: 20 cents. 4. One suitcase: no charge; each additional suitcase: $1. 5. Night supplement: 25%, effective for journeys between 21.00 and 06.00. Regular clients are entitled to a 10% discount and are not charged the night supplement.
  • 14. Example – the Imperial Taxi Services (ITS) taximeter  When planning the basic path testing plan of the new taximeter module  Prepare a flow chart and a program flow graph for the taxi fare calculation process  Figure represents a calculation process that includes five decisions  Full path coverage requires that all the possible paths be executed at least once
  • 16. ITS :Program flow graph of the module
  • 18. Line Coverage of ITS flow graph  The program flow graph allows us to observe that full line coverage of the ITS software module can be reached by inspecting the minimum number of paths – a total of three
  • 19. Line Coverage of ITS flow graph  The proportion of test cases required to test the system by full line coverage of three test cases versus full path coverage of 24 test cases is 1:8! This ratio grows rapidly with program complexity.
  • 20. McCabe’s cyclomatic complexity metrics  Cyclomatic complexity is a software metric (measurement). It is used to indicate the complexity of a program.  It directly measures the number of linearly independent paths through a program's source code.  Independent Path: Any path on the program flow graph that includes at least one edge that is not included in any of the former independent paths  Cyclomatic complexity is computed using the control flow graph of the program  Cyclomatic complexity may also be applied to individual functions, modules, methods or classes within a program.  Called Basis Path Testing by McCabe who first proposed it
  • 22. McCabe’s cyclomatic complexity metrics  If the source code contained no decision points such as IF statements or FOR loops, the complexity would be 1. Since there is only a single path through the code.  If the code had a single IF statement containing a single condition there would be two paths through the code, one path where the IF statement is evaluated as TRUE and one path where the IF statement is evaluated as FALSE.
  • 23. McCabe’s cyclomatic complexity metrics  The cyclomatic complexity metric (V(G)) is expressed in three different ways, all of which are based on the program flow graph  (1) V(G) = ER + 1  (2) V(G) = E – N + 2  (3) V(G) = P + 1  Compute the Cyclomatic complexity of ITS flow graph and identify the maximum number of independent paths
  • 24. Formula: V(G) = E – N + 2 E = 21, N = 17 V(G) = E – N + 2 = 21 – 17 + 2 = 6
  • 25. Decision Coverage  With Decision coverage the possible outcomes of each condition and of the decision are tested at least once.  In other words we cover that all conditions are one time TRUE and one time FALSE and we cover one time the THEN and one time the ELSE.
  • 26. Brach Coverage and Multiple Condition Coverage  Branch Coverage: This guarantees that, during testing, every decision point (branch) in the program is evaluated as true or false at least once.  Multiple condition testing: It involves testing both simple and complicated condition combinations inside decision points.