SlideShare a Scribd company logo
Principles of Testing
1 Principles 2 Lifecycle
4 Dynamic test
techniques
3 Static testing
5 Management 6 Tools
Software Testing
ISTQB / ISEB Foundation Exam Practice
Chapter 1
Contents
Why testing is necessary
Fundamental test process
Psychology of testing
Re-testing and regression testing
Expected results
Prioritisation of tests
Principles
1 2 3
4 5 6
ISTQB / ISEB Foundation Exam Practice
Testing terminology

No generally accepted set of testing
definitions used world wide

New standard BS 7925-1
- Glossary of testing terms (emphasis on component
Glossary of testing terms (emphasis on component
testing)
testing)
- most recent
most recent
- developed by a working party of the BCS SIGIST
developed by a working party of the BCS SIGIST
- adopted by the ISEB / ISTQB
adopted by the ISEB / ISTQB
What is a “bug”?

Error: a human action that produces an
incorrect result

Fault: a manifestation of an error in software
- also known as a defect or bug
also known as a defect or bug
- if executed, a fault may cause a failure
if executed, a fault may cause a failure

Failure: deviation of the software from its
expected delivery or service
- (found defect)
(found defect)
Failure is an event; fault is a state of
the software, caused by an error
Error - Fault - Failure
A person makes
an error ...
… that creates a
fault in the
software ...
… that can cause
a failure
in operation
Reliability versus faults

Reliability: the probability that software will
not cause the failure of the system for a
specified time under specified conditions
- Can a system be fault-free? (zero faults, right first
Can a system be fault-free? (zero faults, right first
time)
time)
- Can a software system be reliable but still have
Can a software system be reliable but still have
faults?
faults?
- Is a “fault-free” software application always
Is a “fault-free” software application always
reliable?
reliable?
Why do faults occur in software?

software is written by human beings
- who know something, but not everything
who know something, but not everything
- who have skills, but aren’t perfect
who have skills, but aren’t perfect
- who do make mistakes (errors)
who do make mistakes (errors)

under increasing pressure to deliver to strict
deadlines
- no time to check but assumptions may be wrong
no time to check but assumptions may be wrong
- systems may be incomplete
systems may be incomplete

if you have ever written software ...
What do software faults cost?

huge sums
- Ariane 5 ($7billion)
Ariane 5 ($7billion)
- Mariner space probe to Venus ($250m)
Mariner space probe to Venus ($250m)
- American Airlines ($50m)
American Airlines ($50m)

very little or nothing at all
- minor inconvenience
minor inconvenience
- no visible or physical detrimental impact
no visible or physical detrimental impact

software is not “linear”:
- small input may have very large effect
small input may have very large effect
Safety-critical systems

software faults can cause death or injury
- radiation treatment kills patients (Therac-25)
radiation treatment kills patients (Therac-25)
- train driver killed
train driver killed
- aircraft crashes (Airbus & Korean Airlines)
aircraft crashes (Airbus & Korean Airlines)
- bank system overdraft letters cause suicide
bank system overdraft letters cause suicide
So why is testing necessary?
- because software is likely to have faults
because software is likely to have faults
- to learn about the reliability of the software
to learn about the reliability of the software
- to fill the time between delivery of the software and the
to fill the time between delivery of the software and the
release date
release date
- to prove that the software has no faults
to prove that the software has no faults
- because testing is included in the project plan
because testing is included in the project plan
- because failures can be very expensive
because failures can be very expensive
- to avoid being sued by customers
to avoid being sued by customers
- to stay in business
to stay in business
Why not just "test everything"?
system has
20 screens
Average: 10 fields / screen
2 types input / field
(date as Jan 3 or 3/1)
(number as integer or decimal)
Around 100 possible values
Total for 'exhaustive' testing:
20 x 4 x 3 x 10 x 2 x 100 =
20 x 4 x 3 x 10 x 2 x 100 = 480,000 tests
480,000 tests
If 1 second per test, 8000 mins, 133 hrs, 17.7 days
(not counting finger trouble, faults or retest)
Avr. 4 menus
3 options / menu
10 secs = 34 wks, 1 min = 4 yrs, 10 min = 40 yrs
Exhaustive testing?

What is exhaustive testing?
- when all the testers are exhausted
when all the testers are exhausted
- when all the planned tests have been executed
when all the planned tests have been executed
- exercising all combinations of inputs and preconditions
exercising all combinations of inputs and preconditions

How much time will exhaustive testing take?
- infinite time
infinite time
- not much time
not much time
- impractical amount of time
impractical amount of time
How much testing is enough?
- it’s never enough
it’s never enough
- when you have done what you planned
when you have done what you planned
- when your customer/user is happy
when your customer/user is happy
- when you have proved that the system works
when you have proved that the system works
correctly
correctly
- when you are confident that the system works
when you are confident that the system works
correctly
correctly
- it depends on the risks for your system
it depends on the risks for your system
How much testing?

It depends on RISK
RISK
- risk
risk of missing important faults
of missing important faults
- risk
risk of incurring failure costs
of incurring failure costs
- risk
risk of releasing untested or under-tested software
of releasing untested or under-tested software
- risk
risk of losing credibility and market share
of losing credibility and market share
- risk
risk of missing a market window
of missing a market window
- risk
risk of over-testing, ineffective testing
of over-testing, ineffective testing
- what not to test (this time)
what not to test (this time)

