Topic 6: Software Testing
Instructor: Dr. Bii
Topic 6
6.0 Software Testing
6.1 Validation & Verification (V & V)
6.2 Software Testing
6.3 Stages of Testing
6.4 Types of Testing & Processes
6.5 Review Questions.
2
Introduction
If requirements analysis, modeling, and
design are done with disciplined
attention, good quality software results.
But any human activity, however carefully
performed, will involve mistakes/errors.
The system must therefore be verified
and validated.
3
… Introduction
Testing of software has 2 goals:
– To demonstrate to the developer and
the customer that the software meets
its requirements.
– To discover situations in which the
behaviour of the software is incorrect,
undesirable or does not conform to its
specification.
4
Validation & Verification
During development, the software must be
checked to ensure that it meets its
requirements/specifications and delivers
the functionality expected by the customer.
The checking and analysis processes
meant to achieve these are called
VERIFICATION and VALIDATION (V&V).
V&V includes requirements reviews, design
5
reviews, code inspections, and testing.
Verification & Validation
Sommerville:
– Verification: “Are we building the
product right?”
i.e. software should conform to its
specification
– Validation: “Are we building the right
product?”
i.e. software should do what the user really
6 requires
…V&V
Inspections and reviews analyze and
check the system requirements, design
models, the program source code, and
even proposed system tests.
7
…V&V
Software inspections analyse the static system
representations to discover problems (static
verification)
– May be supplemented by tool-based document and
code analysis.
These involve people examining the source
representation with the aim of discovering
anomalies and defects.
Inspections do not require execution of a
8 system so may be used before implementation.
Software Testing
Testing is part of a broader process of
software verification and validation (V &
V).
Testing is the process of deliberately
trying to cause failures in a system in
order to detect any defects that might be
present.
“Testing can only show the presence of errors, not
9 their absence”
… V & V – Software testing
Software testing is concerned with exercising
and observing product behaviour (dynamic
verification)
– The system is executed with test data and its
operational behaviour is observed.
10
Software Testing Stages
Sommerville (p.231) notes that software
goes through 3 stages of testing:
– Development testing - testing during
development to discover bugs and defects.
– Release testing - testing a complete version
of the system before it is released to users.
– User testing - users or potential users of a
system test the system in their own
11
environment.
(a) Development Testing
This includes all testing activities carried
out by the team developing the system.
It involves 3 stages too:
– Unit testing - individual program units or object
classes are tested.
– Component testing - several individual units are
integrated to create composite components & tested.
– System testing - some or all of the components in a
system are integrated and the system is tested as a
12 whole.
… (i) Unit Testing
Unit testing is the process of testing
individual components in isolation.
It is a defect testing process - meant to
discover faults or defects in the software.
A successful unit test is a test that
makes the unit perform incorrectly and
so exposes a defect in the unit.
13
… unit testing
Units may be:
– Individual functions or methods within
an object.
– Object classes with several attributes
and methods.
– Composite components with defined
interfaces used to access their
14
functionality.
… (ii) Component Testing
Components are often composite
components that are made up of several
interacting objects.
Testing these components should focus
on showing that the component interface
behaves according to its specification.
15
… component testing
Focus on interfaces between modules (A,
B, C).
16
… (iii) System Testing
System testing during development
involves integrating components to
create a version of the system and then
testing the integrated system.
The focus in system testing is testing the
interactions between components.
17
… System Testing
System testing checks that components
are compatible, interact correctly and
transfer the right data at the right time
across their interfaces.
System testing tests the emergent
behaviour of a system.
18
… System testing
During system testing, reusable components
that have been separately developed and off-
the-shelf systems may be integrated with newly
developed components. The complete system
is then tested.
Components developed by different team
members or sub-teams may be integrated at
this stage. System testing is a collective rather
than an individual process.
19
… System testing
The use-cases developed to identify
system interactions can be used as a
basis for system testing.
Each use case usually involves several
system components so testing the use
case forces these interactions to occur.
20
(b) Release Testing
Release testing is the process of testing
a particular release of a system that is
intended for use outside of the
development team.
The primary goal of the release testing
process is to convince the supplier of the
system that it is good enough for use.
21
… Release Testing
It has to show that the system delivers its
specified functionality, performance and
dependability, and that it does not fail
during normal use.
It is usually a black-box testing process
where tests are only derived from the
system specification.
22
… Release Testing
Release testing is a form of system
testing, done by a team that has not
been involved in the system
development.
The objective of this form of system
testing is to check that the system meets
its requirements and is good enough for
external use (validation testing).
23
… Release Testing
Involves:
– Requirements-based testing which involves
examining each requirement and developing a test
or tests for it.
– Performance testing in which emergent properties of
a system are tested i.e. overloading the systems to
gauge its performance and failure behaviour (stress
testing).
24
(c) User Testing
Also called customer testing.
It is a testing process in which users or
customers provide input and advice on
system testing.
User testing is essential, even when
comprehensive system and release
testing have been carried out – because
user environment may be different.
25
Types of User Testing
Alpha testing
– Users of the software work with the development
team to test the software at the developer’s site.
Beta testing
– A release of the software is made available to users
to allow them to experiment and to raise problems
that they discover with the system developers.
26
… types of user testing
Acceptance testing
– Customers test a system to decide whether or not it
is ready to be accepted from the system developers
and deployed in the customer environment.
Primarily for custom systems.
27
…
.
28
References
Pressman – Chap 22, 23 – all must read
this chapter.
Sommerville – Chap 8
29
Seminar Presentation
Task 17:
30
Seminar Presentation
Task 18:
31