SlideShare a Scribd company logo
SOFTWARE QUALITY
ASSURANCE
WHITE BOX




      Seminar: Oana FEIDI
      Quality Manager – Continental Automotive
BLACK-BOX VS. WHITE-BOX

                      Test cases derived from specifications




   The focus is not the design, nor the implementation
                                   The focus is on the logic of implementation
WHITE BOX (STRUCTURAL
TESTING)
 Structural - test case selection is based on an
 analysis of the internal structure of
 component

     Control flow
       Statement testing

       Branch/Decision Testing

       Branch Condition Testing

       Modified Condition Combination Testing




     Data flow testing
WHITE BOX
   Using the white-box testing techniques outlined
    in this seminar, a software engineer can design
    test cases that
        exercise independent paths within a module or unit;
        exercise logical decisions on both their true and false side;

        execute loops at their boundaries and within their

         operational bounds
        exercise internal data structures to ensure their validity
STATEMENT TESTING
   uses a model of the program’s control flow
   it is designed in order to execute all or selected statements of the
    test object
Test cases are design to execute
each statement.
                                                      An entity in a programming
For each test case specify:                            language which is typically
                                                     the smallest indivisible unit of
• the input(s) of the component                                execution.

• identification of statement(s) to be
executed by the test case
• the expected outcome of the test
case
 Test completeness criteria: the percentage of the statements in the
 software which were executed at least at once (executing a statement
 means that the statement was encountered and evaluated during testing).
EXAMPLE
 float foo (int a, int b, int c, int d, float e)
 {
    float e;
    if (a == 0) {
           return 0;
    }
    int x = 0;
    if ((a==b) OR ((c == d) AND bug(a) )) {
           x=1;
    }
    e = 1/x;
                                                 statement
    return e;
 }
BRANCH/DECISION TESTING
 uses a model of the program’s flow
 it is designed in order to execute (each) outcome
  of all or selected decision points in a test object
                                            an executable statement
    For each test specify:
                                           which may transfer control
    • the input(s) of the component          to another statement,
                                            depending upon the logic
    • Identification of decision
                                            of the decision statement
    outcome(s) to be executed by
    the test case
    • the expected outcome of the
    test case

 Test completeness criteria: achievement of the test coverage – 100%
 of the branches (one true and one false for each part of condition)
EXAMPLE
A  = true and (B or C) = false
 A = false and (B or C) = true

                                       if A and (B or C)



        Case   A   B     C    Output

        1      0   1     1    0

        2      1   0     0    0
BRANCH CONDITION COMBINATION
   uses a model of the program flow where each
    combination of the inputs for a decision/condition must
    be tested, in order to check if each branch is covered
   For each test case specify:
        the input(s) of the component
        the expected outcome of the test case which can show which

         branch is covered


Test completeness criteria: for a condition containing n
  boolean operands → 2n test cases are required to achieve
  100% coverage
Note: this coverage rapidly becomes unachievable for more
 complex conditions.
WHITE BOX - SUMMARY
 Statement     testing
     uses a model of the program’s control flow
     it is designed in order to execute all or selected statements of

      the test object
 Branch/Decision       Testing
     uses a model of the program’s flow
     it is designed in order to execute (each) outcome of all or

      selected decision points in a test object
 Branch    Condition Combination
       uses a model of the program flow where each combination
        of the inputs for a decision/condition must be tested, in
        order to check if each branch is covered
MODIFIED CONDITION COMBINATION
TESTING
 usesa model of the program’s flow where each
 atomic condition is independently tested, in order
 to show how the decision outcome is affected

 test
     case are designed to show that each condition
 independently affects the decision outcome

 For    each test case specify:
      the input(s) of the component
      The expected outcome of the test case
MODIFIED CONDITION COMBINATION
TESTING
   Test completeness criteria
       for a condition containing n boolean operands, to achieve
        100% coverage are necessary:
         minimum: n + 1 test cases
         maximum: 2n test cases




   Example: for 3 boolean operands, to achieve 100%
    coverage are necessary:
         Minimum 4 test cases
         Maximum 6 test cases
EXAMPLE
Case   A       B       B or C   C       Outcome

1          1       1      1         0      1      if (A and (B or C))

2          0                               0

3          1       1      1         0      1

4                  0      0                0

