SlideShare ist ein Scribd-Unternehmen logo
1 von 20
Software Testing Technique




                   White Box and Black Box Testing Technique




January 13, 2012      Made By Utpal Ray                        1
Software Testing Technique




                          Testing Objective

 1.      Testing is a process of executing program ( test program ) with an
         intention of finding errors ( bugs ).

 2.      A good test case is one that has a high probability of finding an as-
         yet-undiscovered error.

 3.      A successful test is the one that has uncovered an as-yet-
         undiscovered error.



January 13, 2012       Made By Utpal Ray                                         2
Software Testing Technique

                        Testing Principles

 1.      All tests should be traceable to customer requirements.

 2.      Test planning and test preparation should be planned long before
         testing begins.

 3.      Test case should be designed keeping the ‘Pareto’ principle in mind
         which states that, 80% of all the errors uncovered during the testing
         process are located within the 20% of the program components.

 4.      Exhaustive testing is never possible because of resource ( man-
         power, time, money etc. ) constraints.




January 13, 2012       Made By Utpal Ray                                         3
Software Testing Technique




                   Testability – what it is ?

    How easily a computer program can be tested.

    How adequately a particular set of tests will cover the product.

    How easily the product can be checked and repaired in the field.




January 13, 2012     Made By Utpal Ray                                 4
Software Testing Technique




                         Test Case Design



        Test case should be designed keeping two test situations in mind.
         They are :-

 1.      White Box Testing

 2.      Black Box Testing




January 13, 2012       Made By Utpal Ray                                     5
Software Testing Technique




                       White Box Testing

    This method of testing assumes, the tester has a good knowledge
    about the source code which is under consideration for testing.

    Depending upon the structure of the source code, the test cases are
    designed.

    Each of the test case is supposed to test a unique path through the
    code. This method of testing is also called Basis Path Testing.




January 13, 2012     Made By Utpal Ray                                    6
Software Testing Technique



                    White Box Testing (contd.)

  Let’s take an example program of which we need to design test cases for
    white box testing.

 int find_max ( int a, int b, int c )
 {
   int max;
   if ( a>b ) then max=a;
   else max=b;
   if ( max<c ) then max=c;
   return max;
 }


January 13, 2012      Made By Utpal Ray                                      7
Software Testing Technique
                           White Box Testing (contd.)

                       Flow Chart of the Previous Program

                   1      Declare a,b,c;Define max


                                                    T
                   2                 a>b                    Max = a   3
                                                F

                   4               Max = b



                                                        T
                   5               max<c                     Max=c    6
                                                F

                   7              Return max

January 13, 2012            Made By Utpal Ray                             8
Software Testing Technique

                   White Box Testing (contd.)

                   Cyclomatic Complexity

    Before we proceed to write the test cases we have to know how many
    test cases will be there at the most.

    This can be known by a software metric called ‘Cylomatic Complexity’.
    The Cyclomatic Complexity provides the quantitative measure of
    the logical complexity of a program.

    With regard to white box testing, cyclomatic complexity gives us the
    upper bound for the number of tests that must be conducted to ensure
    that all statements have been executed at least once.



January 13, 2012     Made By Utpal Ray                                      9
Software Testing Technique

                   White Box Testing (contd.)

                   Cyclomatic Complexity

    The Cyclomatic Complexity can be computed by adding one to the
    total number of decision box in the program.

    As for the program mentioned before, there are 2 decision box shown
    in the flow chart. So, the cyclomatic complexity is 2+1=3.

    So, at the most there are three independent path in the program. To
    find out those independent path, we have to convert the flow chart to
    flow graph.




January 13, 2012     Made By Utpal Ray                                      10
Software Testing Technique
                   White Box Testing (contd.)

     Rules for Flow Chart to Flow Graph Conversion

    All the process box and the decision diamond should be numbered in
    the flow chart.

    A decision diamond should map to a node.

    A single process box or a sequence of process box should map to a
    single node.

    A process box and a decision box can be mapped together to a single
    node also.

    The flow should map to a link or edge between the nodes.

    An edge must terminate to a node, even if the node does not represent
    any procedural statement.

