Unit I: Introduction To Software Testing
Unit I: Introduction To Software Testing
1
For ensuring the quality & to discover problems!!
2
What is Software ?
Software is:
3
Major Types of Software
Application software
System Software
System software
Operating Systems
Schedules computer events
Hardware
Allocates computer resources
Monitor events
Language translators
Interpreters
Users
Compilers
Application Software Utility programs
Programming languages Routine operations
Assembly language (e.g. sort, list, print)
FORTRAN, BASIC, PL/1 Manage data
PASCAL, C (e.g. create files, merge files
5
5
What is Software Development
Process ?
Software Development Process is:
6
Software Development Life Cycle
7
Software Lifecycle Activities
...and their models
Implemented
By
Expressed in Structured By Realized By Verified
Terms Of
By
class...
class...
class... ?
class....?
Use Case Application Solution
Domain Subsystems Source Test
Model Domain
Objects Code Cases
Objects
8
What is Software Testing??
• Testing is the process of executing a program
with the intent to find the errors.”
• Testing v/s debugging
9
What is Software Testing ?
One of the practical methods commonly used to detect
the presence of errors (failures) in a computer
program is to test it for a set of inputs.
The output
is correct?
I1, I2, I3, Our program
…, In, …
Expected results
=?
Obtained results
“Inputs”
10
Let’s define Software Testing
―Testing is the process of demonstrating that errors
are not present.
OR
―The purpose of testing is to show that a program
performs its intended functions correctly.
OR
―Testing is the process of establishing confidence that
a program does what it is supposed to do.
11
Software Testing: Definition
―Software testing is a process used to identify the
correctness, completeness and quality of developed
computer software.
12
What are Software Errors ,
Faults , Failures ?
Error (Bug): An incorrect step, process, or data definition
A human action that produces an incorrect result
software error
software fault
software failure
14
Testing Terminology
Error
Fault
Failure
Incident
15
Objectives of Testing
1.Software Quality Improvement
16
Testing Principles
• Test should be based on customer requirement
1.Test planning
2.Test case design
3.Test execution
4.Data collection
5.Effectiveness evaluation
19
• The strategic approach for software testing can
be -
1.Just before starting the testing process the formal
technical reviews must be conducted. this will
eliminate many errors before the actual testing process.
2.At the beginning , various components of the system
are tested , then gradually interface is tested and thus
the entire computer based system is tested.
3. Different testing techniques can be applied at different
point of time.
4.The developer of the software conducts testing. For the
large projects the independent test group (ITG) also
assist the developer.
20
6.3 Organizing for software testing
• Testing need to be conducted from the beginning of the
software development process.
• Software developer should test the individual unit of
software system for its proper functioning. This is called
as unit testing . That means there must be an
involvement of s/w developers for unit testing
activities.
• In many cases s/w developer performs integration
testing. Thus the complete s/w architecture is been
tested by the s/w developers during development
phases.
• Then the independent test group (ITG) gets involved in
the s/w testing activity.
21
6.4 Criteria for completion of Testing
• Entry criteria:
s/w testing should start early in SDLC. This helps to
capture and eliminate defects in the early stages of
SDLC i.e requirement gathering and design phase.
An early start to testing helps to reduce the number of
defects and ultimately the n/w cost in the end.
Entry criteria for testing is defined as “specific
conditions or on going activities that must be present
before a process can begin.
The software testing life cylcel (STLC) specifies the entry
criteria required during each testing phase.
22
It also defines the time interval or the expected
amount of lead time to make the entry criteria item
available to the process.
Following are the inputs necessary for the entry criteria
1.The requirements documents
2.Complete understanding of application flow
3.Test plan
• Exit criteria:
It can be defined as “the specific condition or on going
activities that should be fulfilled before completing the
s/w testing life cycle”.
The exit criteria can identify the intermediate
deliverables.
23
Following exit criteria should be considered for
completion of a testing phase
o Ensuring all critical test cases are passed.
o Achieving complete functional coverage.
o Identifying and fixing all the high priority defects.
The output achieved through exit criteria are-
1.Test summary report.
2.Test logs.
24
6.5 Strategic issues
• Before the testing starts , specify product requirements
appropriately.
• Specify testing objectives clearly.
• Identify categories of users for the s/w and their role
with reference to s/w system.
• Develop a test plan that emphasizes rapid cycle testing
• Build robust s/w which can be useful for testing
• Use effective formal reviews before actual testing
process begins.
• Conduct formal technical review to access the test
strategy and test cases
25
Verification and Validation
Verification:
Are we building the product right? Requirements verification
Performed at the end of a phase to
ensure that requirements
established during previous phase Architecture verification
26
6.2 Verification and validation
27
28
Few Causes of Software Errors !
Faulty requirements definition.
Client-developer communication failures.
Deliberate deviations from software requirements.
Logical design errors.
Coding errors.
Non-compliance with documentation and coding
instructions.
Shortcomings of the testing process.
User interface and procedure errors.
Documentation errors.
29
When are defects introduced?
The majority of defects are introduced in earlier phases.
– Requirements are the top factor in a project’s
success or failure.
Requirements 56 82
Design 27 13
Code 7 1
Other 10 4
30
Cost of fixing defects
Relative cost of fixing defects
Benchmark: cost at requirements phase = 1
31
Why Testing is Necessary ?
Testing decreases cost
Cost of finding and
correcting fault
100 x
10 x
1x
0.1 x
Requirements Design Coding Testing Maintenance
32
What is Software Quality ?
Conformance to requirements.
Lack of bugs.
Low defect rate (# of defects/size unit)
High reliability (number of failures per n hours of
operation).
Mean Time To Failure (MTTF): probability of
failure-free operation in a specified time.
33
What is Software Quality ?
34
What is Software Quality ?
35
Importance of Software Quality
Software is a major component of computer systems
(about 80% of the cost) – used for
Communication (e.g. phone system, email system).
Health monitoring.
Transportation (e.g. automobile, aeronautics).
Economic exchanges (e.g. e-commerce, banks).
Entertainment.
etc.
37
Quality Attributes
Need to deliver the functionality required by the user
But also be:
39
Software Quality Factors
Product Revision
42
Software Quality Assurance (SQA)
Software quality assurance is an umbrella
activity that is applied throughout the software
process.
SQA encompasses:
A quality management approach
Effective software engineering technology
Formal technical reviews
A multi-tiered testing strategy
Document change control
Software development standard and its control
procedure
Measurement and reporting mechanism.
43
Error
Testing Life Cycle Error
Requirement Fault
Specification Resolution
Fault Error
Design Fault
Isolation
Error
Fault Incident
Coding Fault
Classification
Fault
Testing
44
A Testing Cycle
Although testing varies between organizations, there is a cycle to
testing:
45
Test Cases
Test Case ID
Purpose
Preconditions
Inputs
Expected Outputs
Post Conditions
Execution History
Date Result Version Run By
47
Levels of Testing
Requirement System
Specification Testing
Preliminary Integration
Design Testing
Coding
48
49
6.6 Testing strategies for conventional software
• Various testing strategies for conventional s/w
are-
1.Unit testing
2.Integration testing
3.Validation testing
4.System testing
50
Thank You
51