SlideShare une entreprise Scribd logo
1  sur  15
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?

Contenu connexe

Tendances

Tendances (20)

Unit testing
Unit testing Unit testing
Unit testing
 
Basic software-testing-concepts
Basic software-testing-conceptsBasic software-testing-concepts
Basic software-testing-concepts
 
SOFTWARE TESTING
SOFTWARE TESTINGSOFTWARE TESTING
SOFTWARE TESTING
 
Types of testing
Types of testingTypes of testing
Types of testing
 
Black Box Testing
Black Box TestingBlack Box Testing
Black Box Testing
 
Software test life cycle
Software test life cycleSoftware test life cycle
Software test life cycle
 
White Box Testing
White Box Testing White Box Testing
White Box Testing
 
Se (techniques for black box testing ppt)
Se (techniques for black box testing ppt)Se (techniques for black box testing ppt)
Se (techniques for black box testing ppt)
 
Black box software testing
Black box software testingBlack box software testing
Black box software testing
 
Software Testing Life Cycle – A Beginner’s Guide
Software Testing Life Cycle – A Beginner’s GuideSoftware Testing Life Cycle – A Beginner’s Guide
Software Testing Life Cycle – A Beginner’s Guide
 
Types of software testing
Types of software testingTypes of software testing
Types of 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
 
Testing concepts ppt
Testing concepts pptTesting concepts ppt
Testing concepts ppt
 
Test Case Design
Test Case DesignTest Case Design
Test Case Design
 
Testing methodology
Testing methodologyTesting methodology
Testing methodology
 
Static Testing
Static TestingStatic Testing
Static Testing
 
Software testing methods, levels and types
Software testing methods, levels and typesSoftware testing methods, levels and types
Software testing methods, levels and types
 
Black & White Box testing
Black & White Box testingBlack & White Box testing
Black & White Box testing
 

Similaire à Whitebox testing

White Box Testing And Control Flow & Loop Testing
White Box Testing And Control Flow & Loop TestingWhite Box Testing And Control Flow & Loop Testing
White Box Testing And Control Flow & Loop TestingAnkit Mulani
 
ScioTalks | Coverage Based Testing
ScioTalks | Coverage Based TestingScioTalks | Coverage Based Testing
ScioTalks | Coverage Based TestingScio Consulting
 
1414_lecturueueueueuueueeueueueuusuee_7.ppt
1414_lecturueueueueuueueeueueueuusuee_7.ppt1414_lecturueueueueuueueeueueueuusuee_7.ppt
1414_lecturueueueueuueueeueueueuusuee_7.pptabdulbasetalselwi
 
Black Box Test Design Techniques
Black Box Test Design TechniquesBlack Box Test Design Techniques
Black Box Test Design TechniquesGlobalLogic Ukraine
 
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
 
CS8494 SOFTWARE ENGINEERING Unit-4
CS8494 SOFTWARE ENGINEERING Unit-4CS8494 SOFTWARE ENGINEERING Unit-4
CS8494 SOFTWARE ENGINEERING Unit-4SIMONTHOMAS S
 
20050314 specification based regression test selection with risk analysis
20050314 specification based regression test selection with risk analysis20050314 specification based regression test selection with risk analysis
20050314 specification based regression test selection with risk analysisWill Shen
 
Black Box Testing.pdf
Black Box Testing.pdfBlack Box Testing.pdf
Black Box Testing.pdfSupunLakshan4
 
White-box testing.pptx
White-box testing.pptxWhite-box testing.pptx
White-box testing.pptxhalaalz3by
 
Software Testing Tecniques
Software Testing TecniquesSoftware Testing Tecniques
Software Testing Tecniquesersanbilik
 
Unit testingandcontinousintegrationfreenest1dot4
Unit testingandcontinousintegrationfreenest1dot4Unit testingandcontinousintegrationfreenest1dot4
Unit testingandcontinousintegrationfreenest1dot4JAMK
 
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
 

Similaire à Whitebox testing (20)