January 13, 2012     Made By Utpal Ray                                      11
Software Testing Technique

                       White Box Testing (contd.)

               1,2
                                           An independent path is a path, where
                                           At least one edge has not been traversed
 4                                         Before. With this rule, we get 3 independent
                        3
                                           Path. They are :-
                                           1. 1,2  3  5  7
                                           2. 1,2  4  5  7
                   5
                                           3. 1,2  3  5  6  7

                                           Since, the cyclomatic complexity for this
                        6                  Flow graph is 3; there cannot be more than
                                           3 independent path.
                   7

     Flow Graph


January 13, 2012       Made By Utpal Ray                                             12
Software Testing Technique

                       White Box Testing (contd.)

                   Test Cases for the previous program

    Test Case 1 [ for the path 1 ]
    Input : a>b; a>c
    Expected Output : a

    Test Case 2 [ for the path 2 ]
    Input : b>a; b>c
    Expected Output : b

    Test Case 3 [ for the path 3 ]
    Input : c>a; c>b
    Expected Output : c
January 13, 2012         Made By Utpal Ray               13
Software Testing Technique

                        Black Box Testing

    It is also known as behavioral testing

    It focuses on the functional requirement of the software.

    It is complementary rather then alternative to white box testing.

    Black Box Testing is performed during the later stages of the software
    testing; unlike white box testing which is performed during the early
    stages of software testing.




January 13, 2012     Made By Utpal Ray                                       14
Software Testing Technique

                     Black Box Testing (contd.)

            The reason for doing black box testing

 1.      It uncovers incorrect or missing functions.

 2.      It detects interface errors.

 3.      It can detect internal data structure errors or external data base
         errors.

 4.      It can point out whether performance of the software is below
         the desired level.

 5.      It can spot initialization or termination error.



January 13, 2012       Made By Utpal Ray                                  15
Software Testing Technique


    Black Box Testing (contd.)
   Test Case Design for Black Box Testing
 1. Design test cases in such a way, so that it covers all
     the functional requirements of the software.
 2. Design test cases to test the performance criteria of
     the software.
 3. Design test cases to test the most frequently used
     inputs given by the user.
 4. Design test cases to test the sensitive inputs given by
     the user.




January 13, 2012   Made By Utpal Ray                      16
Software Testing Technique




  Black Box Testing (contd.)
  Test Case Design for Black Box Testing (contd.)
 5. Design test cases to test the boundary condition of the
   software.
 6. Design test cases to test the behavior of the software
   for reasonable amount of negative inputs.
 7. Design test cases to test the maximum load and stress
   capability of the software.
 8. Design test cases to test the security aspects of the
   software.

January 13, 2012   Made By Utpal Ray                      17
Software Testing Technique




  Loop Testing
                                            Testing Technique :-
                                            1. Skip the loop entirely.
                                            2. Only one pass through the loop.
                                            3. Two passes through the loop.
                                            4. If n is the maximum no of allowable
                                               passes through the loop, then m
                                               passes ( m<n ) through the loop.
                                            5. n-1, n, n+1 passes through the loop.
          Simple Loop




January 13, 2012        Made By Utpal Ray                                             18
Software Testing Technique


  Loop Testing ( contd. )


                                Testing Technique :-
                                1. Start at innermost loop. Set all outer loops
                                   to minimum values.
                                2. Conduct simple loop tests for innermost
                                   loop.
                                3. Work outward, conducting tests for the next
                                   loop, but keeping all other outer loops at
                                   minimum values and other nested loops to
                                   typical values.
                                4. Continue until all loops have been tested.

       Nested Loop



January 13, 2012     Made By Utpal Ray                                     19
Software Testing Technique




  Home Task
 A. Design test cases for white box testing for the
    following set of Programs mentioned below.
 1. An array contains n number of integers. Find the
    maximum number from that array.
 2. A program reads 3 integer values. The 3 values
    represents the 3 sides of a triangle. The program prints
    a message telling whether the triangle is scalene,
    isosceles, or equilateral.
 B. Design test cases for black box testing for the program
    shown in the beginning of this class.
