Levels of Testing

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 15

Levels of Testing

Unit Testing
 Unit testing is the first level of testing. This testing is the most basic
type of testing done by the developers before handing the
software/product to the testing team.
 Unit Testing Definition?
 Unit testing is a type of software testing in which individual units or
components of the software are tested.
 Primary Objective: The main objective of unit testing is to isolate
each component of the software and then perform tests to illustrate
that every individual component is accurately meeting the
requirements and delivering the expected output.
Advantages of Unit Testing
 Here are some of the advantages of unit testing:
 Helps to catch bugs/defects earlier, which preserves both – time
and money
 Detects regression bugs (It is a kind of bug that is not found until
and unless the software/product is released or is in production)
 Helps to understand the behavior of the code 
 The cost of conducting unit testing is low.
Disadvantages of Unit Testing

 Here are some of the disadvantages of unit testing, such


as:
 Writing test cases takes time.
 Unit testing is incapable of detecting all errors.
 GUI code testing must be performed correctly, as it will
be challenging to test the software’s graphical user
interface using unit testing. 
Integration Testing
 Integration testing is the second level of testing. The testers, rather than the
developers, mainly conduct this testing. This testing can be performed
manually or using integration testing tools, such as Selenium.
 Integration testing is a type of software testing where two or more modules
of an application are logically grouped together and tested as a whole.
 The focus of this type of testing is to find the defect on interface,
communication, and data flow among modules.
 Primary Objective: The main objective of integration testing is to verify
whether individual modules, when combined (integrated), work correctly or
not as a group.
 Top-down or Bottom-up approach is used while integrating modules into the
whole system.
example
 a user is buying a flight ticket from any airline website. Users can
see flight details and payment information while buying a ticket,
but flight details and payment processing are two different
systems. Integration testing should be done while integrating of
airline website and payment processing system.
Top-down approach
 Top Down Integration testing which is also known as Incremental integration testing. In this
Top Down approach the higher level modules are tested first after higher level modules the
lower level modules are tested. Then these modules undergo for integration accordingly. Here
the higher level modules refers to main module and lower level modules refers to submodules.
Bottom Up Integration Testing
 Bottom Up Integration testing is another approach of Integration testing. In
this Bottom Up approach the lower level modules are tested first after lower
level modules the higher level modules are tested. Then these modules
undergo for integration accordingly. Here the lower level modules refers to
submodules and higher level modules refers to main modules.
Difference between Top Down Integration Testing and Bottom
Up Integration Testing :

TOP DOWN INTEGRATION VS BOTTOM UP INTEGRATION


TESTING TESTING

1. Top Down Integration 1. Bottom Up Integration


testing is one of the testing is one of the
approach of Integration approach of Integration
testing in which testing in which
integration testing takes integration testing takes
place from top to place from bottom to
bottom means system top means system
integration begins with integration begins with
top level modules. lowest level modules.

2. In this testing the higher 2. In this testing the lower


level modules are tested level modules are tested
first then the lower level first then the higher
modules are tested and level modules are tested
then the modules are and then the modules
integrated accordingly. are integrated
accordingly.
Difference between Top Down Integration Testing and
Bottom Up Integration Testing :

1. Top Down Integration testing 1.Bottom Up Integration testing


approach is beneficial if the approach is beneficial if the crucial
significant defect occurs toward the flaws encounters towards the bottom
top of the program. of the program.

2. In Top Down Integration testing 2. In Bottom Up Integration testing


approach the main module is approach different modules are
designed at first then the created first then these modules are
submodules/subroutines are called integrated with the main function.
from it. 3. It works on small to big
3. It works on big to small components.
components. 4. The complexity of this testing is
4. The complexity of this testing is complex and highly data intensive.
simple.
White Box Testing
 White box testing is an approach that allows testers to inspect and verify the
inner workings of a software system—its code, infrastructure, and integrations
with external systems
 A tester who understands the test codes is able to see the internal workings of the
software and has access to the source code, so they can design test cases that
thoroughly, test the different code paths and ensure that the software is working
correctly. As a result, the tester must always possess knowledge of or access to the
system's source code, typically provided in specification papers.
White Box Testing Techniques
 1. Statement Coverage
 One of the main objectives of white box testing is to cover as much of the
source code as possible. Code coverage is a measure that indicates how much
of an application’s code contains unit tests that validate its functioning.

 Read A
Read B
if A > B
    Print “A is greater than B”
else
    Print “B is greater than A”
endif
Case 2:
Case 1:
If A = 4, B= 8
If A = 7, B= 3
No of statements
No of statements Executed= 6
Total statements= 7
Executed= 5

Total statements= 7
Statement coverage= 5 / 7 * 100 
Statement coverage= 6
                                / =7 * 100 
71.00 %

                                 = 85.20 %
 Condition Coverage technique
 Condition coverage is also known as Predicate Coverage in which each one of the
Boolean expression have been evaluated to both TRUE and FALSE.

Test case num1>0 num2<10 Final output


 int num1 = 0; number
 int num2 = 0;
 if((num1>0 || num2<10)){
     cout<<"valid input";
 }else{ 1 True Not required True
     cout<<"invalid input";
 }
2 False True True

3 False False False


Branch Coverage
 Branch Coverage: In this technique, test cases are designed so that each branch from
all decision points are traversed at least once. In a flowchart, all edges must be
traversed at least once.

You might also like