SlideShare ist ein Scribd-Unternehmen logo
1 von 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?

Weitere ähnliche Inhalte

Was ist angesagt?

Software testing methods, levels and types
Software testing methods, levels and typesSoftware testing methods, levels and types
Software testing methods, levels and typesConfiz
 
STLC (Software Testing Life Cycle)
STLC (Software Testing Life Cycle)STLC (Software Testing Life Cycle)
STLC (Software Testing Life Cycle)Ch Fahadi
 
Types of software testing
Types of software testingTypes of software testing
Types of software testingPrachi Sasankar
 
Software Testing 101
Software Testing 101Software Testing 101
Software Testing 101QA Hannah
 
Manual testing concepts course 1
Manual testing concepts course 1Manual testing concepts course 1
Manual testing concepts course 1Raghu Kiran
 
Software Testing Life Cycle (STLC) | Software Testing Tutorial | Edureka
Software Testing Life Cycle (STLC) | Software Testing Tutorial | EdurekaSoftware Testing Life Cycle (STLC) | Software Testing Tutorial | Edureka
Software Testing Life Cycle (STLC) | Software Testing Tutorial | EdurekaEdureka!
 
Types of Software Testing | Edureka
Types of Software Testing | EdurekaTypes of Software Testing | Edureka
Types of Software Testing | EdurekaEdureka!
 
What is Integration Testing? | Edureka
What is Integration Testing? | EdurekaWhat is Integration Testing? | Edureka
What is Integration Testing? | EdurekaEdureka!
 
Software Testing Fundamentals
Software Testing FundamentalsSoftware Testing Fundamentals
Software Testing FundamentalsChankey Pathak
 
Software Testing Technique in Software Engineering
Software Testing Technique in Software EngineeringSoftware Testing Technique in Software Engineering
Software Testing Technique in Software EngineeringIsmail Hussain
 
UNIT TESTING PPT
UNIT TESTING PPTUNIT TESTING PPT
UNIT TESTING PPTsuhasreddy1
 

Was ist angesagt? (20)

3.software testing
3.software testing3.software testing
3.software testing
 
Black box software testing
Black box software testingBlack box software testing
Black box software testing
 
White box ppt
White box pptWhite box ppt
White box ppt
 
Software testing methods, levels and types
Software testing methods, levels and typesSoftware testing methods, levels and types
Software testing methods, levels and types
 
STLC (Software Testing Life Cycle)
STLC (Software Testing Life Cycle)STLC (Software Testing Life Cycle)
STLC (Software Testing Life Cycle)
 
Static Testing
Static TestingStatic Testing
Static Testing
 
Types of software testing
Types of software testingTypes of software testing
Types of software testing
 
Software testing
Software testing Software testing
Software testing
 
Software Testing 101
Software Testing 101Software Testing 101
Software Testing 101
 
Manual testing concepts course 1
Manual testing concepts course 1Manual testing concepts course 1
Manual testing concepts course 1
 
Types of testing
Types of testingTypes of testing
Types of testing
 
Software Testing Life Cycle (STLC) | Software Testing Tutorial | Edureka
Software Testing Life Cycle (STLC) | Software Testing Tutorial | EdurekaSoftware Testing Life Cycle (STLC) | Software Testing Tutorial | Edureka
Software Testing Life Cycle (STLC) | Software Testing Tutorial | Edureka
 
Manual testing
Manual testingManual testing
Manual testing
 
Types of Software Testing | Edureka
Types of Software Testing | EdurekaTypes of Software Testing | Edureka
Types of Software Testing | Edureka
 
What is Integration Testing? | Edureka
What is Integration Testing? | EdurekaWhat is Integration Testing? | Edureka
What is Integration Testing? | Edureka
 
White box testing
White box testingWhite box testing
White box testing
 
Software Testing Fundamentals
Software Testing FundamentalsSoftware Testing Fundamentals
Software Testing Fundamentals
 
Types of testing
Types of testingTypes of testing
Types of testing
 
Software Testing Technique in Software Engineering
Software Testing Technique in Software EngineeringSoftware Testing Technique in Software Engineering
Software Testing Technique in Software Engineering
 
UNIT TESTING PPT
UNIT TESTING PPTUNIT TESTING PPT
UNIT TESTING PPT
 

Ähnlich wie 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
 

Ähnlich wie 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
 
Testing
TestingTesting
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
 

Mehr von Oana Feidi

Mehr von 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
 

Kürzlich hochgeladen

microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxAmita Gupta
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
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
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxcallscotland1987
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
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
 
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
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxdhanalakshmis0310
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 

Kürzlich hochgeladen (20)

microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
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
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
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
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
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...
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
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Ữ Â...
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 

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?