














Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The concept of software testing, focusing on the levels of testing, component testing, and unit testing. It explains the use of stubs and drivers in testing, the objectives of component testing, and the importance of unit testing. It also provides examples and differences between stubs and drivers.
Typology: Lecture notes
1 / 22
This page cannot be seen from the preview
Don't miss anything!















Chapter 3: Testing in Software Life Cycle
Agenda for today
Levels of Testing
Component Testing
Stub’s and Drivers
Unit Testing
Points for Unit Testing
Tools for Unit Testing
Integration Testing
Integration Testing Approaches
Bottom Up and Top Down integration Testing
BigBang and Adhoc integration Testing
Component Testing
Testing of separate software component is known as component testing
Objective of component testing is to verify the input/output behavior of
the test object
A group of components is known as module testing.
The main characteristic is that the software components are tested
individually and isolated from all other software components of the
system.
The isolation is necessary to prevent external influences on components.
Most often stubs and drivers are used to replace the missing software and
simulate the interface between the software components
Test Objects, Stubs and
Driver
Test objects are program modules/units or classes, (database) scripts, and
other software components.
Drivers are the dummy programs which are used to call the functions of the
lowest module in case the calling function does not exist.
A driver calls the component to be tested.
Stubs can be referred to as code a snippet which accepts the
inputs/requests from the top module and returns the results/ response.
-> A stub is called from the software component to be tested.
Component Testing:
Example
Scenario: There are two web pages. In one of the web pages there are a
many certain fields like username, address, mobile no. etc in which data
has to be entered. In the other (second) web page also there are certain
fields which carry forward the data from the first page. Testing the
functionality of these individual pages is called Component Testing.
Components are tested as soon as they are created,
There can be results retrieved from a component under test, are
dependent on other components which in turn are not developed
So in order to test that component, we use Stubs and Drivers
Stubs and Driver’s Difference
Stub
Driver
Type Dummy codes Dummy codes
Description
A piece of code that emulates
the called function.
A piece of code that emulates a
calling function.
Used in Top Down Integration Bottom Up Integration
Purpose
To allow testing of the upper
levels of the code, when the
lower levels of the code are
not yet developed.
To allow testing of the lower
levels of the code, when the
upper levels of the code are not
yet developed.
Example 2
We have 3 modules login, home, and user module in website.
Login module is ready and need to test it, but we call functions from home
and user (which is not ready)
What we will do?
Stub
For the same example if we have Home and User modules get ready and
Login module is not ready.
Driver
Unit Testing
Check individual parts functionality
Aim is to isolate each unit of the system to identify, analyze and fix the
defects
Done by developers
Reduces cost of testing
Developers can also re-use code
Facilitates changes
Example: Testing a function: whether the loop or program is working
properly or not
Points for Unit Testing
Unit Testing Tools
Junit
Nunit
JMocKit
Integration
Testing Example
Online shopping website
One developer was assigned to develop each of the modules below.
User registration and Authentication/Login
Product Catalogue
Shopping Cart
Billing
Payment gateway integration
Shipping and Package Tracking
Which types of bugs found during integration Testing?
Integration Testing
Approaches
Mainly four approaches:
Top Down approach
Bottom up approach
BigBang approach
Bottom up Integration
Testing
Starts with testing the lowest units of the application
Gradually moving up one-by-one.
modules
Development and testing can be done together
Big Bang Integration
Testing
All components tested atleast once
Individual modules of the programs are not integrated until every thing
is ready.
Convenient for small systems
Saves time