5          1       0      1         1      1

6                         0         0      0
LOOP TESTING
   Simple Loops:- 'n' is the maximum number of allowable
    passes
        skip the loop entirely.
        only one pass thru the loop.

        two passes thru the loop.

        m passes thru the loop where m< n.

        n-1,n,n+1 passes thru the loop



   Nested loops
        start with the innermost loop. Set all other loop to min. values.
        conduct simple loop tests for the innermost loop while holding the
         outer loops at their min. iteration values.
        work outward, conducting tests for the next loop, but keeping all
         the outer loops at their min. iteration count.
        continue until all loops have been tested.
EXERCISE
   1) Identify what scenarios have to be run to achieve
    100% statement coverage and 100% branch coverage
    on the following code


   2) Test the same examples on the following link.
       Does white-box covers 100% the black-box?

More Related Content

ODP
White box ppt
Chintakunta Hariteja
 
PPTX
Video Conferencing Ppt
JAGJITSINGH25
 
PPTX
White box black box & gray box testing
Himanshu
 
PPTX
COCOMO model
hajra azam
 
PDF
Security testing presentation
Confiz
 
PPTX
Electroencephalogram (eeg)
divyabms
 
PPT
Software Testing Fundamentals
Chankey Pathak
 
PPTX
Multitasking
iampencilbox
 
White box ppt
Chintakunta Hariteja
 
Video Conferencing Ppt
JAGJITSINGH25
 
White box black box & gray box testing
Himanshu
 
COCOMO model
hajra azam
 
Security testing presentation
Confiz
 
Electroencephalogram (eeg)
divyabms
 
Software Testing Fundamentals
Chankey Pathak
 
Multitasking
iampencilbox
 

What's hot (20)

PPT
Test Levels & Techniques
Dhanasekaran Nagarajan
 
PPTX
Test design techniques
Mohamed Elshenawy
 
PPTX
Test case design techniques
Ashutosh Garg
 
PPTX
Black Box Testing
Mustafa Sherazi
 
PPT
TESTING LIFE CYCLE PPT
suhasreddy1
 
PDF
Test Case, Use Case and Test Scenario
Lokesh Agrawal
 
PPT
Testing
Sonali Chauhan
 
PPTX
Black & White Box testing
Mohamed Zeinelabdeen Abdelgader Farh jber
 
PPTX
Equivalence partinioning and boundary value analysis
niharika5412
 
PPT
Basic software-testing-concepts
medsherb
 
PPTX
Writing Test Cases 20110808
slovejoy
 
PPTX
Se (techniques for black box testing ppt)
Mani Kanth
 
PPTX
Best Practices for Test Case Writing
Sarah Goldberg
 
PPTX
Test case techniques
Pina Parmar
 
PPTX
Software testing.ppt
Komal Garg
 
PPTX
5 black box and grey box testing
Yisal Khan
 
PPTX
Black box software testing
Rana Muhammad Asif
 
PDF
What is Test Plan? Edureka
Edureka!
 
PPTX
White Box Testing
Alisha Roy
 
PPTX
Black Box Testing
MariamKhan120
 
Test Levels & Techniques
Dhanasekaran Nagarajan
 
Test design techniques
Mohamed Elshenawy
 
Test case design techniques
Ashutosh Garg
 
Black Box Testing
Mustafa Sherazi
 
TESTING LIFE CYCLE PPT
suhasreddy1
 
Test Case, Use Case and Test Scenario
Lokesh Agrawal
 
Equivalence partinioning and boundary value analysis
niharika5412
 
Basic software-testing-concepts
medsherb
 
Writing Test Cases 20110808
slovejoy
 
Se (techniques for black box testing ppt)
Mani Kanth
 
Best Practices for Test Case Writing
Sarah Goldberg
 
Test case techniques
Pina Parmar
 
Software testing.ppt
Komal Garg
 
5 black box and grey box testing
Yisal Khan
 
Black box software testing
Rana Muhammad Asif
 
What is Test Plan? Edureka
Edureka!
 
White Box Testing
Alisha Roy
 
Black Box Testing
MariamKhan120
 
Ad

Similar to Whitebox testing (20)

PPT
Whitebox
Oana Feidi
 
PPT
White box testing
Ganesh Wedpathak
 
