System analysis and design
Lecture 10
Md. Manowarul Islam
Lecturer, Dept. of CSE
Jagannath University
Software Engineering, COMP201 Slide 1
Software Tesing
⚫ Testing is the process of exercising a program with the
specific intent of finding errors prior to delivery to the
end user.
Software Engineering, COMP201 Slide 2
Md. Manowarul Islam, Dept. of CSE, JnU
What Testing Shows
errors
requirements conformance
performance
an indication
of quality
Software Engineering, COMP201 Slide 3
Md. Manowarul Islam, Dept. of CSE, JnU
Testing process goals
⚫ Validation testing
• To demonstrate to the developer and the system customer that
the software meets its requirements;
• A successful test shows that the system operates as intended.
⚫ Defect testing
• To discover faults or defects in the software where its behavior
is incorrect or not in conformance with its specification;
• A successful test is a test that makes the system perform
incorrectly and so exposes a defect in the system.
Software Engineering, COMP201 Slide 4
Md. Manowarul Islam, Dept. of CSE, JnU
V&V
⚫ Verification refers to the set of tasks that ensure
that software correctly implements a specific
function.
⚫ Validation refers to a different set of tasks that
ensure that the software that has been built is
traceable to customer requirements. Boehm
[Boe81] states this another way:
• Verification: "Are we building the product right?"
• Validation: "Are we building the right product?"
Software Engineering, COMP201 Slide 5
Md. Manowarul Islam, Dept. of CSE, JnU
Who Tests the Software?
developer independent tester
Understands the system Must learn about the system,
but, will test "gently" but, will attempt to break it
and, is driven by "delivery" and, is driven by quality
Software Engineering, COMP201 Slide 6
Md. Manowarul Islam, Dept. of CSE, JnU
Characteristics of Testable Software
⚫ Operable
• The better it works (i.e., better quality), the easier it is to test
⚫ Observable
• Incorrect output is easily identified; internal errors are
automatically detected
⚫ Controllable
• The states and variables of the software can be controlled
directly by the tester
⚫ Decomposable
• The software is built from independent modules that can be
tested independently
Software Engineering, COMP201 Slide 7
Md. Manowarul Islam, Dept. of CSE, JnU
Characteristics of Testable Software
⚫ Simple
• The program should exhibit functional, structural, and code
simplicity
⚫ Stable
• Changes to the software during testing are infrequent and do
not invalidate existing tests
⚫ Understandable
• The architectural design is well understood; documentation is
available and organized
Software Engineering, COMP201 Slide 8
Md. Manowarul Islam, Dept. of CSE, JnU
Test Characteristics
⚫ A good test has a high probability of finding an error
• The tester must understand the software and how it might fail
⚫ A good test is not redundant
• Testing time is limited; one test should not serve the same
purpose as another test
⚫ A good test should be “best of breed”
• Tests that have the highest likelihood of uncovering a whole
class of errors should be used
⚫ A good test should be neither too simple nor too complex
• Each test should be executed separately; combining a series of
tests could cause side effects and mask certain errors
Software Engineering, COMP201 Slide 9
Md. Manowarul Islam, Dept. of CSE, JnU
The testing process
⚫ Component testing
• Testing of individual program components;
• Usually the responsibility of the component developer (except
sometimes for critical systems);
• Tests are derived from the developer’s experience.
⚫ System testing
• Testing of groups of components integrated to create a system
or sub-system;
• The responsibility of an independent testing team;
• Tests are based on a system specification.
Software Engineering, COMP201 Slide 10
Md. Manowarul Islam, Dept. of CSE, JnU
Testing phases
Software Engineering, COMP201 Slide 11
Md. Manowarul Islam, Dept. of CSE, JnU
The software testing process
Software Engineering, COMP201 Slide 12
Md. Manowarul Islam, Dept. of CSE, JnU
The Test Case
• A TEST CASE is a set of actions executed to verify a particular
feature or functionality of your software application.
• A Test Case contains test steps, test data, precondition,
postcondition developed for specific test scenario to verify any
requirement.
Software Engineering, COMP201 Slide 13
Md. Manowarul Islam, Dept. of CSE, JnU
The Test Case
⚫ For a Test Scenario: Check Login Functionality there
many possible test cases are:
• Test Case 1: Check results on entering valid User Id &
Password
• Test Case 2: Check results on entering Invalid User ID &
Password
• Test Case 3: Check response when a User ID is Empty &
Login Button is pressed, and many more
Software Engineering, COMP201 Slide 14
Md. Manowarul Islam, Dept. of CSE, JnU
The Test Case
Software Engineering, COMP201 Slide 15
Md. Manowarul Islam, Dept. of CSE, JnU
The Test Case
Software Engineering, COMP201 Slide 16
Md. Manowarul Islam, Dept. of CSE, JnU
The Test Case
Software Engineering, COMP201 Slide 17
Md. Manowarul Islam, Dept. of CSE, JnU
The Test Case
Software Engineering, COMP201 Slide 18
Md. Manowarul Islam, Dept. of CSE, JnU
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.
30/10/2014 Software Engineering, COMP201 Slide 19
Md. ManowarulChapter
Islam, 8Dept.
Software Testing
of CSE, JnU 19
Testing Activities
Requirements
Subsystem Unit System
Code Test Analysis
Design Document
Tested Document User
Subsystem
Subsystem Unit Manual
Code Test
Tested Integration Functional
Subsystem
Test Test
Integrated Functioning
Subsystems System
Tested Subsystem
Subsystem Unit
Code Test
All tests by developer
Cf. levels of testing
Software Engineering, COMP201 Slide 20
Md. Manowarul Islam, Dept. of CSE, JnU
Testing Activities continued
Client’s
Global Understanding User
Requirements of Requirements Environment
Functioning Validated Accepted
System PerformanceSystem AcceptanceSystem Installation
Test Test Test
Usable
Tests by client
System
Tests by developer
User’s understanding
System in
Use
Tests (?) by user
Software Engineering, COMP201 Slide 21
Md. Manowarul Islam, Dept. of CSE, JnU
Testing policies
⚫ Only exhaustive testing can show a program is free from
defects. However, exhaustive testing is impossible,
⚫ Testing policies define the approach to be used in
selecting system tests:
• All functions accessed through menus should be tested;
• Combinations of functions accessed through the same menu
should be tested;
• Where user input is required, all functions must be tested with
correct and incorrect input.
Software Engineering, COMP201 Slide 22
Md. Manowarul Islam, Dept. of CSE, JnU
System testing
⚫ Involves integrating components to create a system or
sub-system.
⚫ May involve testing an increment to be delivered to the
customer.
⚫ Two phases:
• Integration testing - the test team have access to the system
source code. The system is tested as components are
integrated.
• Release testing - the test team test the complete system to be
delivered as a black-box.
Software Engineering, COMP201 Slide 23
Md. Manowarul Islam, Dept. of CSE, JnU
Integration Testing Strategies
Options:
• an incremental construction strategy
Software Engineering, COMP201 Slide 24
Md. Manowarul Islam, Dept. of CSE, JnU
Incremental integration testing
A T1
T1
A
T1 T2
A B
T2
T2 B T3
T3
B C
T3 T4
C
T4
D T5
Testsequence 1 Testsequence 2 Testsequence 3
Software Engineering, COMP201 Slide 25
Md. Manowarul Islam, Dept. of CSE, JnU
Release testing
⚫ The process of testing a release of a system that will be
distributed to customers.
⚫ Primary goal is to increase the supplier’s confidence that
the system meets its requirements.
⚫ Release testing is usually black-box or functional testing
• Based on the system specification only;
• Testers do not have knowledge of the system implementation.
Software Engineering, COMP201 Slide 26
Md. Manowarul Islam, Dept. of CSE, JnU
Unit Testing
Write a little, test a little
⚫ Dynamic Analysis:
• Black-box testing (Test the input/output behavior)
• White-box testing (Test the internal logic of the subsystem or
object)
Software Engineering, COMP201 Slide 27
Md. Manowarul Islam, Dept. of CSE, JnU
Two Unit Testing Techniques
⚫ Black-box testing
• Knowing the specified function that a product has been designed to
perform, test to see if that function is fully operational and error free
• Includes tests that are conducted at the software interface
• Not concerned with internal logical structure of the software
⚫ White-box testing
• Knowing the internal workings of a product, test that all internal
operations are performed according to specifications and all internal
components have been exercised
• Involves tests that concentrate on close examination of procedural
detail
• Logical paths through the software are tested
• Test cases exercise specific sets of conditions and loops
Software Engineering, COMP201 Slide 28
Md. Manowarul Islam, Dept. of CSE, JnU
White Box Testing
❑ White-box testing (also known as clear box testing, glass box
testing, transparent box testing, and structural testing) is a
method of testing software that tests internal structures or workings
of an application, as opposed to its functionality
Software Engineering, COMP201 Slide 29
Md. Manowarul Islam, Dept. of CSE, JnU
White-Box Testing
... our goal is to ensure that all statements and
conditions have been executed at least once ...
Software Engineering, COMP201 Slide 30
Md. Manowarul Islam, Dept. of CSE, JnU
Black Box Testing
❑In Black Box Testing we just focus on inputs and
output of the software system without bothering
about internal knowledge of the software program.
Software Engineering, COMP201 Slide 31
Md. Manowarul Islam, Dept. of CSE, JnU
White-box Testing
⚫ Uses the control structure part of component-level design to derive
the test cases
⚫ These test cases
• Guarantee that all independent paths within a module have been
exercised at least once
• Exercise all logical decisions on their true and false sides
• Execute all loops at their boundaries and within their operational
bounds
• Exercise internal data structures to ensure their validity
Software Engineering, COMP201 Slide 32
Md. Manowarul Islam, Dept. of CSE, JnU
White-box Testing
⚫ Statement Testing (Algebraic Testing): Test single
statements
⚫ Loop Testing:
• Cause execution of the loop to be skipped completely.
(Exception: Repeat loops)
• Loop to be executed exactly once
• Loop to be executed more than once
⚫ Path testing:
• Make sure all paths in the program are executed
⚫ Branch Testing (Conditional Testing): Make sure that
each possible outcome from a condition is tested at
least once
if ( i = TRUE) printf("YES\n");else printf("NO\n");
Test cases: 1) i = TRUE; 2) i = FALSE
Software Engineering, COMP201 Slide 33
Md. Manowarul Islam, Dept. of CSE, JnU
Black-box Testing
⚫ Complements white-box testing by uncovering different
classes of errors
⚫ Focuses on the functional requirements and the information
domain of the software
⚫ Used during the later stages of testing after white box testing
has been performed
⚫ The tester identifies a set of input conditions that will fully
exercise all functional requirements for a program
Software Engineering, COMP201 Slide 34
Md. Manowarul Islam, Dept. of CSE, JnU
Black-box Testing Categories
⚫ Incorrect or missing functions
⚫ Interface errors
⚫ Errors in data structures or external data base access
⚫ Behavior or performance errors
⚫ Initialization and termination errors
Software Engineering, COMP201 Slide 35
Md. Manowarul Islam, Dept. of CSE, JnU
END
Software Engineering, COMP201 Slide 36
Md. Manowarul Islam, Dept. of CSE, JnU