January 13, 2012   Made By Utpal Ray                       20

Weitere Àhnliche Inhalte

Was ist angesagt?

Testing techniques
Testing techniquesTesting techniques
Testing techniquesRaginiRohatgi
 
White boxvsblackbox
White boxvsblackboxWhite boxvsblackbox
White boxvsblackboxsanerjjd
 
Black box testing (an introduction to)
Black box testing (an introduction to)Black box testing (an introduction to)
Black box testing (an introduction to)Henry Muccini
 
White box testing-200709
White box testing-200709White box testing-200709
White box testing-200709pragati3009
 
Black box testing
Black box testingBlack box testing
Black box testingNakul Sharma
 
White Box testing by Pankaj Thakur, NITTTR Chandigarh
White Box testing by Pankaj Thakur, NITTTR ChandigarhWhite Box testing by Pankaj Thakur, NITTTR Chandigarh
White Box testing by Pankaj Thakur, NITTTR ChandigarhPankaj Thakur
 
Dynamic analysis in Software Testing
Dynamic analysis in Software TestingDynamic analysis in Software Testing
Dynamic analysis in Software TestingSagar Pednekar
 
Black box testing
Black box testingBlack box testing
Black box testingAbdul Basit
 
Testing, black ,white and gray box testing
Testing, black ,white and gray box testingTesting, black ,white and gray box testing
Testing, black ,white and gray box testingAamir Shakir
 
White Box Testing
White Box TestingWhite Box Testing
White Box TestingAlisha Roy
 
Black Box Testing Techniques by Sampath M
Black Box Testing Techniques by Sampath MBlack Box Testing Techniques by Sampath M
Black Box Testing Techniques by Sampath MForziatech
 
Black box software testing
Black box software testingBlack box software testing
Black box software testingRana Muhammad Asif
 
Black Box Testing
Black Box TestingBlack Box Testing
Black Box TestingTestbytes
 
Whitebox testing
Whitebox testingWhitebox testing
Whitebox testingOana Feidi
 
WHITE BOX & BLACK BOX TESTING IN DATABASE
WHITE BOX & BLACK BOXTESTING IN DATABASEWHITE BOX & BLACK BOXTESTING IN DATABASE
WHITE BOX & BLACK BOX TESTING IN DATABASESalman Memon
 

Was ist angesagt? (20)

Testing techniques
Testing techniquesTesting techniques
Testing techniques
 
White boxvsblackbox
White boxvsblackboxWhite boxvsblackbox
White boxvsblackbox
 
Black box testing (an introduction to)
Black box testing (an introduction to)Black box testing (an introduction to)
Black box testing (an introduction to)
 
White box testing-200709
White box testing-200709White box testing-200709
White box testing-200709
 
Black box testing
Black box testingBlack box testing
Black box testing
 
Black Box Testing
Black Box TestingBlack Box Testing
Black Box Testing
 
White box testing
White box testingWhite box testing
White box testing
 
White Box testing by Pankaj Thakur, NITTTR Chandigarh
White Box testing by Pankaj Thakur, NITTTR ChandigarhWhite Box testing by Pankaj Thakur, NITTTR Chandigarh
White Box testing by Pankaj Thakur, NITTTR Chandigarh
 
Dynamic analysis in Software Testing
Dynamic analysis in Software TestingDynamic analysis in Software Testing
Dynamic analysis in Software Testing
 
Black box testing
Black box testingBlack box testing
Black box testing
 
Testing, black ,white and gray box testing
Testing, black ,white and gray box testingTesting, black ,white and gray box testing
Testing, black ,white and gray box testing
 
White Box Testing
White Box TestingWhite Box Testing
White Box Testing
 
Black Box Testing Techniques by Sampath M
Black Box Testing Techniques by Sampath MBlack Box Testing Techniques by Sampath M
Black Box Testing Techniques by Sampath M
 
Black box software testing
Black box software testingBlack box software testing
Black box software testing
 
Black Box Testing
Black Box TestingBlack Box Testing
Black Box Testing
 
