Week03 Lecture07
Week03 Lecture07
Assurance
CSE-453
Lecture - 07
Unit Test Tools
The well-known tools used by programmers in everyday life are an editor,
a compiler, an operating system, and a debugger
Code Auditor: This tool is used to check the quality of software to ensure
that it meets some minimum coding standards.
Bound Checker: This tool can check for accidental writes into the memory
location outside the data storage area of the application.
Test Data Generator: These tools assist programmers in selecting test data
that cause a program to behave in a desired manner.
Static Code (Path) Analyzer: These tools identify paths to test, based on the
structure of the code
Testing Stages
Testing
Unit Testing
Component Testing
Integration Testing
System testing
Component Testing
Software components are often composite components that are made up
of several interacting objects.
You access the functionality of these objects through the defined
component interface.
Testing composite components should therefore focus on showing that
the component interface behaves according to its specification.
The test cases are not applied to the individual components but rather to
the interface of the composite component created by combining these
components.
You can assume that unit tests on the individual objects within the
component have been completed.
Component Testing
Interface Testing
An interface is a shared boundary across which two separate
components of a computer system exchange information.
Objectives
To detect faults due to interface errors or invalid assumptions about
interfaces.
To evaluate whether systems or components pass data and control
correctly to one another
Interface errors in the composite component may not be detectable by
testing the individual objects because these errors result from
interactions between the objects in the component
Interface Types
There are different types of interface between program components
Interface types
Parameter interfaces: Data passed from one method or procedure to
another.
Shared memory interfaces: Block of memory is shared between
procedures or functions.
Procedural interfaces: Sub-system encapsulates a set of procedures to
be called by other sub-systems.
Message passing interfaces: Sub-systems request services from other
sub-systems
Interface Errors
Interface misuse
A calling component calls another component and makes an error
in its use of its interface e.g. parameters in the wrong order.
Interface misunderstanding
A calling component embeds assumptions about the behaviour of
the called component which are incorrect.
Timing errors
The called and the calling component operate at different speeds
and out-of-date information is accessed.
Interface Testing Guidelines
Design tests so that parameters to a called procedure are at the extreme
ends of their ranges.
Always test pointer parameters with null pointers.
Design tests which cause the component to fail.
Use stress testing in message passing systems.
In shared memory systems, vary the order in which components are
activated.
Integration Testing
The testing in which individual software modules are combined and tested as a
group.
A module is formed by a group of components.
Objectives
To combine the software modules into a working system so that system-
level tests can be performed on the complete system.
Some modules are more error prone than other modules, because of their
inherent complexity. It is essential to identify the ones causing most
failures.
Putting the modules together in an incremental manner and ensuring that
the additional modules work as expected without disturbing the
functionalities of the modules already put together.
Granularity of Integration Testing
System integration testing is performed at different levels of granularity –
Intrasystem testing - This form of testing constitutes low-level integration
testing with the objective of combining the modules together to build a
cohesive system in an incremental manner
Intersystem testing – This form of testing is a high-level testing phase
which requires interfacing independently tested systems. In this phase, all
the systems are connected together, and testing is conducted from end to
end.
Pairwise testing - Pairwise testing is a kind of intermediate level of
integration testing. In pairwise integration, only two interconnected systems
in an overall system are tested at a time.
Integration Testing Techniques
The Software Industry uses variety of strategies to execute integration
testing. They are -