0% found this document useful (0 votes)
55 views

Lecture 1 Software Testing

This document provides an introduction to software engineering and testing. It discusses the evolution of software testing from early debugging-oriented phases to the current process-oriented phase. Key milestones in testing's evolution include establishing testing as a separate process from development and realizing the importance of early testing. The document also addresses common myths about testing, such as that it is only one phase of the development lifecycle or that complete testing is possible. In reality, testing is a continuous process that runs parallel to development.

Uploaded by

Sasmita Padhy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views

Lecture 1 Software Testing

This document provides an introduction to software engineering and testing. It discusses the evolution of software testing from early debugging-oriented phases to the current process-oriented phase. Key milestones in testing's evolution include establishing testing as a separate process from development and realizing the importance of early testing. The document also addresses common myths about testing, such as that it is only one phase of the development lifecycle or that complete testing is possible. In reality, testing is a continuous process that runs parallel to development.

Uploaded by

Sasmita Padhy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 84

Introduction to Software Engineering

& Testing

Dr. Aprna Tripathi

1
Software Engineering Software Testing Slide 1
Module:1 Introduction
• Basics of Software Testing –Evolution - Myths and
Facts-Goals
• Definitions-Model for Software Testing
• Software Testing as a Process
• Software Testing Terminology and Methodology
• Software Testing Life Cycle(STLC)
• Types of testing
• Testing in the development life-cycle
• Testing principles-Verification and Validation
• Test case design strategies.
Software Engineering Software Testing Slide 2
What is Software?

The product that software professionals build and then support


over the long term.
Software encompasses: (1) instructions (computer programs)
that when executed provide desired features, function, and
performance; (2) data structures that enable the programs to
adequately store and manipulate information and (3)
documentation that describes the operation and use of the
programs.

3
Software Engineering Software Testing Slide 3
Software Engineering Definition
The seminal definition:
[Software engineering is] the establishment and use of
sound engineering principles in order to obtain
economically software that is reliable and works
efficiently on real machines.

The IEEE definition:


Software Engineering: (1) The application of a systematic,
disciplined, quantifiable approach to the development,
operation, and maintenance of software; that is, the
application of engineering to software. (2) The study of
approaches as in (1).

Software Engineering Software Testing Slide 4


Importance of Software Engineering
• More and more, individuals and society rely on
advanced software systems. We need to be able to
produce reliable and trustworthy systems economically
and quickly.
• It is usually cheaper, in the long run, to use software
engineering methods and techniques for software
systems rather than just write the programs as if it was
a personal programming project.
• For most types of system, the majority of costs are the
costs of changing the software after it has gone into
use.

5
Software Engineering Software Testing Slide 5
Software Testing

• Testing programs to establish the presence


of system defects.
• “Program testing can be used to show the
presence of bugs, but never to show their
absence!” -
Edsger Wybe Dijkstra

Software Engineering Software Testing Slide 6


Evolution phases of software testing

Software Engineering Software Testing Slide 7


Debugging-oriented Phase
(Before 1957)
• This phase is the early period of testing.
• Programs were written and then tested by the
programmers until they were sure that all the
bugs were removed.
• The term used for testing was checkout,
focused on getting the system to run.
• Till 1956, there was no clear distinction
between software development, testing, and
debugging.
Software Engineering Software Testing Slide 8
Demonstration-oriented Phase (1957–
78)
• The term ‘debugging’ continued in this phase.
• However, in 1957, the scope of checkout of a
program increased from program runs to
program correctness[Charles Baker ].
• Moreover, the purpose of checkout was to
show the absence of errors.
• There was no stress on the test case design.
• In this phase, there was a misconception that
the software could be tested exhaustively.
Software Engineering Software Testing Slide 9
Destruction-oriented Phase
(1979–82)
• Myers changed the view of testing from
‘testing is to show the absence of errors’ to
‘testing is to find more and more errors.’
• He separated debugging from testing and
stressed on the valuable test cases.
• This phase has given importance to effective
testing in comparison to exhaustive testing.
• The importance of early testing was also
realized in this phase.
Software Engineering Software Testing Slide 10
Evaluation-oriented Phase
(1983–87)
• In 1983, guidelines by the National Bureau of
Standards were released and the concept of
early testing was realized in the form of
verification and validation activities
• This phase stresses on the quality of software
products such that it can be evaluated at every
stage of development.