PPTX
White Box Testing And Control Flow & Loop Testing
Ankit Mulani
 
PPTX
ScioTalks | Coverage Based Testing
Scio Consulting
 
PPT
2. Lect 27 to 28 White box s/w testing.ppt
KomalSinghGill
 
PPT
system verilog
Vinchipsytm Vlsitraining
 
PPTX
whiteboxtestingppt download here information on software.pptx
aaminashaikh053
 
PPT
white box testing.ppt
VISHNUSHANKARSINGH3
 
PPT
Testing
nazeer pasha
 
PPT
11 whiteboxtesting
asifusman1998
 
PPT
1414_lecturueueueueuueueeueueueuusuee_7.ppt
abdulbasetalselwi
 
PDF
Black Box Test Design Techniques
GlobalLogic Ukraine
 
PPS
Lesson 2....PPT 1
bhushan Nehete
 
PPTX
Test design techniques: Structured and Experienced-based techniques
Khuong Nguyen
 
PPTX
Testing part 2 bb
Ravi Prakash
 
PPT
CS8494 SOFTWARE ENGINEERING Unit-4
SIMONTHOMAS S
 
PDF
20050314 specification based regression test selection with risk analysis
Will Shen
 
PDF
Black Box Testing.pdf
SupunLakshan4
 
PPTX
White-box testing.pptx
halaalz3by
 
PPT
Software Testing Tecniques
ersanbilik
 
Whitebox
Oana Feidi
 
White box testing
Ganesh Wedpathak
 
White Box Testing And Control Flow & Loop Testing
Ankit Mulani
 
ScioTalks | Coverage Based Testing
Scio Consulting
 
2. Lect 27 to 28 White box s/w testing.ppt
KomalSinghGill
 
system verilog
Vinchipsytm Vlsitraining
 
whiteboxtestingppt download here information on software.pptx
aaminashaikh053
 
white box testing.ppt
VISHNUSHANKARSINGH3
 
Testing
nazeer pasha
 
11 whiteboxtesting
asifusman1998
 
1414_lecturueueueueuueueeueueueuusuee_7.ppt
abdulbasetalselwi
 
Black Box Test Design Techniques
GlobalLogic Ukraine
 
Lesson 2....PPT 1
bhushan Nehete
 
Test design techniques: Structured and Experienced-based techniques
Khuong Nguyen
 
Testing part 2 bb
Ravi Prakash
 
CS8494 SOFTWARE ENGINEERING Unit-4
SIMONTHOMAS S
 
20050314 specification based regression test selection with risk analysis
Will Shen
 
Black Box Testing.pdf
SupunLakshan4
 
White-box testing.pptx
halaalz3by
 
Software Testing Tecniques
ersanbilik
 
Ad

More from Oana Feidi (18)

PPT
Test management
Oana Feidi
 
PPT
Spice
Oana Feidi
 
PPTX
Root cause analysis
Oana Feidi
 
PPTX
Testcase definition
Oana Feidi
 
PPTX
Test techniques
Oana Feidi
 
PPT
Reviews checklists
Oana Feidi
 
PPT
Spice
Oana Feidi
 
PPT
Test management
Oana Feidi
 
PPTX
Blackbox
Oana Feidi
 
PPTX
Testcase definition
Oana Feidi
 
PPT
Reviews checklists
Oana Feidi
 
DOC
Problematriunghiului
Oana Feidi
 
PPT
Spice
Oana Feidi
 
PPT
Test Management introduction
Oana Feidi
 
PPT
Testcase
Oana Feidi
 
PPT
Testcase
Oana Feidi
 
PPT
Blackbox
Oana Feidi
 
PPT
Reviews Checklists
Oana Feidi
 
Test management
Oana Feidi
 
Spice
Oana Feidi
 
Root cause analysis
Oana Feidi
 
Testcase definition
Oana Feidi
 
Test techniques
Oana Feidi
 
Reviews checklists
Oana Feidi
 
Spice
Oana Feidi
 
Test management
Oana Feidi
 
Blackbox
Oana Feidi
 
Testcase definition
Oana Feidi
 
Reviews checklists
Oana Feidi
 
Problematriunghiului
Oana Feidi
 
Spice
Oana Feidi
 
Test Management introduction
Oana Feidi
 