Whitebox testing
Whitebox testingWhitebox testing
Whitebox testing
 
White box ppt
White box pptWhite box ppt
White box ppt
 
Black Box Testing
Black Box TestingBlack Box Testing
Black Box Testing
 
White Box Testing V0.2
White Box Testing V0.2White Box Testing V0.2
White Box Testing V0.2
 
WHITE BOX & BLACK BOX TESTING IN DATABASE
WHITE BOX & BLACK BOXTESTING IN DATABASEWHITE BOX & BLACK BOXTESTING IN DATABASE
WHITE BOX & BLACK BOX TESTING IN DATABASE
 

Andere mochten auch

Andere mochten auch (8)

Software Development Techniques
Software Development TechniquesSoftware Development Techniques
Software Development Techniques
 
Testing types 2
Testing types 2Testing types 2
Testing types 2
 
Blackbox
BlackboxBlackbox
Blackbox
 
sdt
sdtsdt
sdt
 
Notes on sdt methods
Notes on sdt methodsNotes on sdt methods
Notes on sdt methods
 
Information systems development methodologies
Information systems development methodologiesInformation systems development methodologies
Information systems development methodologies
 
Software testing methods, levels and types
Software testing methods, levels and typesSoftware testing methods, levels and types
Software testing methods, levels and types
 
Research proposal sample
Research proposal sampleResearch proposal sample
Research proposal sample
 

Ähnlich wie 10 software testing_technique

Software Testing Tecniques
Software Testing TecniquesSoftware Testing Tecniques
Software Testing Tecniquesersanbilik
 
Chapter 8 Testing Tactics.ppt Software engineering
Chapter 8 Testing Tactics.ppt Software engineeringChapter 8 Testing Tactics.ppt Software engineering
Chapter 8 Testing Tactics.ppt Software engineeringAnasHassan52
 
Chapter 8 Testing Tactics.ppt
Chapter 8 Testing Tactics.pptChapter 8 Testing Tactics.ppt
Chapter 8 Testing Tactics.pptVijayaPratapReddyM
 
White box
White boxWhite box
White boxsephalika
 
Software testing definition
Software testing definitionSoftware testing definition
Software testing definitionHiro Mia
 
Artificial intelligence in qa
Artificial intelligence in qaArtificial intelligence in qa
Artificial intelligence in qaTaras Lytvyn
 
Introduzione allo Unit Testing
Introduzione allo Unit TestingIntroduzione allo Unit Testing
Introduzione allo Unit TestingStefano Ottaviani
 
Software testing methods
Software testing methodsSoftware testing methods
Software testing methodsHoma Pourmohammadi
 
SE UNIT 5 part 2 (1).pptx
SE UNIT 5 part 2 (1).pptxSE UNIT 5 part 2 (1).pptx
SE UNIT 5 part 2 (1).pptxPraneethBhai1
 
Quality Assurance
Quality AssuranceQuality Assurance
Quality AssuranceKiran Kumar
 
Week1 programming challenges
Week1 programming challengesWeek1 programming challenges
Week1 programming challengesDhanu Srikar
 
Testing
TestingTesting
TestingMohammed
 
Software Testing - Day One
Software Testing - Day OneSoftware Testing - Day One
Software Testing - Day OneGovardhan Reddy
 
Software testing ari force institute of tech.
Software testing ari force institute of tech.Software testing ari force institute of tech.
Software testing ari force institute of tech.Sanjith Ml
 
The Art Of Debugging
The Art Of DebuggingThe Art Of Debugging
The Art Of Debuggingsvilen.ivanov
 

Ähnlich wie 10 software testing_technique (20)

Software Testing Tecniques
Software Testing TecniquesSoftware Testing Tecniques
Software Testing Tecniques
 
Chapter 8 Testing Tactics.ppt Software engineering
Chapter 8 Testing Tactics.ppt Software engineeringChapter 8 Testing Tactics.ppt Software engineering
Chapter 8 Testing Tactics.ppt Software engineering
 