Software Engineering Software Testing Slide 11


Process-oriented Phase
(1996 onwards)
• Testing was established as a complete process
rather than a single phase SDLC.
• The testing process starts as soon as the
requirements for a project are specified and it
runs parallel to SDLC.
• Testing Maturity Model (TMM) for measuring
the performance of a testing process has also
been developed.
• Quantification of various parameters which
decide the performance of a testing process.
Software Engineering Software Testing Slide 12
Evolution of software testing
[Hung Q. Nguyen and Rob Pirozzi]
• The evolution of software testing was also
discussed by Hung Q. Nguyen and Rob Pirozzi
in three phases, namely Software Testing 1.0,
Software Testing 2.0, and Software Testing
3.0.
• According to this classification, the current
state-of-practice is Software Testing 3.0.

Software Engineering Software Testing Slide 13


Software Testing 1.0
• In this phase, software testing was just
considered a single phase to be performed after
coding of the software in SDLC.
• No test organization was there.
• A few testing tools were present but their use
was limited due to high cost.
• Management was not concerned with testing,
as there was no quality goal.

Software Engineering Software Testing Slide 14


Software Testing 2.0
• In this phase, software testing gained
importance in SDLC and the concept of early
testing also started.
• Testing was evolving in the direction of
planning the test resources.
• Many testing tools were also available in this
phase.

Software Engineering Software Testing Slide 15


Software Testing 3.0
• In this phase, software testing is being evolved
in the form of a process which is based on
strategic effort.
• Moreover, it should be driven by quality goals
so that all controlling and monitoring activities
can be performed by the managers.
• Thus, the management is actively involved in
this phase

Software Engineering Software Testing Slide 16


Software Testing— Myths And Facts
• Myth
– Testing is a single phase in SDLC .
• Truth
– It is a myth, at least in the academia, that software
testing is just a phase in SDLC and we perform
testing only when the running code of the module
is ready.
– But in reality, testing starts as soon as we get the
requirement specifications for the software

Software Engineering Software Testing Slide 17


