SE - Comps - Software Engineering - Unit 6 - Week-12
SE - Comps - Software Engineering - Unit 6 - Week-12
SE - Comps - Software Engineering - Unit 6 - Week-12
2
Unit No:6 Unit Name: Software Testing
Lecture No: 34
Basic Concept and
Terminology
Typical Project Blues…
4 Software Testing
Introduction
Functionality
Performance
5 Software Testing
Need of Testing
6 Software Testing
Software Tester
7 Software Testing
Error, Bug, Fault & Failure
Error : It is a human action that produces the incorrect result that produces a
fault.
8 Software Testing
Testing Methodologies
9 Software Testing
Steps in Testing
10 Software Testing
Steps in Testing
performance requirements.
11 Software Testing
Steps in Testing
12 Software Testing
Verification and Validation
Verification
• Are you building the product right?
• Software must conform to its specification
Validation
• Are you building the right product?
• Software should do what the user really requires
13 Software Testing
Verification and Validation Goals
• Establish confidence that the software system is ‘fit for its intended purpose’.
• Level of required confidence depends upon
System purpose
User expectations
Marketing environment
14 Software Testing
Static and Dynamic Verification and Validation
Static
verification
Dynamic
Prototype
validation
Software Inspection(Static)
Analyse and check the requirements document, design diagrams and the program
source code.
You can use inspections at all stages of the process.
15 Software Testing
Static and Dynamic Verification and Validation
Static
verification
Dynamic
Prototype
validation
Software Testing(Dynamic)-
• Involves running an implementation of the software with test data.
• You examine the outputs of the software and its operational behavior to check that it
is performing as required.
16 Software Testing
Type of Testing
• Unit Testing
• Integration Testing
• Validation Testing
• System Testing
17 Software Testing
Unit Testing
• Objectives: The primary goal of unit testing is to take the smallest module of testable
software, and running it in isolation by using prepared test cases and comparing with
• Who Developer/programmer
18 Software Testing
What are Stubs, Drivers ?
19 Software Testing
Integration Testing
• Objectives
To technically verify proper interfacing between modules, and within
sub-systems that satisfy functional requirement.
• When After modules are unit tested
• Who Developers/Programmer
• Methods White Box techniques
Black Box techniques
20 Software Testing
Types Of Integration Testing
21 Software Testing
Top Down Integration Testing
Stub
Stub A
stub
Stub
B
B Stub
Stub
C
Stub
22 Software Testing
Bottom Up Integration testing
Test Test
Drivers Drivers
23 Software Testing
Regression Testing
• Objectives
• Who
24 Software Testing
Validation Testing
• Objectives: To verify that the system meets the user requirements. It is the
25 Software Testing
Black Box Testing
• In the black-box testing approach, test cases are designed using only the
• It explains the process of giving the input to the system and checking the
output, without considering how the system generates the output. It is also
26 Software Testing
Alpha Testing
27 Software Testing
Beta Testing
being present.
• Customer records the problems and reports it to the developer then the
28 Software Testing
System Testing
• Objectives: The goal of system testing is not to find out faults but to
demonstrate performance.
purpose of which is to fully exercise the system. All work to verify that all system
29 Software Testing
Unit No:6 Unit Name: Software Testing
Lecture No: 35
White Box Testing – Path
Testing
What is it?
31 Software Testing
White Box Testing
Test data
Tests Derives
Component Test
code outputs
32 Software Testing
Techniques
• Statement coverage
• Loop testing
• Path testing
• Branch testing
33 Software Testing
Statement Coverage
34 Software Testing
Path testing
35 Software Testing
Path testing: Determine Paths
Start
F
2
T
3
T F
4 5
7
T F
8 9
Exit
37 Software Testing
Control Graph Component
• A control flow graph (or simply, flow graph) is a directed graph which
represents the control structure of a program or module. A control flow graph
(V, E) has V number of nodes/vertices and E number of edges in it. A control
graph can also have :
•
Junction Node – a node with more than one arrow entering it.
• Decision Node – a node with more then one arrow leaving it.
• Region – area bounded by edges and nodes (area outside the graph is also
counted as a region.).
38 Software Testing
Components
39 Software Testing
Notations for constructing flow graph : Sequence Statements
40 Software Testing
Notations for constructing flow graph : If Else
41 Software Testing
Notations for constructing flow graph : Do While / while
42 Software Testing
Notations for constructing flow graph : Switch - Case
43 Software Testing
Cyclomatic Complexity
V(G) = e - n + 2*P
e is number of edges,
n is number of vertices,
P is number of connected components.
Example : e = 4, n = 4 and p = 1
44 Software Testing
Cyclomatic Complexity
where,
d is number of decision nodes,
P is number of connected nodes.
For example, consider first graph given above,
45 Software Testing
Cyclomatic Complexity
46 Software Testing
Cyclomatic Complexity
47 Software Testing
Cyclomatic Complexity
V(G) = d + P
where,
d is number of decision nodes,
P is number of connected nodes.
where, d = 2 and p = 1
V(G) = 2 + 1 = 2
48 Software Testing
Cyclomatic Complexity
49 Software Testing
Loop testing
50 Software Testing
Branch testing
if (i=true)
else
printf (“I am false”)
1. i=true;
2. i=false
51 Software Testing
Unit No: Unit Name: Software Testing
Lecture No:36
Black Box Testing – BVA
Integration
Black-Box Testing
53 Software Testing
Black Box Testing contd…
54 Software Testing
Focus of Black-Box Testing
• In this technique, we do not use the code to determine a test suite; rather,
knowing the problem that we're trying to solve, we come up with four types of
test data:
• Easy-to-compute data
• Typical data
• Bogus data
55 Software Testing
Black-Box Testing Techniques
• Equivalence Partitioning
• Error Guessing
• Cause-Effect Graphing
56 Software Testing
Equivalence Partitioning
57 Software Testing
Boundary Analysis
• This technique consists of developing test cases and data that focus on the input and
58 Software Testing
Error Guessing
• Test cases can be developed based upon the intuition and experience of the
tester
• For example, where one of the inputs is the date, a tester may try February 29,
2001
59 Software Testing
Advantages of Black-Box Testing
62 Software Testing
Disadvantages of Black-Box Testing
• Only a small number of possible inputs can actually be tested, to test every
• Without clear and concise specifications, test cases are hard to design
• There may be unnecessary repetition of test inputs if the tester is not informed
63 Software Testing
Unit No:6 Unit Name: Software Testing
Lecture No:
Validation and System Testing
Validation
65 Software Testing
Validation Types
66
Validation Continued
• Example:
– 18/02/1991 might be entered instead of 18/02/1981
– The above meets the validation rule (format) but is obviously wrong
which might mean that the system rejects the customers application
(e.g. would be to young to get a phone contract)
67 Software Testing
System Testing
68 Software Testing
1. Recovery Testing
Forces the software to fail in different conditions and verifies that recovery is properly
performed.
Many computer system recover from faults and resume processing within a prespecified
time.
If recovery requires human intervention, the Mean Time to Repair (MTTR) is evaluated to
determine whether it is within acceptable limits.
69 Software Testing
2. Security Testing
70 Software Testing
3. Stress Testing
71 Software Testing
4. Performance Testing
72 Software Testing
Thank You