Chapter 8 Testing Tactics.ppt
Chapter 8 Testing Tactics.pptChapter 8 Testing Tactics.ppt
Chapter 8 Testing Tactics.ppt
 
White box
White boxWhite box
White box
 
White box
White boxWhite box
White box
 
Testing
TestingTesting
Testing
 
Paper 06
Paper 06Paper 06
Paper 06
 
Software testing definition
Software testing definitionSoftware testing definition
Software testing definition
 
midterm_fa07.pdf
midterm_fa07.pdfmidterm_fa07.pdf
midterm_fa07.pdf
 
Artificial intelligence in qa
Artificial intelligence in qaArtificial intelligence in qa
Artificial intelligence in qa
 
Introduzione allo Unit Testing
Introduzione allo Unit TestingIntroduzione allo Unit Testing
Introduzione allo Unit Testing
 
Testing
TestingTesting
Testing
 
Software testing methods
Software testing methodsSoftware testing methods
Software testing methods
 
SE UNIT 5 part 2 (1).pptx
SE UNIT 5 part 2 (1).pptxSE UNIT 5 part 2 (1).pptx
SE UNIT 5 part 2 (1).pptx
 
Quality Assurance
Quality AssuranceQuality Assurance
Quality Assurance
 
Week1 programming challenges
Week1 programming challengesWeek1 programming challenges
Week1 programming challenges
 
Testing
TestingTesting
Testing
 
Software Testing - Day One
Software Testing - Day OneSoftware Testing - Day One
Software Testing - Day One
 
Software testing ari force institute of tech.
Software testing ari force institute of tech.Software testing ari force institute of tech.
Software testing ari force institute of tech.
 
The Art Of Debugging
The Art Of DebuggingThe Art Of Debugging
The Art Of Debugging
 

Mehr von University of Computer Science and Technology

Mehr von University of Computer Science and Technology (20)

Real time-embedded-system-lec-02
Real time-embedded-system-lec-02Real time-embedded-system-lec-02
Real time-embedded-system-lec-02
 
Real time-embedded-system-lec-06
Real time-embedded-system-lec-06Real time-embedded-system-lec-06
Real time-embedded-system-lec-06
 
Real time-embedded-system-lec-05
Real time-embedded-system-lec-05Real time-embedded-system-lec-05
Real time-embedded-system-lec-05
 
Real time-embedded-system-lec-04
Real time-embedded-system-lec-04Real time-embedded-system-lec-04
Real time-embedded-system-lec-04
 
Real time-embedded-system-lec-03
Real time-embedded-system-lec-03Real time-embedded-system-lec-03
Real time-embedded-system-lec-03
 
Real time-embedded-system-lec-02
Real time-embedded-system-lec-02Real time-embedded-system-lec-02
Real time-embedded-system-lec-02
 
Real time-embedded-system-lec-07
Real time-embedded-system-lec-07Real time-embedded-system-lec-07
Real time-embedded-system-lec-07
 
12 software maintenance
12 software maintenance12 software maintenance
12 software maintenance
 
11 software testing_strategy
11 software testing_strategy11 software testing_strategy
11 software testing_strategy
 
09 coding standards_n_guidelines
09 coding standards_n_guidelines09 coding standards_n_guidelines
09 coding standards_n_guidelines
 
08 component level_design
08 component level_design08 component level_design
08 component level_design
 
07 interface design
07 interface design07 interface design
07 interface design
 
06 architectural design_workout
06 architectural design_workout06 architectural design_workout
06 architectural design_workout
 
05 architectural design
05 architectural design05 architectural design
05 architectural design
 
04 design concepts_n_principles
04 design concepts_n_principles04 design concepts_n_principles
04 design concepts_n_principles
 
03 requirement engineering_process
03 requirement engineering_process03 requirement engineering_process
03 requirement engineering_process
 
02 software process_models
02 software process_models02 software process_models
02 software process_models
 
01 software engineering_aspects
01 software engineering_aspects01 software engineering_aspects
01 software engineering_aspects
 
14 software technical_metrics
14 software technical_metrics14 software technical_metrics
14 software technical_metrics
 