use RISK
RISK to
- allocate the time available for testing by
allocate the time available for testing by
prioritising testing ...
prioritising testing ...
So little time, so much to test ..

test time will always be limited

use RISK
RISK to determine:
- what to test first
what to test first
- what to test most
what to test most
- how thoroughly to test each item
how thoroughly to test each item } i.e. where to
place emphasis
Most important principle
Prioritise tests
so that,
whenever you stop testing,
you have done the best testing
in the time available.
Testing and quality

testing measures software quality

testing can find faults; when they are
removed, software quality (and possibly
reliability) is improved

what does testing test?
- system function, correctness of operation
system function, correctness of operation
- non-functional qualities: reliability, usability,
non-functional qualities: reliability, usability,
maintainability, reusability, testability, etc.
maintainability, reusability, testability, etc.
Other factors that influence testing

contractual requirements

legal requirements

industry-specific requirements
- e.g. pharmaceutical industry (FDA), compiler
e.g. pharmaceutical industry (FDA), compiler
standard tests, safety-critical or safety-related such
standard tests, safety-critical or safety-related such
as railroad switching, air traffic control
as railroad switching, air traffic control
It is difficult to determine
how much testing is enough
but it is not impossible
Contents
Why testing is necessary
Fundamental test process
Psychology of testing
Re-testing and regression testing
Expected results
Prioritisation of tests
Principles
1 2 3
4 5 6
ISTQB / ISEB Foundation Exam Practice
Test Planning - different levels
Test
Policy
Test
Strategy
Company level
High Level
Test Plan
High Level
Test Plan
Project level (IEEE 829)
(one for each project)
Detailed
Test Plan
Detailed
Test Plan
Detailed
Test Plan
Detailed
Test Plan
Test stage level (IEEE 829)
(one for each stage within a project,
e.g. Component, System, etc.)
The test process
specification execution recording
check
completion
Planning (detailed level)
Test planning

how the test strategy and project test plan
apply to the software under test

document any exceptions to the test strategy
- e.g. only one test case design technique needed for
e.g. only one test case design technique needed for
this functional area because it is less critical
this functional area because it is less critical

other software needed for the tests, such as
stubs and drivers, and environment details

set test completion criteria
Test specification
specification execution recording
check
completion
Identify conditions
Design test cases
Build tests
Planning (detailed level)
A good test case

effective

exemplary

evolvable

economic
Finds faults
Represents others
Easy to maintain
Cheap to use
Test specification

test specification can be broken down into three
distinct tasks:
1.
1. identify:
identify: determine ‘what’ is to be tested (identify
determine ‘what’ is to be tested (identify
test conditions) and prioritise
test conditions) and prioritise
2.
2. design:
design: determine ‘how’ the ‘what’ is to be tested
determine ‘how’ the ‘what’ is to be tested
(i.e. design test cases)
(i.e. design test cases)
3.
3. build:
build: implement the tests (data, scripts, etc.)
implement the tests (data, scripts, etc.)
Task 1: identify conditions

list the conditions that we would like to test:
- use the test design techniques specified in the test plan
use the test design techniques specified in the test plan
- there may be many conditions for each system function or
there may be many conditions for each system function or
attribute
attribute
- e.g.
e.g.
• “
“life assurance for a winter sportsman”
life assurance for a winter sportsman”
• “
“number items ordered > 99”
number items ordered > 99”
• “
“date = 29-Feb-2004”
date = 29-Feb-2004”

prioritise the test conditions
- must ensure most important conditions are covered
must ensure most important conditions are covered
(determine ‘what’ is to be tested and prioritise)
Selecting test conditions
Importance
Time
Best set


First set
Task 2: design test cases

design test input and test data
- each test exercises one or more test conditions
each test exercises one or more test conditions

determine expected results
- predict the outcome of each test case, what is
predict the outcome of each test case, what is
output, what is changed and what is not changed
output, what is changed and what is not changed

design sets of tests
- different test sets for different objectives such as
different test sets for different objectives such as
regression, building confidence, and finding faults
regression, building confidence, and finding faults
(determine ‘how’ the ‘what’ is to be tested)
Designing test cases
Importance
Time
Most important
test conditions
Least important
test conditions
Test cases
Task 3: build test cases

prepare test scripts
- less system knowledge tester has the more detailed the
less system knowledge tester has the more detailed the
scripts will have to be
scripts will have to be
- scripts for tools have to specify every detail
scripts for tools have to specify every detail

prepare test data
- data that must exist in files and databases at the start of
data that must exist in files and databases at the start of
the tests
the tests

prepare expected results
- should be defined before the test is executed
should be defined before the test is executed
(implement the test cases)
Test execution
specification execution recording
check
completion
Planning (detailed level)
Execution

Execute prescribed test cases
- most important ones first
most important ones first
- would not execute all test cases if
would not execute all test cases if
• testing only fault fixes
testing only fault fixes
• too many faults found by early test cases
too many faults found by early test cases
• time pressure
time pressure
- can be performed manually or automated
can be performed manually or automated
Test recording
specification execution recording
check
completion
Planning (detailed level)
Test recording 1

The test record contains:
- identities and versions (unambiguously) of
identities and versions (unambiguously) of
• software under test
software under test
• test specifications
test specifications

Follow the plan
- mark off progress on test script
mark off progress on test script
- document actual outcomes from the test
document actual outcomes from the test
- capture any other ideas you have for new test cases
capture any other ideas you have for new test cases
- note that these records are used to establish that all test
note that these records are used to establish that all test
activities have been carried out as specified
activities have been carried out as specified
Test recording 2