Whitebox
WhiteboxWhitebox
Whitebox
 
White Box Testing And Control Flow & Loop Testing
White Box Testing And Control Flow & Loop TestingWhite Box Testing And Control Flow & Loop Testing
White Box Testing And Control Flow & Loop Testing
 
ScioTalks | Coverage Based Testing
ScioTalks | Coverage Based TestingScioTalks | Coverage Based Testing
ScioTalks | Coverage Based Testing
 
system verilog
system verilogsystem verilog
system verilog
 
white box testing.ppt
white box testing.pptwhite box testing.ppt
white box testing.ppt
 
Testing
TestingTesting
Testing
 
11 whiteboxtesting
11 whiteboxtesting11 whiteboxtesting
11 whiteboxtesting
 
1414_lecturueueueueuueueeueueueuusuee_7.ppt
1414_lecturueueueueuueueeueueueuusuee_7.ppt1414_lecturueueueueuueueeueueueuusuee_7.ppt
1414_lecturueueueueuueueeueueueuusuee_7.ppt
 
Black Box Test Design Techniques
Black Box Test Design TechniquesBlack Box Test Design Techniques
Black Box Test Design Techniques
 
Lesson 2....PPT 1
Lesson 2....PPT 1Lesson 2....PPT 1
Lesson 2....PPT 1
 
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
 
Testing part 2 bb
Testing part 2 bbTesting part 2 bb
Testing part 2 bb
 
CS8494 SOFTWARE ENGINEERING Unit-4
CS8494 SOFTWARE ENGINEERING Unit-4CS8494 SOFTWARE ENGINEERING Unit-4
CS8494 SOFTWARE ENGINEERING Unit-4
 
20050314 specification based regression test selection with risk analysis
20050314 specification based regression test selection with risk analysis20050314 specification based regression test selection with risk analysis
20050314 specification based regression test selection with risk analysis
 
Black Box Testing.pdf
Black Box Testing.pdfBlack Box Testing.pdf
Black Box Testing.pdf
 
White-box testing.pptx
White-box testing.pptxWhite-box testing.pptx
White-box testing.pptx
 
Software Testing Tecniques
Software Testing TecniquesSoftware Testing Tecniques
Software Testing Tecniques
 
SWE-6 TESTING.pptx
SWE-6 TESTING.pptxSWE-6 TESTING.pptx
SWE-6 TESTING.pptx
 
Unit testingandcontinousintegrationfreenest1dot4
Unit testingandcontinousintegrationfreenest1dot4Unit testingandcontinousintegrationfreenest1dot4
Unit testingandcontinousintegrationfreenest1dot4
 
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
 

Plus de Oana Feidi

Plus de Oana Feidi (18)

Test management
Test managementTest management
Test management
 
Spice
SpiceSpice
Spice
 
Root cause analysis
Root cause analysisRoot cause analysis
Root cause analysis
 
Testcase definition
Testcase definitionTestcase definition
Testcase definition
 
Test techniques
Test techniquesTest techniques
Test techniques
 
Reviews checklists
Reviews checklistsReviews checklists
Reviews checklists
 
Spice
SpiceSpice
Spice
 
Test management
Test managementTest management
Test management
 
Blackbox
BlackboxBlackbox
Blackbox
 
Testcase definition
Testcase definitionTestcase definition
Testcase definition
 
Reviews checklists
Reviews checklistsReviews checklists
Reviews checklists
 
Problematriunghiului
ProblematriunghiuluiProblematriunghiului
Problematriunghiului
 
Spice
SpiceSpice
Spice
 
Test Management introduction
Test Management introductionTest Management introduction
Test Management introduction
 
Testcase
TestcaseTestcase
Testcase
 
Testcase
TestcaseTestcase
Testcase
 
Blackbox
BlackboxBlackbox
Blackbox
 
Reviews Checklists
Reviews ChecklistsReviews Checklists
Reviews Checklists
 

Dernier

SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 

Dernier (20)

SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 

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?