• Myth
– Testing is easy.
• Truth
– This myth is more in the minds of students who
have started a career in testing.
– So the general perception is that, software testing
is an easy job, wherein test cases are executed with
testing tools only.
– But in reality, tools are there to automate the tasks
and not to carry out all testing activities.
Software Engineering Software Testing Slide 18
• Myth
– Software development is worth more than testing.
• Truth
– This myth prevails in the minds of every team
member and even in fresher's who are seeking
jobs. As a fresher, we dream of a job as a
developer.
– But testing has now become an established path for
job-seekers.
– Testing is a complete process like development.
Software Engineering Software Testing Slide 19
• Myth
– Complete testing is possible.
• Truth
– Almost every person who has not experienced the
process of designing and executing the test cases
manually feels that complete testing is possible.
– But in reality, it is not possible to provide all the
possible inputs to test the software.
– Complete testing has been replaced with effective
testing (to select and run some select test cases
Software Engineering Slide 20
such that severe bugsSoftware
areTesting
uncovered first
• Myth
– Testing starts after program development.
• Truth
• Who are not aware of testing as a process, feels
that testing cannot commence before coding.
• But, the tester performs testing at the end of
every phase of SDLC in the form of verification
and plans for the validation testing.
• Testing after coding is just a part of all the
Software Engineering Software Testing Slide 21
testing activities.
• Myth
– The purpose of testing is to check the functionality
of the software.
• Truth
– Today, all the testing activities are driven by
quality goals.
– But quality does not imply checking only the
functionalities of all the modules.
– There are various things related to quality of the
software, for which test cases must be executed.
Software Engineering Software Testing Slide 22
Software Testing Goals

Software Engineering Software Testing Slide 23


Short-term or immediate goals
• These goals are the immediate results after
performing testing.
• May be set in the individual phases of SDLC.
• Some of them are as follows:
– Bug discovery
• to find errors at any stage of software development.
– Bug prevention
• It is the consequent action of bug discovery.
• everyone in development team gets to learn how to code
safely such that the bugs discovered should not be
repeated in later stages
Software Engineering
or future projects.
Software Testing Slide 24
Long-term goals
• These goals affect the product quality in the
long run, when one cycle of the SDLC is over.
• Some of them are discussed here.
• Quality
– Since software is also a product and thorough
testing ensures superior quality.

Software Engineering Software Testing Slide 25


• Customer satisfaction
– From the users’ perspective, the prime concern of testing is
customer satisfaction only.
– Testing should be complete in the sense that it must satisfy
the user for all the specified.
– A complete testing process achieves reliability, reliability
enhances the quality, and quality in turn, increases the
customer satisfaction.

Software Engineering Software Testing Slide 26


• Risk management
– Risk is the probability that undesirable events will occur in a
system.
– Risks must be controlled to manage them with ease.
– Software testing may act as a control, which can help in
eliminating or minimizing risks

Software Engineering Software Testing Slide 27


Post-implementation goals
• These goals are important after the product is
released.
• Some of them are discussed here.
• Reduced maintenance cost
– As the software does not wear out, the only maintenance
cost in a software product is its failure due to errors.
– If testing has been done rigorously and effectively, then the
chances of failure are minimized and in turn, the
maintenance cost is reduced.

Software Engineering Software Testing Slide 28


• Improved software testing process
– A testing process for one project may not be
successful and there may be scope for improvement.
– Therefore, the bug history and post-implementation
results can be analyzed to find out snags in the
present testing process, which can be rectified in
future projects.
– Thus, the long-term post-implementation goal is to
improve the testing process for future projects.

Software Engineering Software Testing Slide 29


Module:1 Introduction
• Basics of Software Testing –Evolution - Myths and
Facts-Goals
• Definitions-Model for Software Testing
• Software Testing as a Process
• Software Testing Terminology and Methodology
• Software Testing Life Cycle(STLC)
• Types of testing
• Testing in the development life-cycle
• Testing principles-Verification and Validation
• Test case design strategies.
Software Engineering Software Testing Slide 30
Software Testing Definitions
• Myers
– Testing is the process of executing a program with
the intent of finding errors.
• Myers
– A successful test is one that uncovers an as-yet-
undiscovered error.
• W. Dijkstra
– Testing can show the presence of bugs but never
their absence.
Software Engineering Software Testing Slide 31
Software Testing Definitions
• James Bach
– Testing is a support function that helps developers look
good by finding their mistakes before anyone else does.
• E. Miller
– Program testing is a rapidly maturing area within
software engineering that is receiving increasing notice
both by computer science theoreticians and practitioners.
Its general aim is to affirm the quality of software
systems by systematically exercising the software in
carefully controlled circumstances.
Software Engineering Software Testing Slide 32
Software Testing Definitions
• Cem Kaner
– Software testing is an empirical investigation
conducted to provide stakeholders with
information about the quality of the product or
service under test, with respect to the context in
which it is intended to operate.
• Craig
– Testing is a concurrent lifecycle process of
engineering, using and maintaining testware (i.e.
testing artifacts) in order to measure and improve
the quality of the software
Software Engineering being tested.
Software Testing Slide 33
Software Testing Model
• In the testing model, we consider the related
elements and team members involved

Software Engineering Software Testing Slide 34


Module:1 Introduction
• Basics of Software Testing –Evolution - Myths and
Facts-Goals
• Definitions-Model for Software Testing
• Software Testing as a Process
• Software Testing Terminology and Methodology
• Software Testing Life Cycle(STLC)
• Types of testing
• Testing in the development life-cycle
• Testing principles-Verification and Validation
• Test case design strategies.
Software Engineering Software Testing Slide 35
Software Testing as a Process
• Software testing has also
emerged as a complete
process in software
engineering.
• Software testing starts as
soon as the requirements
are specified.
• Once the SRS document is
prepared, testing process
starts. Some examples of
test processes, such as test
plan, test design, etc.
Software Engineering Software Testing Slide 36
Software Testing as a Process
• To ensure better quality software, organization must
adopt a testing process and consider the following
points:
– Testing process should be organized such that there is enough
time for important and critical features of the software.
– Testing techniques should be adopted such that these
techniques detect maximum bugs.
– Quality factors should be quantified so that there is a clear
understanding in running the testing process.
– Testing procedures must be defined and documented.
– There must be scope for continuous process improvement.

Software Engineering Software Testing Slide 37


Module:1 Introduction
• Basics of Software Testing –Evolution - Myths and
Facts-Goals
• Definitions-Model for Software Testing
• Software Testing as a Process
• Software Testing Terminology and Methodology
• Software Testing Life Cycle(STLC)
• Types of testing
• Testing in the development life-cycle
• Testing principles-Verification and Validation
• Test case design strategies.
Software Engineering Software Testing Slide 38
Software Testing Terminology
• Failure
– When the software is tested, failure is the first term
being used.
– It means the inability of a system or component to
perform a required function according to its
specification.
– In other words, when results or behavior of the
system under test are different as compared to
specified expectations, then failure exists.

Software Engineering Software Testing Slide 39


• Fault is a condition that in actual causes a
system to produce failure.
• A bug is the result of a coding error.
• A defect is a deviation from the requirements.
• A defect does not necessarily mean there is a
bug in the code, it could be a function that was
not implemented but defined in the
requirements of the software.

Software Engineering Software Testing Slide 40


• Error Whenever a development team member
makes a mistake in any phase of SDLC, errors
are produced. It might be a typographical error,
a misleading of a specification.
• An error causes a bug and the bug in turn
causes failures.

Software Engineering Software Testing Slide 41


• Test case Test case is a well-documented procedure
designed to test the functionality of a feature in the
system.
• A test case has an identity and is associated with a
program behavior.
• Test case ID is the identification number given to
each test case.
• Purpose defines why the case is being designed.
• Preconditions for running the inputs in a system can
be defined, if required, in a test case.
Software Engineering Software Testing Slide 42
• Inputs should not be hypothetical. Actual inputs must
be provided, instead of general inputs.
• For example, if two integer numbers have to be
provided as input, then specifically mention them as
23 and 56.
• Expected outputs are the outputs which should be
produced when there is no failure.
• Testware The documents created during testing
activities are known as testware. Testware are the
documents that a test engineer produces.
Software Engineering Software Testing Slide 43
• An Incident is the symptom(s) associated with a
failure that alerts the user about the occurrence of a
failure.
• Test oracle is the means to judge the success or
failure of a test, i.e. to judge the correctness of the
system for some test.
• The simplest oracle is comparing actual results with
expected results by hand.

Software Engineering Software Testing Slide 44


Module:1 Introduction
• Basics of Software Testing –Evolution - Myths and
Facts-Goals
• Definitions-Model for Software Testing
• Software Testing as a Process
• Software Testing Terminology and Methodology
• Software Testing Life Cycle(STLC)
• Types of testing
• Testing in the development life-cycle
• Testing principles-Verification and Validation
• Test case design strategies.
Software Engineering Software Testing Slide 45
Software Testing Life Cycle(STLC)
• The testing process divided into a well-defined sequence of steps is
termed as software testing life cycle (STLC).
• The major contribution of
STLC is to involve the testers at
early stages of development.
• This has a significant benefit in
the project schedule and cost.
• The STLC also helps the
management in measuring
specific milestones.

Software Engineering Software Testing Slide 46


Test Planning
• The goal of test planning is to take into account the
issues of testing strategy, viz. resources, schedules,
risks, responsibilities, and priorities, as a roadmap.
• Following are the activities during test planning:
– Defining the test strategy.
– Estimate the number of test cases, their duration, and cost.
– Plan the resources like the manpower to test, tools required, documents
required.
– Identifying areas of risks.
– Defining the test completion criteria.
– Identification of methodologies, techniques, and tools for various test
cases.
– Identifying reporting procedures, bug classification, databases for testing,
bug severity levels, and project metrics.
Software Engineering Software Testing Slide 47
• The major output of test planning is the test plan document.
• Test plans are developed for each level of testing.
• After analyzing the issues, the following activities are
performed:
– Develop a test case format.
– Develop test case plans according to every phase of SDLC.
– Identify test cases to be automated (if applicable).
– Prioritize the test cases according to their importance and criticality.
– Define areas of stress and performance testing.
– Plan the test cycles required for regression testing.

Software Engineering Software Testing Slide 48


Test Design
• One of the major activities in testing is the design of
test design
• It includes the following critical activities.
– Determining the test objectives and their prioritization.
– Preparing list of items to be tested.
– Mapping items to test cases
– Selection of test case design techniques
– Creating test cases and test data
– Setting up the test environment and supporting tools
– Creating test procedure specification

Software Engineering Software Testing Slide 49


Test Execution
• In this phase, all test cases are executed
including verification and validation.
– Verification test cases are started at the end of each
phase of SDLC.
– Validation test cases are started after the
completion of a module

Software Engineering Software Testing Slide 50


Post-Execution/Test Review
• This phase is to analyze bug-related issues and
get feedback so that maximum number of bugs
can be removed.
• As soon as the developer gets the bug report,
he performs the following activities:
– Understanding the bug
– Reproducing the bug
– Analyzing the nature and cause of the bug

Software Engineering Software Testing Slide 51


• After this, the final bug report and associated metrics are
reviewed and analyzed for overall testing process.
• The following activities can be done:
– Reliability analysis can be performed to establish whether the software
meets the predefined reliability goals or not.
– If so, the product can be released and the decision on a release date can be
taken.
– If not, then the time and resources required to reach the reliability goals
are outlined.
– Coverage analysis can be used as an alternative criterion to stop testing.
– Overall defect analysis can identify risk areas and help focus our efforts
on quality improvement.

Software Engineering Software Testing Slide 52


Module:1 Introduction
• Basics of Software Testing –Evolution - Myths and
Facts-Goals
• Definitions-Model for Software Testing
• Software Testing as a Process
• Software Testing Terminology and Methodology
• Software Testing Life Cycle(STLC)
• Types of testing
• Testing in the development life-cycle
• Testing principles-Verification and Validation
• Test case design strategies.
Software Engineering Software Testing Slide 53
Software Testing Methodology

Software Engineering Software Testing Slide 54


Software Testing Strategy
• Testing strategy is the planning of the whole
testing process into a well-planned series of
steps.
• The components of a testing strategy are
discussed below:
– Test Factors
– Test Phase

Software Engineering Software Testing Slide 55


• Test Factors
– Test factors are risk factors or issues related to the
system under development.
– The testing process should reduce these test factors
to a prescribed level.
• Test Phase
– It refers to the phases of SDLC where testing will
be performed.
– Testing strategy may be different for different
models of SDLC, e.g. strategies will be different
Software Engineering Software Testing Slide 56
for waterfall and spiral models.
Module:1 Introduction
• Basics of Software Testing –Evolution - Myths and
Facts-Goals
• Definitions-Model for Software Testing
• Software Testing as a Process
• Software Testing Terminology and Methodology
• Software Testing Life Cycle(STLC)
• Types of testing
• Testing in the development life-cycle
• Testing principles-Verification and Validation
• Test case design strategies.
Software Engineering Software Testing Slide 57
Testing Life Cycle Model
• Verification and validation (V&V) are the
building blocks of a testing process.
• The formation of test strategy is based on these
two terms only.
• V&V can be best understood when these are
modeled in the testing process.
• This model is known as the Testing Life Cycle
Model. L

Software Engineering Software Testing Slide 58


Module:1 Introduction
• Basics of Software Testing –Evolution - Myths and
Facts-Goals
• Definitions-Model for Software Testing
• Software Testing as a Process
• Software Testing Terminology and Methodology
• Software Testing Life Cycle(STLC)
• Types of testing
• Testing in the development life-cycle
• Testing principles-Verification and Validation
• Test case design strategies.
Software Engineering Software Testing Slide 59
V-Testing Life Cycle Model
• In V-testing concept, as the development team
attempts to implement the software, the testing
team concurrently starts checking the software.
• When the project starts, both the system
development and the system test process
begin.

Software Engineering Software Testing Slide 60


V Testing Model
on the left arm of the V, the development cycle is progressing
and
on the right arm, the corresponding testing stages are moving

Software Engineering Software Testing Slide 61


Validation Activities
• Validation has the following three activities which are
also known as the three levels of validation testing
– Unit Testing
• It is a major validation effort performed on the smallest
module of the system.
– Integration Testing
• It is a validation technique which combines all unit-tested
modules and performs a test on their aggregation.
– System Testing
• The purpose is to test the validity for specific users and
environments
Software Engineering Software Testing Slide 62
Module:1 Introduction
• Basics of Software Testing –Evolution - Myths and
Facts-Goals
• Definitions-Model for Software Testing
• Software Testing as a Process
• Software Testing Terminology and Methodology
• Software Testing Life Cycle(STLC)
• Types of testing
• Testing in the development life-cycle
• Testing principles-Verification and Validation
• Test case design strategies.
Software Engineering Software Testing Slide 63
Software Testing Techniques
• The technique which will meet both the objectives of
effective test case design, i.e.
– coverage of testing domain and
– detection of maximum number of bugs.
• The technique used to design effective test case is
called Software Testing Technique.
• These techniques can be categorized into two parts:
– (a) static testing and
– (b) dynamic testing.

Software Engineering Software Testing Slide 64


Static Testing
• It is a technique for assessing the structural
characteristics of source code, design
specifications or any notational representation
that conforms to well defined syntactic rules.
• It is called as static because we never execute
the code in this technique.
• For example, the structure of code is examined
by the teams but the code is not executed

Software Engineering Software Testing Slide 65


Dynamic Testing
• All the methods that execute the code to test a
software are known as dynamic testing
techniques.
• In this technique, the code is run on a number
of inputs provided by the user and the
corresponding results are checked.
• This type of testing is further divided into two
parts:
– (a) black-box testing and
Software– (b) white-box testing.Software Testing
Engineering Slide 66
Black-box testing
• This technique takes care of the inputs given to
a system and the output is received after
processing in the system.
• Black-box testing is not concerned with
– What is being processed in the system?
– How does the system perform these operations?
• It checks the functionality of the system only.
• It is also known as functional testing. It is used
for system testing under validation.
Software Engineering Software Testing Slide 67
White-box testing
• This technique complements black-box testing.
• Every design feature and its corresponding
code is checked logically with every possible
path execution.
• So, it takes care of the structural paths instead
of just outputs.
• It is also known as structural testing and is
used for unit testing under verification

Software Engineering Software Testing Slide 68


Bugs
• even if we correctly discover
all cases for placing words on
the Scrabble board, it is very likely that we'll have
some bugs when we code it
– bugs are inevitable in any complex software system
– a bug can be very visible or can hide in your code until a much
later date
• we can hunt down the cause of a known bug using
print statements or our IDE's debugger ...
but how do we discover all of the bugs in our
system, even those with low visibility?
– ANSWER: testing and Quality Assurance practices

Software Engineering Software Testing Slide 69 69


Faults
What is the difference between a fault and
an error? What are some kinds of faults?
 error: incorrect software behavior
 example: message box text said "Welcome null."
 fault: mechanical or algorithmic cause of error
 example: account name field is not set properly.
 a fault is not an error, but it can lead to them
 need requirements to specify desired behavior, and need to see
system deviate from that behavior, to have a failure

Software Engineering Software Testing Slide 70 70


Defect, Failure and Fault
• Defect
– Commonly refers to several troubles with the software
products, with its external behavior or with its internal
features.
• Failure
– The incapacity of a system to conduct its required functions
within clarified performance requirements.
• Fault
– A false, wrong step, process or data definition in a software
product.
– Fault refers to an underlying condition within software that
causes failure to happen.

Software Engineering Software Testing Slide 71


Error
• Error
– A person act that generates an erroneous result.
– Consequently, the term failure refers to a behavioral
deviation from the user wants or the product
specification.
– Error refers to a missing or wrong person action
resulting in certain fault being injected into software.
– Errors also include error sources such as human
misunderstandings, dissensions, misinterpretation and
so on.

Software Engineering Software Testing Slide 72


Bug
• Any Missing functionality or any action that is
performed by the system which is not supposed to
be performed is a Bug.
"Is an error found BEFORE the application goes
into production?"
Any of the following may be the reason for birth
of Bug
1. Wrong functionality
2. Missing functionality
3. Extra or unwanted functionality

Software Engineering Software Testing Slide 73


• A bug is the result of a coding error.
• A defect is a deviation from the requirements.
• A defect does not necessarily mean there is a
bug in the code, it could be a function that was
not implemented but defined in the
requirements of the software.

Software Engineering Software Testing Slide 74


Some types of faults
• algorithmic faults
– design produces a poor algorithm
– fail to implement the software to match the spec
– subsystems don't communicate properly

• mechanical faults
– earthquake
– virtual machine failure
(why is this a "mechanical" fault?)

Software Engineering Software Testing Slide 75 75


Testing concepts
What is a test case? What is a failure? How are
they related?
 failure: particular instance of a general error, which
is caused by a fault

 test case: set of inputs


and outputs to cause
failures

Software Engineering Software Testing Slide 76 76


Test cases
What are the five elements of a well-written test
case, according to the authors?
(Hint: one of these is an "oracle." What is
this?)
 name: descriptive name of what is being tested
 location: full path/URL to test
 input: arguments, commands, input files to use
 entered by tester or test driver
 oracle: expected output
 log: actual output produced
Software Engineering Software Testing Slide 77 77
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
• Integration 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 Software Testing Slide 78


Testing phases

Component Integration
testing testing

Software developer Independent testing team

Software Engineering Software Testing Slide 79


A Strategy for Testing Conventional
Software

System Testing
Validation Testing
Integration Testing
Unit Testing

Code
Design

Requirements
System Engineering

80
Software Engineering Software Testing Slide 80
Levels of Testing for Conventional
Software
• Unit testing
– Concentrates on each component/function of the software as implemented in
the source code
• Integration testing
– Focuses on the design and construction of the software architecture
• Validation testing
– Requirements are validated against the constructed software
• System testing
– The software and other system elements are tested as a whole

81
Software Engineering Software Testing Slide 81
Testing Strategy applied to Conventional
Software
• Unit testing
– Exercises specific paths in a component's control structure to ensure complete
coverage and maximum error detection
– Components are then assembled and integrated
• Integration testing
– Focuses on inputs and outputs, and how well the components fit together and
work together
• Validation testing
– Provides final assurance that the software meets all functional, behavioral, and
performance requirements
• System testing
– Verifies that all system elements (software, hardware, people, databases) mesh
properly and that overall system function and performance is achieved

82
Software Engineering Software Testing Slide 82
Key points

• Test parts of a system which are commonly used


rather than those which are rarely executed
• Equivalence partitions are sets of test cases where
the program should behave in an equivalent way
• Black-box testing is based on the system
specification
• Structural testing identifies test cases which cause
all paths through the program to be executed

Software Engineering Software Testing Slide 83


Key points
• Test coverage measures ensure that all
statements have been executed at least once.
• Interface defects arise because of specification
misreading, misunderstanding, errors or invalid
timing assumptions
• To test object classes, test all operations,
attributes and states
• Integrate object-oriented systems around
clusters of objects

Software Engineering Software Testing Slide 84

You might also like