Testcase
Oana Feidi
 
Testcase
Oana Feidi
 
Blackbox
Oana Feidi
 
Reviews Checklists
Oana Feidi
 

Recently uploaded (20)

PDF
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
PPTX
Basics and rules of probability with real-life uses
ravatkaran694
 
PDF
The-Invisible-Living-World-Beyond-Our-Naked-Eye chapter 2.pdf/8th science cur...
Sandeep Swamy
 
PPTX
20250924 Navigating the Future: How to tell the difference between an emergen...
McGuinness Institute
 
PPTX
How to Close Subscription in Odoo 18 - Odoo Slides
Celine George
 
PPTX
Introduction to pediatric nursing in 5th Sem..pptx
AneetaSharma15
 
DOCX
SAROCES Action-Plan FOR ARAL PROGRAM IN DEPED
Levenmartlacuna1
 
PPTX
A Smarter Way to Think About Choosing a College
Cyndy McDonald
 
PPTX
Five Point Someone – Chetan Bhagat | Book Summary & Analysis by Bhupesh Kushwaha
Bhupesh Kushwaha
 
PPTX
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Celine George
 
PPTX
CDH. pptx
AneetaSharma15
 
PPTX
Python-Application-in-Drug-Design by R D Jawarkar.pptx
Rahul Jawarkar
 
PPTX
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
PPTX
CARE OF UNCONSCIOUS PATIENTS .pptx
AneetaSharma15
 
PDF
Module 2: Public Health History [Tutorial Slides]
JonathanHallett4
 
PPTX
Artificial-Intelligence-in-Drug-Discovery by R D Jawarkar.pptx
Rahul Jawarkar
 
PPTX
Cleaning Validation Ppt Pharmaceutical validation
Ms. Ashatai Patil
 
PPTX
HEALTH CARE DELIVERY SYSTEM - UNIT 2 - GNM 3RD YEAR.pptx
Priyanshu Anand
 
PPTX
Sonnet 130_ My Mistress’ Eyes Are Nothing Like the Sun By William Shakespear...
DhatriParmar
 
PPTX
Information Texts_Infographic on Forgetting Curve.pptx
Tata Sevilla
 
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
Basics and rules of probability with real-life uses
ravatkaran694
 
The-Invisible-Living-World-Beyond-Our-Naked-Eye chapter 2.pdf/8th science cur...
Sandeep Swamy
 
20250924 Navigating the Future: How to tell the difference between an emergen...
McGuinness Institute
 
How to Close Subscription in Odoo 18 - Odoo Slides
Celine George
 
Introduction to pediatric nursing in 5th Sem..pptx
AneetaSharma15
 
SAROCES Action-Plan FOR ARAL PROGRAM IN DEPED
Levenmartlacuna1
 
A Smarter Way to Think About Choosing a College
Cyndy McDonald
 
Five Point Someone – Chetan Bhagat | Book Summary & Analysis by Bhupesh Kushwaha
Bhupesh Kushwaha
 
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Celine George
 
CDH. pptx
AneetaSharma15
 
Python-Application-in-Drug-Design by R D Jawarkar.pptx
Rahul Jawarkar
 
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
CARE OF UNCONSCIOUS PATIENTS .pptx
AneetaSharma15
 
Module 2: Public Health History [Tutorial Slides]
JonathanHallett4
 
Artificial-Intelligence-in-Drug-Discovery by R D Jawarkar.pptx
Rahul Jawarkar
 
Cleaning Validation Ppt Pharmaceutical validation
Ms. Ashatai Patil
 
HEALTH CARE DELIVERY SYSTEM - UNIT 2 - GNM 3RD YEAR.pptx
Priyanshu Anand
 
Sonnet 130_ My Mistress’ Eyes Are Nothing Like the Sun By William Shakespear...
DhatriParmar
 
Information Texts_Infographic on Forgetting Curve.pptx
Tata Sevilla
 

