BLACK B0X TESTING AND WHITE BOX TESTING IN SOFTWARE ENGINEERING
BLACK Box TESTING
 It is defined as a testing technique in which functionality of
 the Application Under Test (AUT) is tested without looking at
 the internal code structure, implementation details and
 knowledge of internal paths of the software.
 This type of testing is based entirely on software requirements
 and specifications.
  It is focus on inputs and output of the software system
 without bothering about internal knowledge of the software
 program.
        Input                                             Output
                             Black Box                                        2
         BLACK B0X TESTING AND WHITE BOX TESTING IN SOFTWARE ENGINEERING
>The above Black-Box can be any software system youwant to
test.
> For Example, an operating system like Windows, a website
like Google, a database like Oracle or even your own custom
application.
                                                                           3
             BLACK B0X TESTING AND WHTE BOX TESTING IN SOFTWARE ENGINEERING
     Steps Involved In Black Box Testing:
1     Initially, the requirements and specifications of the system are
      examined.
2.    Tester chooses valid inputs (positive test scenario) to check
      whether SUT processes them correctly. Also, some invalid inputs
      (negative test scenario) are chosen to verify that the SUT is able to
      detect them.
3
      Tester determines expected outputs for all those inputs.
4     Software tester constructs test cases with the selected inputs.
5     The test cases are executed.
6.    Software tester compares the actual outputs vith the expected
      outputs.
                                                                              4
7.    Defects if any are fixed and re-tested.
           BLACK B0X TESTING AND WHITE BOX TESTING IN SOFTWARE ENGINEERING
Types of Black Box Testing
1.   Functional testing - This black box testing type is related to the
     functional requirements of a system; it is done by software testers.
2.   Non-functional testing - This type of black box testing is not
     related to testing of specific functionality, but non-functional
     requirements such as performance, scalability, usability.
3.   Regression testing - Regression Testing is done after code fixes,
     upgrades or any other system maintenance to check the new code
     has not affected the existing code.
                                                                             5
           BLACKB0X TESTING AND WHITE BOX TESTING IN SOFTWARE ENGINEERING
Black Box Testing Techniques
1. Equivalence Class Testing:
  Equivalence partitioning is a technique of software testing in which
  input data is divided into partitions of valid and invalid values.
  It helps to reduce the time of testing due to asmaller number of test
  cases from infinite to finite.
º It is applicable at all levels of the testing process.
               Example: 0TP Number =6 digits
                                                                            6
              BLACK B0X TESTING AND WHITE BOX TESTING IN SOFTWARE ENGINEERING
Example: OTP Number =6 digits
               Enter OTP Number                 INVALID       INVALID       VALID       VALID
                                                1Test case   2Test case   3Test case
          Enter Six Diglt 0TP Number
                                               DIGITS >=7    DIGITS<=5    DIGITS =6    DIGITS =6
       Back                       Submit       93847262        9845        456234       451483
          BLACK B0X TESTING AND WHITE BOX TESTING IN SOFTWARE ENGINEERING
2.Boundary Value Testing:
  Boundary value testing is focused on the values at boundaries.
   This technique determines whether a certain range of values are
  acceptable by the system or not.
º It is very useful in reducing the number of test cases.
  It is most suitable for the systems where an input is within certain
  ranges.
                BLACK BOX TESTING AND WHITE BOX TESTING IN SOFTWARE ENGINEERING
Example for Boundary Value Testing
                            Nane               Enter Your Name
                                               Between 18 to 30
                            Age
                           Adhar              Number of 12 Digits
                           Address            Enter Your Address
     12    14    15   16   17   18   20 22 24 25 26 28         30 31    32    34 36   38 40
                                                                  -
     Invalid Partition                Valid Partition                 Invalid Partition
           Invalid test cases            Valid test cases                    Invalid test cases
          11, 13, 14, 15, 16, 17       18, 19, 24, 27, 28, 3O            31, 32, 36, 37, 38, 39
           BLACK B0X TESTING AND WHITE BOX TESTING IN SOFTWARE ENGINEERING
3. Decision Table Testing:
  This is a systematic approach where various input combinations and
  their respective system behavior are captured in a tabular form.
   It is also known as a cause-effect table.
o This technique is used to pick the test cases in a systematic manner.
o It saves the testing time and gives good coverage to the testing area
  of the software application.
                                                                             10
             BLACK B0X TESTING AND WHTE BOX TESTING IN SOFTWARE ENGINEERING
Example for Decision Table Testing:
  Email (condition1)                            T                F            F
 Password (condition2)        T                 F               T             F
Expected Result (Action) Account Page Incorrect password| Incorrect |Incorrect email
                                                              email
                                                                                       11
         BLACK B0X TESTING AND WHITE BOX TESTING IN SOFTWARE ENGINEERING
WHITE BOx TESTING
 White box testing is also known as Clear Box testing, Open
 Box testing, Structural testing, Transparent Box testing, Code
 Based testing, and Glass Box testing.
 The primary goal of white box testing is to focus on the flow
 of inputs and outputs through the software and strengthening
 the security of the software.
           Test Case
            Input                Application Code
                                                          Test Case
                                                          Output
                                                                           12
           BLACK B0X TESTING AND WHTE BOX TESTING IN SOFTWARE ENGINEERING
White Box Testing Techniques:
1.Statement Coverage
º In this technique, the aim is to traverse all statements at least
  once. Hence, each line of code is tested.
  In the case of a flowchart, every node must be traversed at
  least once. Since all lines of code are covered, it helps in
  pointing out faulty code.
                                                                            13
           BLACK B0X TESTING AND WHITE BOX TESTING IN SOFTWARE ENGINEERING
2. Branch Coverage:
  In this technique, test cases are designed so that each branch
  from all decision points is traversed at least once.
   In a flowchart, alledges must be traversed at least once.
                                               Tent
                                                                             14
            BLACK B0X TESTING AND WHITE BOX TESTING IN SOFTWARE ENGINEERING
3. Condition Coverage
 In this technique, all individual conditions must be covered as
 shown in the following example:
READ X, Y
IF(X ==0||Y        =0)
PRINT   0
#TCI -X = 0, Y = 55
#TC2-X=5, Y =0
                                                                              15
           BLACK-B0X TESTING AND WHITE BOX TESTING IN SOFTWARE ENGINEERING
4. Multiple Condition Coverage
 º In this technique, all the possible combinations of the possible
  outcomes of conditions are tested at least once. Let's consider
  the following example:
  READ X, Y
   IF(X ==0|| Y      =0)
  PRINT 0
  #TC1: X=0, Y =0
  #TC2: X=0, Y =5
  #TC3: X=55, Y =0
  #TC4: X= 55, Y = 5
                                                                             16
               BLACK B0X TESTING AND WHITE BOX TESTING IN SOFTWARE ENGINEERING
                 Difference between white-box testing and
                                  black-box testing
       White-box testing                             Black box testing
The developers can perform white            The test engineers perform the
box testing.                                black box testing.
To perform WBT, weshould have               To perform BBT, there is no need
an understanding of the                     to have an understanding of the
progranming languages.                      programming languages.
 In this, we will look into the source      In this, we will verify the
code and test the logic of the code.        functionality of the application
                                            based on the requirement
                                            specification.
In this, the developer should know          In this, there is no need to know
about the internal design of the            about the internal design of the     20
code.                                       code.