Compare actual outcome with expected outcome. Log
discrepancies accordingly:
- software fault
software fault
- test fault (e.g. expected results wrong)
test fault (e.g. expected results wrong)
- environment or version fault
environment or version fault
- test run incorrectly
test run incorrectly

Log coverage levels achieved (for measures specified
as test completion criteria)

After the fault has been fixed, repeat the required test
activities (execute, design, plan)
Check test completion
specification execution recording
check
completion
Planning (detailed level)
Check test completion

Test completion criteria were specified in the
test plan

If not met, need to repeat test activities, e.g.
test specification to design more tests
specification execution recording
check
completion
Coverage too low
Coverage
OK
Test completion criteria

Completion or exit criteria apply to all levels
of testing - to determine when to stop
- coverage, using a measurement technique, e.g.
coverage, using a measurement technique, e.g.
• branch coverage for unit testing
branch coverage for unit testing
• user requirements
user requirements
• most frequently used transactions
most frequently used transactions
- faults found (e.g. versus expected)
faults found (e.g. versus expected)
- cost or time
cost or time
Comparison of tasks
Clerical
Intellectual
one-off
activity
activity
repeated
many times
Governs the
quality of tests
Good to
automate
Execute
Recording
Planning
Specification
Contents
Why testing is necessary
Fundamental test process
Psychology of testing
Re-testing and regression testing
Expected results
Prioritisation of tests
Principles
1 2 3
4 5 6
ISTQB / ISEB Foundation Exam Practice
Why test?

build confidence

prove that the software is correct

demonstrate conformance to requirements

find faults

reduce costs

show system meets user needs

assess the software quality
Fault found
Faults found
Confidence
Time
Confidence
No faults found = confidence?
Few
Faults
Many
Faults
Few
Faults
Few
Faults
Few
Faults
You may
be here
You think
you are here
Test
Quality
Low
High
Software Quality
Low High
Assessing software quality
A traditional testing approach

Show that the system:
- does what it should
does what it should
- doesn't do what it shouldn't
doesn't do what it shouldn't
Fastest achievement: easy test cases
Goal: show
working
Success: system
works
Result: faults left in
A better testing approach

Show that the system:
- does what it shouldn't
does what it shouldn't
- doesn't do what it should
doesn't do what it should
Fastest achievement: difficult test cases
Goal: find
faults
Success: system
fails
Result: fewer faults left in
The testing paradox
Purpose of testing: to find faults
The best way to build confidence
is to try to destroy it
Purpose of testing: build confidence
Finding faults destroys confidence
Purpose of testing: destroy confidence
Who wants to be a tester?

A destructive process

Bring bad news (“your baby is ugly”)

Under worst time pressure (at the end)

Need to take a different view, a different
mindset (“What if it isn’t?”, “What could go
wrong?”)

How should fault information be
communicated (to authors and managers?)
Tester’s have the right to:
- accurate information about progress and changes
accurate information about progress and changes
- insight from developers about areas of the software
insight from developers about areas of the software
- delivered code tested to an agreed standard
delivered code tested to an agreed standard
- be regarded as a professional (no abuse!)
be regarded as a professional (no abuse!)
- find faults!
find faults!
- challenge specifications and test plans
challenge specifications and test plans
- have reported faults taken seriously (non-reproducible)
have reported faults taken seriously (non-reproducible)
- make predictions about future fault levels
make predictions about future fault levels
- improve your own testing process
improve your own testing process
Testers have responsibility to:
- follow the test plans, scripts etc. as documented
follow the test plans, scripts etc. as documented
- report faults objectively and factually (no abuse!)
report faults objectively and factually (no abuse!)
- check tests are correct before reporting s/w faults
check tests are correct before reporting s/w faults
- remember it is the software, not the programmer,
remember it is the software, not the programmer,
that you are testing
that you are testing
- assess risk objectively
assess risk objectively
- prioritise what you report
prioritise what you report
- communicate the truth
communicate the truth
Independence

Test your own work?
- find 30% - 50% of your own faults
find 30% - 50% of your own faults
- same assumptions and thought processes
same assumptions and thought processes
- see what you meant or want to see, not what is there
see what you meant or want to see, not what is there
- emotional attachment
emotional attachment
• don’t want to find faults
don’t want to find faults
• actively want NOT to find faults
actively want NOT to find faults
Levels of independence

None: tests designed by the person who wrote
the software

Tests designed by a different person

Tests designed by someone from a different
department or team (e.g. test team)

Tests designed by someone from a different
organisation (e.g. agency)

Tests generated by a tool (low quality tests?)
Contents
Why testing is necessary
Fundamental test process
Psychology of testing
Re-testing and regression testing
Expected results
Prioritisation of tests
Principles
1 2 3
4 5 6
ISTQB / ISEB Foundation Exam Practice
Re-testing after faults are fixed

Run a test, it fails, fault reported

New version of software with fault “fixed”

Re-run the same test (i.e. re-test)
- must be exactly repeatable
must be exactly repeatable
- same environment, versions (except for the software
same environment, versions (except for the software
which has been intentionally changed!)
which has been intentionally changed!)
- same inputs and preconditions
same inputs and preconditions

If test now passes, fault has been fixed correctly
- or has it?
Re-testing (re-running failed tests)
x
x
x
x
New faults introduced by the first
fault fix not found during re-testing
Re-test to check
Fault now fixed