13 software metrics
13 software metrics13 software metrics
13 software metrics
 

KĂŒrzlich hochgeladen

Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
Visit to a blind student's school🧑‍🩯🧑‍🩯(community medicine)
Visit to a blind student's school🧑‍🩯🧑‍🩯(community medicine)Visit to a blind student's school🧑‍🩯🧑‍🩯(community medicine)
Visit to a blind student's school🧑‍🩯🧑‍🩯(community medicine)lakshayb543
 

KĂŒrzlich hochgeladen (20)

Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
Visit to a blind student's school🧑‍🩯🧑‍🩯(community medicine)
Visit to a blind student's school🧑‍🩯🧑‍🩯(community medicine)Visit to a blind student's school🧑‍🩯🧑‍🩯(community medicine)
Visit to a blind student's school🧑‍🩯🧑‍🩯(community medicine)
 

10 software testing_technique

  • 1. Software Testing Technique White Box and Black Box Testing Technique January 13, 2012 Made By Utpal Ray 1
  • 2. Software Testing Technique Testing Objective 1. Testing is a process of executing program ( test program ) with an intention of finding errors ( bugs ). 2. A good test case is one that has a high probability of finding an as- yet-undiscovered error. 3. A successful test is the one that has uncovered an as-yet- undiscovered error. January 13, 2012 Made By Utpal Ray 2
  • 3. Software Testing Technique Testing Principles 1. All tests should be traceable to customer requirements. 2. Test planning and test preparation should be planned long before testing begins. 3. Test case should be designed keeping the ‘Pareto’ principle in mind which states that, 80% of all the errors uncovered during the testing process are located within the 20% of the program components. 4. Exhaustive testing is never possible because of resource ( man- power, time, money etc. ) constraints. January 13, 2012 Made By Utpal Ray 3
  • 4. Software Testing Technique Testability – what it is ? How easily a computer program can be tested. How adequately a particular set of tests will cover the product. How easily the product can be checked and repaired in the field. January 13, 2012 Made By Utpal Ray 4
  • 5. Software Testing Technique Test Case Design  Test case should be designed keeping two test situations in mind. They are :- 1. White Box Testing 2. Black Box Testing January 13, 2012 Made By Utpal Ray 5
  • 6. Software Testing Technique White Box Testing This method of testing assumes, the tester has a good knowledge about the source code which is under consideration for testing. Depending upon the structure of the source code, the test cases are designed. Each of the test case is supposed to test a unique path through the code. This method of testing is also called Basis Path Testing. January 13, 2012 Made By Utpal Ray 6
  • 7. Software Testing Technique White Box Testing (contd.)  Let’s take an example program of which we need to design test cases for white box testing. int find_max ( int a, int b, int c ) { int max; if ( a>b ) then max=a; else max=b; if ( max<c ) then max=c; return max; } January 13, 2012 Made By Utpal Ray 7
  • 8. Software Testing Technique White Box Testing (contd.) Flow Chart of the Previous Program 1 Declare a,b,c;Define max T 2 a>b Max = a 3 F 4 Max = b T 5 max<c Max=c 6 F 7 Return max January 13, 2012 Made By Utpal Ray 8
  • 9. Software Testing Technique White Box Testing (contd.) Cyclomatic Complexity Before we proceed to write the test cases we have to know how many test cases will be there at the most. This can be known by a software metric called ‘Cylomatic Complexity’. The Cyclomatic Complexity provides the quantitative measure of the logical complexity of a program. With regard to white box testing, cyclomatic complexity gives us the upper bound for the number of tests that must be conducted to ensure that all statements have been executed at least once. January 13, 2012 Made By Utpal Ray 9
  • 10. Software Testing Technique White Box Testing (contd.) Cyclomatic Complexity The Cyclomatic Complexity can be computed by adding one to the total number of decision box in the program. As for the program mentioned before, there are 2 decision box shown in the flow chart. So, the cyclomatic complexity is 2+1=3. So, at the most there are three independent path in the program. To find out those independent path, we have to convert the flow chart to flow graph. January 13, 2012 Made By Utpal Ray 10
  • 11. Software Testing Technique White Box Testing (contd.) Rules for Flow Chart to Flow Graph Conversion All the process box and the decision diamond should be numbered in the flow chart. A decision diamond should map to a node. A single process box or a sequence of process box should map to a single node. A process box and a decision box can be mapped together to a single node also. The flow should map to a link or edge between the nodes. An edge must terminate to a node, even if the node does not represent any procedural statement. January 13, 2012 Made By Utpal Ray 11
  • 12. Software Testing Technique White Box Testing (contd.) 1,2 An independent path is a path, where At least one edge has not been traversed 4 Before. With this rule, we get 3 independent 3 Path. They are :- 1. 1,2  3  5  7 2. 1,2  4  5  7 5 3. 1,2  3  5  6  7 Since, the cyclomatic complexity for this 6 Flow graph is 3; there cannot be more than 3 independent path. 7 Flow Graph January 13, 2012 Made By Utpal Ray 12
  • 13. Software Testing Technique White Box Testing (contd.) Test Cases for the previous program Test Case 1 [ for the path 1 ] Input : a>b; a>c Expected Output : a Test Case 2 [ for the path 2 ] Input : b>a; b>c Expected Output : b Test Case 3 [ for the path 3 ] Input : c>a; c>b Expected Output : c January 13, 2012 Made By Utpal Ray 13
  • 14. Software Testing Technique Black Box Testing It is also known as behavioral testing It focuses on the functional requirement of the software. It is complementary rather then alternative to white box testing. Black Box Testing is performed during the later stages of the software testing; unlike white box testing which is performed during the early stages of software testing. January 13, 2012 Made By Utpal Ray 14
  • 15. Software Testing Technique Black Box Testing (contd.) The reason for doing black box testing 1. It uncovers incorrect or missing functions. 2. It detects interface errors. 3. It can detect internal data structure errors or external data base errors. 4. It can point out whether performance of the software is below the desired level. 5. It can spot initialization or termination error. January 13, 2012 Made By Utpal Ray 15
  • 16. Software Testing Technique  Black Box Testing (contd.) Test Case Design for Black Box Testing 1. Design test cases in such a way, so that it covers all the functional requirements of the software. 2. Design test cases to test the performance criteria of the software. 3. Design test cases to test the most frequently used inputs given by the user. 4. Design test cases to test the sensitive inputs given by the user. January 13, 2012 Made By Utpal Ray 16
  • 17. Software Testing Technique  Black Box Testing (contd.) Test Case Design for Black Box Testing (contd.) 5. Design test cases to test the boundary condition of the software. 6. Design test cases to test the behavior of the software for reasonable amount of negative inputs. 7. Design test cases to test the maximum load and stress capability of the software. 8. Design test cases to test the security aspects of the software. January 13, 2012 Made By Utpal Ray 17
  • 18. Software Testing Technique  Loop Testing Testing Technique :- 1. Skip the loop entirely. 2. Only one pass through the loop. 3. Two passes through the loop. 4. If n is the maximum no of allowable passes through the loop, then m passes ( m<n ) through the loop. 5. n-1, n, n+1 passes through the loop. Simple Loop January 13, 2012 Made By Utpal Ray 18
  • 19. Software Testing Technique  Loop Testing ( contd. ) Testing Technique :- 1. Start at innermost loop. Set all outer loops to minimum values. 2. Conduct simple loop tests for innermost loop. 3. Work outward, conducting tests for the next loop, but keeping all other outer loops at minimum values and other nested loops to typical values. 4. Continue until all loops have been tested. Nested Loop January 13, 2012 Made By Utpal Ray 19
  • 20. Software Testing Technique  Home Task A. Design test cases for white box testing for the following set of Programs mentioned below. 1. An array contains n number of integers. Find the maximum number from that array. 2. A program reads 3 integer values. The 3 values represents the 3 sides of a triangle. The program prints a message telling whether the triangle is scalene, isosceles, or equilateral. B. Design test cases for black box testing for the program shown in the beginning of this class. January 13, 2012 Made By Utpal Ray 20