Whitebox testing

  • 1. SOFTWARE QUALITY ASSURANCE WHITE BOX Seminar: Oana FEIDI Quality Manager – Continental Automotive
  • 2. BLACK-BOX VS. WHITE-BOX  Test cases derived from specifications  The focus is not the design, nor the implementation  The focus is on the logic of implementation
  • 3. WHITE BOX (STRUCTURAL TESTING)  Structural - test case selection is based on an analysis of the internal structure of component  Control flow  Statement testing  Branch/Decision Testing  Branch Condition Testing  Modified Condition Combination Testing  Data flow testing
  • 4. WHITE BOX  Using the white-box testing techniques outlined in this seminar, a software engineer can design test cases that  exercise independent paths within a module or unit;  exercise logical decisions on both their true and false side;  execute loops at their boundaries and within their operational bounds  exercise internal data structures to ensure their validity
  • 5. STATEMENT TESTING  uses a model of the program’s control flow  it is designed in order to execute all or selected statements of the test object Test cases are design to execute each statement. An entity in a programming For each test case specify: language which is typically the smallest indivisible unit of • the input(s) of the component execution. • identification of statement(s) to be executed by the test case • the expected outcome of the test case Test completeness criteria: the percentage of the statements in the software which were executed at least at once (executing a statement means that the statement was encountered and evaluated during testing).
  • 6. EXAMPLE float foo (int a, int b, int c, int d, float e) { float e; if (a == 0) { return 0; } int x = 0; if ((a==b) OR ((c == d) AND bug(a) )) { x=1; } e = 1/x; statement return e; }
  • 7. BRANCH/DECISION TESTING  uses a model of the program’s flow  it is designed in order to execute (each) outcome of all or selected decision points in a test object an executable statement For each test specify: which may transfer control • the input(s) of the component to another statement, depending upon the logic • Identification of decision of the decision statement outcome(s) to be executed by the test case • the expected outcome of the test case Test completeness criteria: achievement of the test coverage – 100% of the branches (one true and one false for each part of condition)
  • 8. EXAMPLE A = true and (B or C) = false  A = false and (B or C) = true if A and (B or C) Case A B C Output 1 0 1 1 0 2 1 0 0 0
  • 9. BRANCH CONDITION COMBINATION  uses a model of the program flow where each combination of the inputs for a decision/condition must be tested, in order to check if each branch is covered  For each test case specify:  the input(s) of the component  the expected outcome of the test case which can show which branch is covered Test completeness criteria: for a condition containing n boolean operands → 2n test cases are required to achieve 100% coverage Note: this coverage rapidly becomes unachievable for more complex conditions.
  • 10. WHITE BOX - SUMMARY  Statement testing  uses a model of the program’s control flow  it is designed in order to execute all or selected statements of the test object  Branch/Decision Testing  uses a model of the program’s flow  it is designed in order to execute (each) outcome of all or selected decision points in a test object  Branch Condition Combination  uses a model of the program flow where each combination of the inputs for a decision/condition must be tested, in order to check if each branch is covered
  • 11. MODIFIED CONDITION COMBINATION TESTING  usesa model of the program’s flow where each atomic condition is independently tested, in order to show how the decision outcome is affected  test case are designed to show that each condition independently affects the decision outcome  For each test case specify:  the input(s) of the component  The expected outcome of the test case
  • 12. MODIFIED CONDITION COMBINATION TESTING  Test completeness criteria  for a condition containing n boolean operands, to achieve 100% coverage are necessary:  minimum: n + 1 test cases  maximum: 2n test cases  Example: for 3 boolean operands, to achieve 100% coverage are necessary:  Minimum 4 test cases  Maximum 6 test cases
  • 13. EXAMPLE Case A B B or C C Outcome 1 1 1 1 0 1 if (A and (B or C)) 2 0 0 3 1 1 1 0 1 4 0 0 0 5 1 0 1 1 1 6 0 0 0
  • 14. LOOP TESTING  Simple Loops:- 'n' is the maximum number of allowable passes  skip the loop entirely.  only one pass thru the loop.  two passes thru the loop.  m passes thru the loop where m< n.  n-1,n,n+1 passes thru the loop  Nested loops  start with the innermost loop. Set all other loop to min. values.  conduct simple loop tests for the innermost loop while holding the outer loops at their min. iteration values.  work outward, conducting tests for the next loop, but keeping all the outer loops at their min. iteration count.  continue until all loops have been tested.
  • 15. EXERCISE  1) Identify what scenarios have to be run to achieve 100% statement coverage and 100% branch coverage on the following code  2) Test the same examples on the following link. Does white-box covers 100% the black-box?