Regression test

to look for any unexpected side-effects
x
x
x
x

Can’t guarantee
to find them all
Regression testing 1

misnomer: "anti-regression" or "progression"

standard set of tests - regression test pack

at any level (unit, integration, system,
acceptance)

well worth automating

a developing asset but needs to be maintained
Regression testing 2

Regression tests are performed
- after software changes, including faults fixed
after software changes, including faults fixed
- when the environment changes, even if application
when the environment changes, even if application
functionality stays the same
functionality stays the same
- for emergency fixes (possibly a subset)
for emergency fixes (possibly a subset)

Regression test suites
- evolve over time
evolve over time
- are run often
are run often
- may become rather large
may become rather large
Regression testing 3

Maintenance of the regression test pack
- eliminate repetitive tests (tests which test the same
eliminate repetitive tests (tests which test the same
test condition)
test condition)
- combine test cases (e.g. if they are always run
combine test cases (e.g. if they are always run
together)
together)
- select a different subset of the full regression suite to
select a different subset of the full regression suite to
run each time a regression test is needed
run each time a regression test is needed
- eliminate tests which have not found a fault for a
eliminate tests which have not found a fault for a
long time (e.g. old fault fix tests)
long time (e.g. old fault fix tests)
Regression testing and automation

Test execution tools (e.g. capture replay) are
regression testing tools - they re-execute tests
which have already been executed

Once automated, regression tests can be run as
often as desired (e.g. every night)

