Week02 Lecture06
Week02 Lecture06
Assurance
CSE-453
Lecture - 06
Stages of testing
• Development testing - where the system is tested during
development to discover bugs and defects.
• Release testing - where a separate testing team test a complete
version of the system before it is released to users.
• User testing - where users or potential users of a system test
the system in their own environment.
Development testing
• Development testing includes all testing activities that are carried out by
the team developing the system.
• Development team includes programmer (who developed the software )
and tester (who develops tests and assist with the testing process)
• The programmer can work as a tester or there maybe separate tester team
associated with a programmer
• Development testing is primarily a defect testing process, where the aim
of testing is to discover bugs in the software. It is therefore usually
interleaved with debugging
Development testing
• Development testing includes four levels of testing -
• Unit testing - where individual program units or object classes are tested. Unit testing
should focus on testing the functionality of objects or methods.
• Component testing - where several individual units are integrated to create composite
components. Component testing should focus on testing component interfaces.
• Integration Testing - where individual software modules or components are combined
and tested as a group. Integration testing should focus on testing interface between the
group of modules or components
• System testing - where testing is conducted on a complete, integrated system as a
whole. System testing should focus on testing component/module interactions.
4
Debugging
• Debugging is the process of fixing errors and problems that have been
discovered by testing.
• Using information from the program tests, debuggers use their knowledge
of the programming language and the intended outcome of the test to
locate and repair the program error.
• This process is often supported by interactive debugging tools that
provide extra information about program execution.
Unit testing
• Unit testing refers to testing program units in isolation
• A program unit may be viewed as a piece of code implementing a “low”-level
function
• Unit testing is performed by the programmer who writes the program unit because
the programmer is intimately familiar with the internal details of the unit.
• The objective for the programmer is to be satisfied that the unit works as
expected.
• Units may be a program unit. Syntactically, a program unit is a piece of code
which can be -
• Individual functions or methods within an object
• Object classes with several attributes and methods
• Composite components with defined interfaces used to access their
functionality
Unit testing
Unit testing has a limited scope. A programmer will need to verify whether or
not a code works correctly by performing unit-level testing. Intuitively, a
programmer needs to test a unit as follows:
• Execute every line of code. This is desirable because the programmer needs
to know what happens when a line of code is executed. In the absence of
such basic observations, surprises at a later stage can be expensive.
• Execute every predicate in the unit to evaluate them to true and false
separately.
• Observe that the unit performs its intended function and ensure that it
contains no known errors.
Unit testing
Unit testing is conducted in two complementary phases:
2. Guideline-based testing - where you use testing guidelines to choose test cases.
These guidelines reflect previous experience of the kinds of errors that programmers
often make when developing components.
Partition Testing
Input data and output results often fall into different classes
where all members of a class are related.
Example of these classes are positive numbers, negative
numbers, and menu selections
Each of these classes is an equivalence partition or domain
where the program behaves in an equivalent way for each
class member.
Test cases should be chosen from each partition.
18
Guideline Based Testing
• Choose inputs that force the system to generate all error messages
• Design inputs that cause input buffers to overflow
• Repeat the same input or series of inputs numerous times
• Force invalid outputs to be generated
• Force computation results to be too large or too small.
THANK YOU