Chapter 2 Ste Unit Integration Testing
Chapter 2 Ste Unit Integration Testing
Chapter 2 Ste Unit Integration Testing
MARKS : 18
2.1 Levels of Testing
2.2 Unit testing : driver , stub
2.3 Integration testing :Top down integration, Bottom up integration, Bi- directional integration
2.4 Testing on web application : Performance testing: load testing, stress testing, security testing,
client server testing
2.5 Acceptance testing : alpha testing and beta testing , special tests :regression testing, GUI testing.
III The output based on the test data and the specifications of the
application.
System Testing
This is the next level in the testing and tests the system as a whole. Once all the components are
integrated, the application as a whole is tested rigorously to see that it meets Quality Standards. This
type of testing is performed by a specialized testing team.
Why is System Testing so Important
System Testing is the first step in the Software Development Life Cycle, where the application is
tested as a whole.
The application is tested thoroughly to verify that it meets the functional and technical
specifications.
The application is tested in an environment which is very close to the production environment
where the application will be deployed.
System Testing enables us to test, verify and validate both the business requirements as well as the
Applications Architecture.
Acceptance Testing
This is arguably the most importance type of testing as it is conducted by the Quality Assurance
Team who will gauge whether the application meets the intended specifications and satisfies the
client’s requirements. The QA team will have a set of pre written scenarios and Test Cases that will
be used to test the application.
More ideas will be shared about the application and more tests can be performed on it to gauge its
accuracy and the reasons why the project was initiated. Acceptance tests are not only intended to
point out simple spelling mistakes, cosmetic errors or Interface gaps, but also to point out any bugs in
the application that will result in system crashers or major errors in the application.
By performing acceptance tests on an application the testing team will deduce how the application
will perform in production. There are also legal and contractual requirements for acceptance of the
system.
2.2 Unit testing : drivers and stubs
Testing that occurs at the lowest level is called unit testing or module testing. As the units are
tested and the low-level bugs are found and fixed, they are integrated and integration testing is
performed against groups of modules. This process of incremental testing continues, putting
together more and more pieces of the software until the entire product—or at least a major portion
of it—is tested at once in a process called system testing.
With this testing strategy, it’s much easier to isolate bugs. When a problem is found at the unit
level, the problem must be in that unit. If a bug is found when multiple units are integrated, it
must be related to how the modules interact. Of course, there are exceptions to this, but by and
large, testing and debugging is much more efficient than testing everything at once.
Fig 1 : A test driver can replace a real software and more efficiently test a lower level module.
In bottom-up
testing (see Figure 1 above), you write your own modules, called test drivers,that exercise the
modules
you’re testing. They hook in exactly the same way that the future real modules will. These drivers
end test-case data to the modules under test, read back the results, and verify that they’re correct. You
can very thoroughly test the software this way, feeding it all types and quantities of data, even ones
that might be difficult to send if done at a higher level.
Fig .2 : A test stub sends data up to the module being tested.
Look at Figure 2. In this case, a low-level interface module is used to collect temperature data from
an electronic thermometer. A display module sits right above the interface, reads the data from the
interface, and displays it to the user. To test the top-level display module, you’d need blow torches,
water, ice, and a deep freeze to change the temperature of the sensor and have that data passed up the
line.
Rather than test the temperature display module by attempting to control the temperature of the
thermometer, you could write a small piece of code called a stub that acts just like the interface
module by feeding temperature values from a file directly to the display module. The display module
would read the data and show the temperature just as though it was reading directly from a real
thermometer interface module. It wouldn’t know the difference. With this test stub configuration, you
could quickly run through numerous test values and validate the operation of the display module.
Stubs Drivers
1. Used in Top-Down Integration Testing. 1.Used in Bottom-Up Integration Testing.
2. A piece of code that emulates the called 2. A piece of code that emulates a calling
function. function.
3. Stubs stimulates the activity of missing and 3. Drivers pass test cases to another code and
not developed modules. invoke modules under testing.
4. These are created when high level modules 4. These are created when lower level modules
are tested and lower level modules are not are tested and higher level modules are not yet
developed. developed.
2.3 Integration Testing :
INTEGRATION TESTING is a level of software testing where individual units are combined and
tested as a group. The purpose of this level of testing is to expose faults in the interaction between
integrated units. Test drivers and test stubs are used to assist in Integration Testing.
Definition by ISTQB
integration testing: Testing performed to expose defects in the interfaces and in the
interactions between integrated components or system.
Approaches
Big Bang is an approach to Integration Testing where all or most of the units are combined
together and tested at one go. This approach is taken when the testing team receives the entire
software in a bundle. So what is the difference between Big Bang Integration Testing and
System Testing? Well, the former tests only the interactions between the units while the latter
tests the entire system.
Top Down is an approach to Integration Testing where top-level units are tested first and
lower level units are tested step by step after that. This approach is taken when top-down
development approach is followed. Test Stubs are needed to simulate lower level units which
may not be available during the initial phases.
Bottom Up is an approach to Integration Testing where bottom level units are tested first and
upper-level units step by step after that. This approach is taken when bottom-up development
approach is followed. Test Drivers are needed to simulate higher level units which may not be
available during the initial phases.
Sandwich/Hybrid is an approach to Integration Testing which is a combination of Top Down
and Bottom Up approaches.
Fig : Individual pieces of code are built up and tested separately, and then integrated and tested again.
As the units are tested and the low-level bugs are found and fixed, they are integrated and integration
testing is performed against groups of modules. This process of incremental testing continues, putting
together more and more pieces of the software until the entire product—or at least a major portion
of it—is tested at once in a process called system testing.
With this testing strategy, it’s much easier to isolate bugs. When a problem is found at the unit level,
the problem must be in that unit. If a bug is found when multiple units are integrated, it must be
related to how the modules interact. Of course, there are exceptions to this, but by and large, testing
and debugging is much more efficient than testing everything at once.
There are two approaches to this incremental testing: bottom-up and top-down. In bottom-up
testing , we write own modules, called test drivers, that exercise the modules we’re testing. They
hook in exactly the same way that the future real modules will. These drivers send test-case data to
the modules under test, read back the results, and verify that they’re correct.
One can very thoroughly test the software this way, feeding it all types and quantities of data, even
ones that might be difficult to send if done at a higher level.
1. Bottom-up Integration
In the bottom-up strategy, each module at lower levels is tested with higher modules until all modules
are tested. It takes help of Drivers for testing
Diagrammatic Representation:
Advantages:
Fault localization is easier.
No time is wasted waiting for all modules to be developed unlike Big-bang approach
In this approach development and testing can be done together so that the product or
application will be efficient and as per the customer specifications.
Disadvantages:
Critical modules (at the top level of software architecture) which control the flow of
application are tested last and may be prone to defects.
An early prototype is not possible
The key interface defects are caught at the end of the cycle.
Test drivers are required to be created for modules at all levels except the top control.
The critical modules, which control the flow of the application are tested last and may be
prone to defects.
2. Top-down Integration:
In Top to down approach, testing takes place from top to down following the control flow of the
software system.
Takes help of stubs for testing.
Diagrammatic Representation:
Advantages:
Fault Localization is easier.
Possibility to obtain an early prototype.
Critical Modules are tested on priority; major design flaws could be found and fixed first.
The tested product is extremely consistent in this approach as the integration testing is
performed in an environment that is similar to the real world environment.
The stubs in top-down approach can be written in lesser time compared to drivers as they are
simpler to author.
Here, fault localization is easier.
In top-down approach the critical modules are tested on priority, which further helps testers in
finding major design flaws as early as possible.
Disadvantages:
Needs many Stubs.
Modules at a lower level are tested inadequately.
The basic functionality of the software is tested at the end of the cycle.
BOTTOM-UP
BASIS FOR TOP-DOWN INTEGRATION
INTEGRATION
COMPARISON TESTING
TESTING
Approach Main function is written at first then Modules are created first
the subroutines are called from it. then are integrated with the
main function.
Risk analysation Collaborating the impact of internal Models are used to analyze
operational failures. the individual process.