Automating tests is not trivial (generally takes 2 to
10 times longer to automate a test than to run it
manually

Don’t automate everything - plan what to automate
first, only automate if worthwhile
Contents
Why testing is necessary
Fundamental test process
Psychology of testing
Re-testing and regression testing
Expected results
Prioritisation of tests
Principles
1 2 3
4 5 6
ISTQB / ISEB Foundation Exam Practice
Expected results

Should be predicted in advance as part of the test
design process
- ‘
‘Oracle Assumption’ assumes that correct outcome can be
Oracle Assumption’ assumes that correct outcome can be
predicted.
predicted.

Why not just look at what the software does and
assess it at the time?
- subconscious desire for the test to pass - less work to do,
subconscious desire for the test to pass - less work to do,
no incident report to write up
no incident report to write up
- it looks plausible, so it must be OK - less rigorous than
it looks plausible, so it must be OK - less rigorous than
calculating in advance and comparing
calculating in advance and comparing
A test
A Program:
Source: Carsten Jorgensen, Delta, Denmark
inputs
expected
outputs
3
8
6?
10?
Read A
IF (A = 8) THEN
PRINT (“10”)
ELSE
PRINT (2*A)
Contents
Why testing is necessary
Fundamental test process
Psychology of testing
Re-testing and regression testing
Expected results
Prioritisation of tests
Principles
1 2 3
4 5 6
ISTQB / ISEB Foundation Exam Practice
Prioritising tests

We can’t test everything

There is never enough time to do all the
testing you would like

So what testing should you do?
Most important principle
Prioritise tests
so that,
whenever you stop testing,
you have done the best testing
in the time available.
How to prioritise?

Possible ranking criteria (all risk based)
- test where a failure would be most severe
test where a failure would be most severe
- test where failures would be most visible
test where failures would be most visible
- test where failures are most likely
test where failures are most likely
- ask the customer to prioritise the requirements
ask the customer to prioritise the requirements
- what is most critical to the customer’s business
what is most critical to the customer’s business
- areas changed most often
areas changed most often
- areas with most problems in the past
areas with most problems in the past
- most complex areas, or technically critical
most complex areas, or technically critical
Summary: Key Points
Testing is necessary because people make errors
The test process: planning, specification, execution,
recording, checking completion
Independence & relationships are important in testing
Re-test fixes; regression test for the unexpected
Expected results from a specification in advance
Prioritise to do the best testing in the time you have
Principles
1 2 3
4 5 6
ISTQB / ISEB Foundation Exam Practice

More Related Content

PPT
NG_TEST_Presentation_0510
PPT
NGTEST_Presentation
PPT
NG_TEST_SR_Presentation
PPT
ISTQBCH foundation level chapter 01 fundamentals of testing
PPT
Software testing overview subbu
PPT
Software testing overview by subbu
PPT
Software Testing_Overview
NG_TEST_Presentation_0510
NGTEST_Presentation
NG_TEST_SR_Presentation
ISTQBCH foundation level chapter 01 fundamentals of testing
Software testing overview subbu
Software testing overview by subbu
Software Testing_Overview

Similar to ISTQB Chapter 1 Fundamentals of Testing CTFL (20)

PPT
ISTQB / ISEB Foundation Exam Practice -1
PPT
ISTQB, ISEB Lecture Notes
PPT
Software Testing- Principles of testing- Mazenet Solution
PPTX
1 testing fundamentals
PPTX
Software engineering quality assurance and testing
PPTX
Fundamentals of Testing Section 1/6
DOCX
Istqb v.1.2
PPT
ISTQBCH2.ppt
PPT
ISTQBCH2.ppt
PPT
I ntroduction to software testing part1
PPT
SoftwareTesing_UNIT-1use it my teacher give it
PPT
AiTi Education Software Testing Session 01 a
PPS
ISTQB Foundation - Chapter 2
PPT
Testing- Fundamentals of Testing-Mazenet solution
PPT
Software Testing ISTQB study material.ppt
PPTX
Manual testing
DOC
Lesson 7...Question Part 1
PPT
Software Testing Life Cycle
PPT
ISTQB / ISEB Foundation Exam Practice - 2
PPTX
Fundamentals of testing
ISTQB / ISEB Foundation Exam Practice -1
ISTQB, ISEB Lecture Notes
Software Testing- Principles of testing- Mazenet Solution
1 testing fundamentals
Software engineering quality assurance and testing
Fundamentals of Testing Section 1/6
Istqb v.1.2
ISTQBCH2.ppt
ISTQBCH2.ppt
I ntroduction to software testing part1
SoftwareTesing_UNIT-1use it my teacher give it
AiTi Education Software Testing Session 01 a
ISTQB Foundation - Chapter 2
Testing- Fundamentals of Testing-Mazenet solution
Software Testing ISTQB study material.ppt
Manual testing
Lesson 7...Question Part 1
Software Testing Life Cycle
ISTQB / ISEB Foundation Exam Practice - 2
Fundamentals of testing
Ad

Recently uploaded (20)

PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Approach and Philosophy of On baking technology
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Big Data Technologies - Introduction.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Modernizing your data center with Dell and AMD
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
cuic standard and advanced reporting.pdf
PPTX
A Presentation on Artificial Intelligence
PDF
Empathic Computing: Creating Shared Understanding
PDF
Encapsulation_ Review paper, used for researhc scholars
Diabetes mellitus diagnosis method based random forest with bat algorithm
Understanding_Digital_Forensics_Presentation.pptx
CIFDAQ's Market Insight: SEC Turns Pro Crypto
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Approach and Philosophy of On baking technology
Per capita expenditure prediction using model stacking based on satellite ima...
NewMind AI Weekly Chronicles - August'25 Week I
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Advanced methodologies resolving dimensionality complications for autism neur...
Big Data Technologies - Introduction.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
Modernizing your data center with Dell and AMD
Chapter 3 Spatial Domain Image Processing.pdf
cuic standard and advanced reporting.pdf
A Presentation on Artificial Intelligence
Empathic Computing: Creating Shared Understanding
Encapsulation_ Review paper, used for researhc scholars
Ad

ISTQB Chapter 1 Fundamentals of Testing CTFL

  • 1. Principles of Testing 1 Principles 2 Lifecycle 4 Dynamic test techniques 3 Static testing 5 Management 6 Tools Software Testing ISTQB / ISEB Foundation Exam Practice Chapter 1
  • 2. Contents Why testing is necessary Fundamental test process Psychology of testing Re-testing and regression testing Expected results Prioritisation of tests Principles 1 2 3 4 5 6 ISTQB / ISEB Foundation Exam Practice
  • 3. Testing terminology  No generally accepted set of testing definitions used world wide  New standard BS 7925-1 - Glossary of testing terms (emphasis on component Glossary of testing terms (emphasis on component testing) testing) - most recent most recent - developed by a working party of the BCS SIGIST developed by a working party of the BCS SIGIST - adopted by the ISEB / ISTQB adopted by the ISEB / ISTQB
  • 4. What is a “bug”?  Error: a human action that produces an incorrect result  Fault: a manifestation of an error in software - also known as a defect or bug also known as a defect or bug - if executed, a fault may cause a failure if executed, a fault may cause a failure  Failure: deviation of the software from its expected delivery or service - (found defect) (found defect) Failure is an event; fault is a state of the software, caused by an error
  • 5. Error - Fault - Failure A person makes an error ... … that creates a fault in the software ... … that can cause a failure in operation
  • 6. Reliability versus faults  Reliability: the probability that software will not cause the failure of the system for a specified time under specified conditions - Can a system be fault-free? (zero faults, right first Can a system be fault-free? (zero faults, right first time) time) - Can a software system be reliable but still have Can a software system be reliable but still have faults? faults? - Is a “fault-free” software application always Is a “fault-free” software application always reliable? reliable?
  • 7. Why do faults occur in software?  software is written by human beings - who know something, but not everything who know something, but not everything - who have skills, but aren’t perfect who have skills, but aren’t perfect - who do make mistakes (errors) who do make mistakes (errors)  under increasing pressure to deliver to strict deadlines - no time to check but assumptions may be wrong no time to check but assumptions may be wrong - systems may be incomplete systems may be incomplete  if you have ever written software ...
  • 8. What do software faults cost?  huge sums - Ariane 5 ($7billion) Ariane 5 ($7billion) - Mariner space probe to Venus ($250m) Mariner space probe to Venus ($250m) - American Airlines ($50m) American Airlines ($50m)  very little or nothing at all - minor inconvenience minor inconvenience - no visible or physical detrimental impact no visible or physical detrimental impact  software is not “linear”: - small input may have very large effect small input may have very large effect
  • 9. Safety-critical systems  software faults can cause death or injury - radiation treatment kills patients (Therac-25) radiation treatment kills patients (Therac-25) - train driver killed train driver killed - aircraft crashes (Airbus & Korean Airlines) aircraft crashes (Airbus & Korean Airlines) - bank system overdraft letters cause suicide bank system overdraft letters cause suicide
  • 10. So why is testing necessary? - because software is likely to have faults because software is likely to have faults - to learn about the reliability of the software to learn about the reliability of the software - to fill the time between delivery of the software and the to fill the time between delivery of the software and the release date release date - to prove that the software has no faults to prove that the software has no faults - because testing is included in the project plan because testing is included in the project plan - because failures can be very expensive because failures can be very expensive - to avoid being sued by customers to avoid being sued by customers - to stay in business to stay in business
  • 11. Why not just "test everything"? system has 20 screens Average: 10 fields / screen 2 types input / field (date as Jan 3 or 3/1) (number as integer or decimal) Around 100 possible values Total for 'exhaustive' testing: 20 x 4 x 3 x 10 x 2 x 100 = 20 x 4 x 3 x 10 x 2 x 100 = 480,000 tests 480,000 tests If 1 second per test, 8000 mins, 133 hrs, 17.7 days (not counting finger trouble, faults or retest) Avr. 4 menus 3 options / menu 10 secs = 34 wks, 1 min = 4 yrs, 10 min = 40 yrs
  • 12. Exhaustive testing?  What is exhaustive testing? - when all the testers are exhausted when all the testers are exhausted - when all the planned tests have been executed when all the planned tests have been executed - exercising all combinations of inputs and preconditions exercising all combinations of inputs and preconditions  How much time will exhaustive testing take? - infinite time infinite time - not much time not much time - impractical amount of time impractical amount of time
  • 13. How much testing is enough? - it’s never enough it’s never enough - when you have done what you planned when you have done what you planned - when your customer/user is happy when your customer/user is happy - when you have proved that the system works when you have proved that the system works correctly correctly - when you are confident that the system works when you are confident that the system works correctly correctly - it depends on the risks for your system it depends on the risks for your system
  • 14. How much testing?  It depends on RISK RISK - risk risk of missing important faults of missing important faults - risk risk of incurring failure costs of incurring failure costs - risk risk of releasing untested or under-tested software of releasing untested or under-tested software - risk risk of losing credibility and market share of losing credibility and market share - risk risk of missing a market window of missing a market window - risk risk of over-testing, ineffective testing of over-testing, ineffective testing
  • 15. - what not to test (this time) what not to test (this time)  use RISK RISK to - allocate the time available for testing by allocate the time available for testing by prioritising testing ... prioritising testing ... So little time, so much to test ..  test time will always be limited  use RISK RISK to determine: - what to test first what to test first - what to test most what to test most - how thoroughly to test each item how thoroughly to test each item } i.e. where to place emphasis
  • 16. Most important principle Prioritise tests so that, whenever you stop testing, you have done the best testing in the time available.
  • 17. Testing and quality  testing measures software quality  testing can find faults; when they are removed, software quality (and possibly reliability) is improved  what does testing test? - system function, correctness of operation system function, correctness of operation - non-functional qualities: reliability, usability, non-functional qualities: reliability, usability, maintainability, reusability, testability, etc. maintainability, reusability, testability, etc.
  • 18. Other factors that influence testing  contractual requirements  legal requirements  industry-specific requirements - e.g. pharmaceutical industry (FDA), compiler e.g. pharmaceutical industry (FDA), compiler standard tests, safety-critical or safety-related such standard tests, safety-critical or safety-related such as railroad switching, air traffic control as railroad switching, air traffic control It is difficult to determine how much testing is enough but it is not impossible
  • 19. Contents Why testing is necessary Fundamental test process Psychology of testing Re-testing and regression testing Expected results Prioritisation of tests Principles 1 2 3 4 5 6 ISTQB / ISEB Foundation Exam Practice
  • 20. Test Planning - different levels Test Policy Test Strategy Company level High Level Test Plan High Level Test Plan Project level (IEEE 829) (one for each project) Detailed Test Plan Detailed Test Plan Detailed Test Plan Detailed Test Plan Test stage level (IEEE 829) (one for each stage within a project, e.g. Component, System, etc.)
  • 21. The test process specification execution recording check completion Planning (detailed level)
  • 22. Test planning  how the test strategy and project test plan apply to the software under test  document any exceptions to the test strategy - e.g. only one test case design technique needed for e.g. only one test case design technique needed for this functional area because it is less critical this functional area because it is less critical  other software needed for the tests, such as stubs and drivers, and environment details  set test completion criteria
  • 23. Test specification specification execution recording check completion Identify conditions Design test cases Build tests Planning (detailed level)
  • 24. A good test case  effective  exemplary  evolvable  economic Finds faults Represents others Easy to maintain Cheap to use
  • 25. Test specification  test specification can be broken down into three distinct tasks: 1. 1. identify: identify: determine ‘what’ is to be tested (identify determine ‘what’ is to be tested (identify test conditions) and prioritise test conditions) and prioritise 2. 2. design: design: determine ‘how’ the ‘what’ is to be tested determine ‘how’ the ‘what’ is to be tested (i.e. design test cases) (i.e. design test cases) 3. 3. build: build: implement the tests (data, scripts, etc.) implement the tests (data, scripts, etc.)
  • 26. Task 1: identify conditions  list the conditions that we would like to test: - use the test design techniques specified in the test plan use the test design techniques specified in the test plan - there may be many conditions for each system function or there may be many conditions for each system function or attribute attribute - e.g. e.g. • “ “life assurance for a winter sportsman” life assurance for a winter sportsman” • “ “number items ordered > 99” number items ordered > 99” • “ “date = 29-Feb-2004” date = 29-Feb-2004”  prioritise the test conditions - must ensure most important conditions are covered must ensure most important conditions are covered (determine ‘what’ is to be tested and prioritise)
  • 28. Task 2: design test cases  design test input and test data - each test exercises one or more test conditions each test exercises one or more test conditions  determine expected results - predict the outcome of each test case, what is predict the outcome of each test case, what is output, what is changed and what is not changed output, what is changed and what is not changed  design sets of tests - different test sets for different objectives such as different test sets for different objectives such as regression, building confidence, and finding faults regression, building confidence, and finding faults (determine ‘how’ the ‘what’ is to be tested)
  • 29. Designing test cases Importance Time Most important test conditions Least important test conditions Test cases
  • 30. Task 3: build test cases  prepare test scripts - less system knowledge tester has the more detailed the less system knowledge tester has the more detailed the scripts will have to be scripts will have to be - scripts for tools have to specify every detail scripts for tools have to specify every detail  prepare test data - data that must exist in files and databases at the start of data that must exist in files and databases at the start of the tests the tests  prepare expected results - should be defined before the test is executed should be defined before the test is executed (implement the test cases)
  • 31. Test execution specification execution recording check completion Planning (detailed level)
  • 32. Execution  Execute prescribed test cases - most important ones first most important ones first - would not execute all test cases if would not execute all test cases if • testing only fault fixes testing only fault fixes • too many faults found by early test cases too many faults found by early test cases • time pressure time pressure - can be performed manually or automated can be performed manually or automated
  • 33. Test recording specification execution recording check completion Planning (detailed level)
  • 34. Test recording 1  The test record contains: - identities and versions (unambiguously) of identities and versions (unambiguously) of • software under test software under test • test specifications test specifications  Follow the plan - mark off progress on test script mark off progress on test script - document actual outcomes from the test document actual outcomes from the test - capture any other ideas you have for new test cases capture any other ideas you have for new test cases - note that these records are used to establish that all test note that these records are used to establish that all test activities have been carried out as specified activities have been carried out as specified
  • 35. Test recording 2  Compare actual outcome with expected outcome. Log discrepancies accordingly: - software fault software fault - test fault (e.g. expected results wrong) test fault (e.g. expected results wrong) - environment or version fault environment or version fault - test run incorrectly test run incorrectly  Log coverage levels achieved (for measures specified as test completion criteria)  After the fault has been fixed, repeat the required test activities (execute, design, plan)
  • 36. Check test completion specification execution recording check completion Planning (detailed level)
  • 37. Check test completion  Test completion criteria were specified in the test plan  If not met, need to repeat test activities, e.g. test specification to design more tests specification execution recording check completion Coverage too low Coverage OK
  • 38. Test completion criteria  Completion or exit criteria apply to all levels of testing - to determine when to stop - coverage, using a measurement technique, e.g. coverage, using a measurement technique, e.g. • branch coverage for unit testing branch coverage for unit testing • user requirements user requirements • most frequently used transactions most frequently used transactions - faults found (e.g. versus expected) faults found (e.g. versus expected) - cost or time cost or time
  • 39. Comparison of tasks Clerical Intellectual one-off activity activity repeated many times Governs the quality of tests Good to automate Execute Recording Planning Specification
  • 40. Contents Why testing is necessary Fundamental test process Psychology of testing Re-testing and regression testing Expected results Prioritisation of tests Principles 1 2 3 4 5 6 ISTQB / ISEB Foundation Exam Practice
  • 41. Why test?  build confidence  prove that the software is correct  demonstrate conformance to requirements  find faults  reduce costs  show system meets user needs  assess the software quality
  • 43. Few Faults Many Faults Few Faults Few Faults Few Faults You may be here You think you are here Test Quality Low High Software Quality Low High Assessing software quality
  • 44. A traditional testing approach  Show that the system: - does what it should does what it should - doesn't do what it shouldn't doesn't do what it shouldn't Fastest achievement: easy test cases Goal: show working Success: system works Result: faults left in
  • 45. A better testing approach  Show that the system: - does what it shouldn't does what it shouldn't - doesn't do what it should doesn't do what it should Fastest achievement: difficult test cases Goal: find faults Success: system fails Result: fewer faults left in
  • 46. The testing paradox Purpose of testing: to find faults The best way to build confidence is to try to destroy it Purpose of testing: build confidence Finding faults destroys confidence Purpose of testing: destroy confidence
  • 47. Who wants to be a tester?  A destructive process  Bring bad news (“your baby is ugly”)  Under worst time pressure (at the end)  Need to take a different view, a different mindset (“What if it isn’t?”, “What could go wrong?”)  How should fault information be communicated (to authors and managers?)
  • 48. Tester’s have the right to: - accurate information about progress and changes accurate information about progress and changes - insight from developers about areas of the software insight from developers about areas of the software - delivered code tested to an agreed standard delivered code tested to an agreed standard - be regarded as a professional (no abuse!) be regarded as a professional (no abuse!) - find faults! find faults! - challenge specifications and test plans challenge specifications and test plans - have reported faults taken seriously (non-reproducible) have reported faults taken seriously (non-reproducible) - make predictions about future fault levels make predictions about future fault levels - improve your own testing process improve your own testing process
  • 49. Testers have responsibility to: - follow the test plans, scripts etc. as documented follow the test plans, scripts etc. as documented - report faults objectively and factually (no abuse!) report faults objectively and factually (no abuse!) - check tests are correct before reporting s/w faults check tests are correct before reporting s/w faults - remember it is the software, not the programmer, remember it is the software, not the programmer, that you are testing that you are testing - assess risk objectively assess risk objectively - prioritise what you report prioritise what you report - communicate the truth communicate the truth
  • 50. Independence  Test your own work? - find 30% - 50% of your own faults find 30% - 50% of your own faults - same assumptions and thought processes same assumptions and thought processes - see what you meant or want to see, not what is there see what you meant or want to see, not what is there - emotional attachment emotional attachment • don’t want to find faults don’t want to find faults • actively want NOT to find faults actively want NOT to find faults
  • 51. Levels of independence  None: tests designed by the person who wrote the software  Tests designed by a different person  Tests designed by someone from a different department or team (e.g. test team)  Tests designed by someone from a different organisation (e.g. agency)  Tests generated by a tool (low quality tests?)
  • 52. Contents Why testing is necessary Fundamental test process Psychology of testing Re-testing and regression testing Expected results Prioritisation of tests Principles 1 2 3 4 5 6 ISTQB / ISEB Foundation Exam Practice
  • 53. Re-testing after faults are fixed  Run a test, it fails, fault reported  New version of software with fault “fixed”  Re-run the same test (i.e. re-test) - must be exactly repeatable must be exactly repeatable - same environment, versions (except for the software same environment, versions (except for the software which has been intentionally changed!) which has been intentionally changed!) - same inputs and preconditions same inputs and preconditions  If test now passes, fault has been fixed correctly - or has it?
  • 54. Re-testing (re-running failed tests) x x x x New faults introduced by the first fault fix not found during re-testing Re-test to check Fault now fixed 
  • 55. Regression test  to look for any unexpected side-effects x x x x  Can’t guarantee to find them all
  • 56. Regression testing 1  misnomer: "anti-regression" or "progression"  standard set of tests - regression test pack  at any level (unit, integration, system, acceptance)  well worth automating  a developing asset but needs to be maintained
  • 57. Regression testing 2  Regression tests are performed - after software changes, including faults fixed after software changes, including faults fixed - when the environment changes, even if application when the environment changes, even if application functionality stays the same functionality stays the same - for emergency fixes (possibly a subset) for emergency fixes (possibly a subset)  Regression test suites - evolve over time evolve over time - are run often are run often - may become rather large may become rather large
  • 58. Regression testing 3  Maintenance of the regression test pack - eliminate repetitive tests (tests which test the same eliminate repetitive tests (tests which test the same test condition) test condition) - combine test cases (e.g. if they are always run combine test cases (e.g. if they are always run together) together) - select a different subset of the full regression suite to select a different subset of the full regression suite to run each time a regression test is needed run each time a regression test is needed - eliminate tests which have not found a fault for a eliminate tests which have not found a fault for a long time (e.g. old fault fix tests) long time (e.g. old fault fix tests)
  • 59. Regression testing and automation  Test execution tools (e.g. capture replay) are regression testing tools - they re-execute tests which have already been executed  Once automated, regression tests can be run as often as desired (e.g. every night)  Automating tests is not trivial (generally takes 2 to 10 times longer to automate a test than to run it manually  Don’t automate everything - plan what to automate first, only automate if worthwhile
  • 60. Contents Why testing is necessary Fundamental test process Psychology of testing Re-testing and regression testing Expected results Prioritisation of tests Principles 1 2 3 4 5 6 ISTQB / ISEB Foundation Exam Practice
  • 61. Expected results  Should be predicted in advance as part of the test design process - ‘ ‘Oracle Assumption’ assumes that correct outcome can be Oracle Assumption’ assumes that correct outcome can be predicted. predicted.  Why not just look at what the software does and assess it at the time? - subconscious desire for the test to pass - less work to do, subconscious desire for the test to pass - less work to do, no incident report to write up no incident report to write up - it looks plausible, so it must be OK - less rigorous than it looks plausible, so it must be OK - less rigorous than calculating in advance and comparing calculating in advance and comparing
  • 62. A test A Program: Source: Carsten Jorgensen, Delta, Denmark inputs expected outputs 3 8 6? 10? Read A IF (A = 8) THEN PRINT (“10”) ELSE PRINT (2*A)
  • 63. Contents Why testing is necessary Fundamental test process Psychology of testing Re-testing and regression testing Expected results Prioritisation of tests Principles 1 2 3 4 5 6 ISTQB / ISEB Foundation Exam Practice
  • 64. Prioritising tests  We can’t test everything  There is never enough time to do all the testing you would like  So what testing should you do?
  • 65. Most important principle Prioritise tests so that, whenever you stop testing, you have done the best testing in the time available.
  • 66. How to prioritise?  Possible ranking criteria (all risk based) - test where a failure would be most severe test where a failure would be most severe - test where failures would be most visible test where failures would be most visible - test where failures are most likely test where failures are most likely - ask the customer to prioritise the requirements ask the customer to prioritise the requirements - what is most critical to the customer’s business what is most critical to the customer’s business - areas changed most often areas changed most often - areas with most problems in the past areas with most problems in the past - most complex areas, or technically critical most complex areas, or technically critical
  • 67. Summary: Key Points Testing is necessary because people make errors The test process: planning, specification, execution, recording, checking completion Independence & relationships are important in testing Re-test fixes; regression test for the unexpected Expected results from a specification in advance Prioritise to do the best testing in the time you have Principles 1 2 3 4 5 6 ISTQB / ISEB Foundation Exam Practice