SlideShare a Scribd company logo
1 of 28
Introduction to Software
Testing
(2nd edition)
Chapter 1
Why Do We Test Software?
Paul Ammann & Jeff Offutt
http://www.cs.gmu.edu/~offutt/softwarete
st/
Updated August 2018
First version, 28 August 2011
Testing in the 21st Century
 Software defines behavior
– network routers, finance, switching networks, other infrastructure
 Today’s software market :
– is much bigger
– is more competitive
– has more users
 Embedded Control Applications
– airplanes, air traffic control
– spaceships
– watches
– ovens
– remote controllers
 Agile processes put increased pressure on testers
– Programmers must unit test – with no training or education!
– Tests are key to functional requirements – but who builds those tests ?
Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 2
– PDAs
– memory seats
– DVD players
– garage door openers
– cell phones
Industry is going through a
revolution in what testing
means to the success of
software products
Software is a Skin that
Surrounds Our Civilization
Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 3
Quote due to Dr. Mark Harman
Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 4
 Software Fault : A static defect in the software
 Software Failure : External, incorrect behavior with
respect to the requirements or other description of
the expected behavior
 Software Error : An incorrect internal state that is the
manifestation of some fault
Faults in software are equivalent to design mistakes
in hardware.
Software does not degrade.
Software Faults, Errors & Failures
Fault and Failure Example
 A patient gives a doctor a list of symptoms
– Failures
 The doctor tries to diagnose the root cause, the
ailment
– Fault
 The doctor may look for anomalous internal
conditions (high blood pressure, irregular heartbeat,
bacteria in the blood stream)
– Errors
Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 5
Most medical problems result from external attacks
(bacteria, viruses) or physical degradation as we age.
Software faults were there at the beginning and do
not “appear” when a part wears out.
A Concrete Example
Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 6
public static int numZero (int [ ] arr)
{ // Effects: If arr is null throw NullPointerException
// else return the number of occurrences of 0 in arr
int count = 0;
for (int i = 1; i < arr.length; i++)
{
if (arr [ i ] == 0)
{
count++;
}
}
return count;
}
Fault: Should start
searching at 0, not 1
Test 1
[ 2, 7, 0 ]
Expected: 1
Actual: 1
Test 2
[ 0, 2, 7 ]
Expected: 1
Actual: 0
Error: i is 1, not 0, on
the first iteration
Failure: none
Error: i is 1, not 0
Error propagates to the variable count
Failure: count is 0 at the return statement
The Term Bug
 Bug is used informally
 Sometimes speakers mean fault, sometimes error, sometimes
failure … often the speaker doesn’t know what it means !
 This class will try to use words that have precise, defined, and
unambiguous meanings
Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 7
BUG
“It has been just so in all of my inventions. The
first step is an intuition, and comes with a burst,
then difficulties arise—this thing gives out and
[it is] then that 'Bugs'—as such little faults and
difficulties are called—show themselves and
months of intense watching, study and labor are
requisite. . .” – Thomas Edison
“an analyzing process
must equally have been
performed in order to
furnish the Analytical
Engine with the necessary
operative data; and that
herein may also lie a
possible source of error.
Granted that the actual
mechanism is unerring in
its processes, the cards
may give it wrong orders.
” – Ada, Countess Lovelace
(notes on Babbage’s
Analytical Engine)
Spectacular Software Failures
Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 8
 Intel’s Pentium FDIV fault : Public relations
nightmare
 THERAC-25 radiation machine : Poor
testing of safety-critical software can cost
lives : 3 patients were killed
Mars Polar
Lander crash
site?
THERAC-25 design
Ariane 5:
exception-handling
bug : forced self
destruct on maiden
flight (64-bit to 16-bit
conversion: about
370 million $ lost)
We need our software to be
dependable
Testing is one way to assess
 NASA’s Mars lander: September 1999,
crashed due to a units integration fault
 Ariane 5 explosion : Millions of $$
Northeast Blackout of 2003
Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 9
Affected 10 million
people in Ontario,
Canada
Affected 40 million
people in 8 US
states
Financial losses of
$6 Billion USD
508 generating
units and 256
power plants shut
down
The alarm system in the energy management system failed
due to a software error and operators were not informed of
the power overload in the system
Costly Software Failures
Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 10
 NIST report, “The Economic Impacts of Inadequate
Infrastructure for Software Testing” (2002)
– Inadequate software testing costs the US alone between
$22 and $59 billion annually
– Better approaches could cut this amount in half
 Huge losses due to web application failures
– Financial services : $6.5 million per hour (just in USA!)
– Credit card sales applications : $2.4 million per hour (in
USA)
 In Dec 2006, amazon.com’s BOGO offer turned into a
double discount
 2007 : Symantec says that most security
vulnerabilities are due to faulty software
World-wide monetary loss due to poor software is
staggering
Spectacular software Failures
Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 11
• Healthcare website : Crashed
repeatedly on launch—never load
tested
Software testers try to find faults before
the faults find users
• Boeing A220 : Engines failed after software
update allowed excessive vibrations
• Toyota brakes : Dozens dead, thousands of crashes
• Northeast blackout : 50 million people, $6
billion USD lost … alarm system failed
• Boeing 737 Max : Crashed due to overly
aggressive software flight overrides (MCAS)
Testing in the 21st Century
 More safety critical, real-time software
 Embedded software is ubiquitous … check your
pockets
 Enterprise applications means bigger programs,
more users
 Paradoxically, free software increases our
expectations !
 Security is now all about software faults
– Secure software is reliable software
 The web offers a new deployment platform
– Very competitive and very available to more users
– Web apps are distributed
– Web apps must be highly reliable
Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 12
Industry desperately needs our inventions !
The True Cost of Software Failure
Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 13
Fail watch analyzed news articles for
2016
• 606 reported software failures
• Impacted half the world’s population
• Cost a combined $1.7 trillion US
dollars
Poor software is a significant
drag on the world’s economy
Not to mention
frustrating
What Does This Mean?
Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 14
Software testing is getting more
important
What are we trying to do when we test ?
What are our goals ?
Validation & Verification (IEEE)
 Validation : The process of evaluating software at the
end of software development to ensure compliance
with intended usage
 Verification : The process of determining whether the
products of a given phase of the software
development process fulfill the requirements
established during the previous phase
IV&V stands for “independent verification and
validation”
Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 15
Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 16
Testing Goals Based on Test
Process Maturity
 Level 0 : There’s no difference between testing and
debugging
 Level 1 : The purpose of testing is to show
correctness
 Level 2 : The purpose of testing is to show that the
software doesn’t work
 Level 3 : The purpose of testing is not to prove
anything specific, but to reduce the risk of using the
software
 Level 4 : Testing is a mental discipline that helps all
IT professionals develop higher quality software
Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 17
Level 0 Thinking
 Testing is the same as debugging
 Does not distinguish between incorrect
behavior and mistakes in the program
 Does not help develop software that is reliable
or safe
This is what we teach undergraduate CS majors
Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 18
Level 1 Thinking
 Purpose is to show correctness
 Correctness is impossible to achieve
 What do we know if no failures?
– Good software or bad tests?
 Test engineers have no:
– Strict goal
– Real stopping rule
– Formal test technique
– Test managers are powerless
This is what hardware engineers often expect
Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 19
Level 2 Thinking
 Purpose is to show failures
 Looking for failures is a negative activity
 Puts testers and developers into an
adversarial relationship
 What if there are no failures?
This describes most software companies.
How can we move to a team approach ??
Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 20
Level 3 Thinking
 Testing can only show the presence of failures
 Whenever we use software, we incur some
risk
 Risk may be small and consequences
unimportant
 Risk may be great and consequences
catastrophic
 Testers and developers cooperate to reduce
This describes a few “enlightened” software
companies
Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 21
Level 4 Thinking
A mental discipline that increases quality
 Testing is only one way to increase quality
 Test engineers can become technical leaders of the
project
 Primary responsibility to measure and improve
software quality
 Their expertise should help the developers
This is the way “traditional” engineering works
Where Are You?
Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 22
Are you at level 0, 1, or 2 ?
Is your organization at work at level
0, 1, or 2 ?
Or 3?
We hope to teach you to become
“change agents” in your workplace …
Advocates for level 4 thinking
Tactical Goals : Why Each Test ?
Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 23
 Written test objectives and requirements
must be documented
 What are your planned coverage levels?
 How much testing is enough?
 Common objective – spend the budget …
test until the ship-date …
–Sometimes called the “date criterion”
If you don’t know why you’re conducting
each test, it won’t be very helpful
Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 24
Here! Test This!
MicroSteff – big
software system
for the mac
V.1.5.1 Jan/2007
Verdatim
DataLife
MF2-HD
1.44
MB
Big software program
Jan/2011
Offutt’s first “professional” job
A stack of computer printouts—and no documentation
Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 25
Why Each Test ?
 1980: “The software shall be easily
maintainable”
 Threshold reliability requirements?
 What fact does each test try to verify?
 Requirements definition teams need testers!
If you don’t start planning for each test when the
functional requirements are formed, you’ll never
know why you’re conducting the test
Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 26
Cost of Not Testing
 Testing is the most time consuming and
expensive part of software development
 Not testing is even more expensive
 If we have too little testing effort early, the
cost of testing increases
 Planning for testing after development is
prohibitively expensive
Poor Program Managers might say:
“Testing is too expensive.”
Cost of Late Testing
Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 27
60
50
40
30
20
10
0
Fault origin (%)
Fault detection (%)
Unit cost (X)
Software Engineering Institute; Carnegie Mellon University; Handbook CMU/SEI-96-HB-002
Assume $1000 unit cost, per fault, 100 faults
Summary:
Why Do We Test Software ?
Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 28
A tester’s goal is to eliminate faults
as early as possible
• Improve quality
• Reduce cost
• Preserve customer satisfaction

More Related Content

Similar to Ch01-whyTest.pptx

IRJET - A Valuable and Speculative Approach to Manage the Item Testing by usi...
IRJET - A Valuable and Speculative Approach to Manage the Item Testing by usi...IRJET - A Valuable and Speculative Approach to Manage the Item Testing by usi...
IRJET - A Valuable and Speculative Approach to Manage the Item Testing by usi...IRJET Journal
 
Exploratory testing and the mobile tester : A presentation by Jon Hagar
Exploratory testing and the mobile tester : A presentation by Jon HagarExploratory testing and the mobile tester : A presentation by Jon Hagar
Exploratory testing and the mobile tester : A presentation by Jon HagarGallop Solutions
 
Fundamentals_of_testing.pdf
Fundamentals_of_testing.pdfFundamentals_of_testing.pdf
Fundamentals_of_testing.pdfAndreeaDavid22
 
Beginner guide-to-software-testing
Beginner guide-to-software-testingBeginner guide-to-software-testing
Beginner guide-to-software-testingbiswajit52
 
Where to learn best software course
Where to learn best software courseWhere to learn best software course
Where to learn best software coursewebskittersacademy
 
IRJET- Faces of Testing Strategies: Why &When?
IRJET- Faces of Testing Strategies: Why &When?IRJET- Faces of Testing Strategies: Why &When?
IRJET- Faces of Testing Strategies: Why &When?IRJET Journal
 
Software techniques
Software techniquesSoftware techniques
Software techniqueshome
 
fundamentals of testing
fundamentals of testingfundamentals of testing
fundamentals of testingaidil fitra
 
Fundamentals of Testing
Fundamentals of TestingFundamentals of Testing
Fundamentals of TestingCode95
 
Info manual testing questions
Info manual testing questionsInfo manual testing questions
Info manual testing questionsSandeep
 
Fundamentals of Testing - Andika Dwi Ary Candra
Fundamentals of Testing - Andika Dwi Ary CandraFundamentals of Testing - Andika Dwi Ary Candra
Fundamentals of Testing - Andika Dwi Ary CandraAnd11ka
 
Why Software Testing is Crucial in Software Development_.pdf
Why Software Testing is Crucial in Software Development_.pdfWhy Software Testing is Crucial in Software Development_.pdf
Why Software Testing is Crucial in Software Development_.pdfXDuce Corporation
 
ISTQB Chapter 1 Fundamentals of Testing
ISTQB Chapter 1  Fundamentals of TestingISTQB Chapter 1  Fundamentals of Testing
ISTQB Chapter 1 Fundamentals of Testingssuser2d9936
 
Reading Summary - Effective Software Defect Tracking + Pragmatic Unit Testing
Reading Summary - Effective Software Defect Tracking + Pragmatic Unit TestingReading Summary - Effective Software Defect Tracking + Pragmatic Unit Testing
Reading Summary - Effective Software Defect Tracking + Pragmatic Unit TestingArtemisa Yescas Engler
 
Overview of software reliability engineering
Overview of software reliability engineeringOverview of software reliability engineering
Overview of software reliability engineeringAnn Marie Neufelder
 
Manual testing interview question by INFOTECH
Manual testing interview question by INFOTECHManual testing interview question by INFOTECH
Manual testing interview question by INFOTECHPravinsinh
 

Similar to Ch01-whyTest.pptx (20)

IRJET - A Valuable and Speculative Approach to Manage the Item Testing by usi...
IRJET - A Valuable and Speculative Approach to Manage the Item Testing by usi...IRJET - A Valuable and Speculative Approach to Manage the Item Testing by usi...
IRJET - A Valuable and Speculative Approach to Manage the Item Testing by usi...
 
Exploratory testing and the mobile tester : A presentation by Jon Hagar
Exploratory testing and the mobile tester : A presentation by Jon HagarExploratory testing and the mobile tester : A presentation by Jon Hagar
Exploratory testing and the mobile tester : A presentation by Jon Hagar
 
Fundamentals_of_testing.pdf
Fundamentals_of_testing.pdfFundamentals_of_testing.pdf
Fundamentals_of_testing.pdf
 
software testing
software testingsoftware testing
software testing
 
Beginner guide-to-software-testing
Beginner guide-to-software-testingBeginner guide-to-software-testing
Beginner guide-to-software-testing
 
Where to learn best software course
Where to learn best software courseWhere to learn best software course
Where to learn best software course
 
IRJET- Faces of Testing Strategies: Why &When?
IRJET- Faces of Testing Strategies: Why &When?IRJET- Faces of Testing Strategies: Why &When?
IRJET- Faces of Testing Strategies: Why &When?
 
Testing concepts
Testing conceptsTesting concepts
Testing concepts
 
Software techniques
Software techniquesSoftware techniques
Software techniques
 
Test plan
Test planTest plan
Test plan
 
fundamentals of testing
fundamentals of testingfundamentals of testing
fundamentals of testing
 
Fundamentals of Testing
Fundamentals of TestingFundamentals of Testing
Fundamentals of Testing
 
Info manual testing questions
Info manual testing questionsInfo manual testing questions
Info manual testing questions
 
Software testing
Software testingSoftware testing
Software testing
 
Fundamentals of Testing - Andika Dwi Ary Candra
Fundamentals of Testing - Andika Dwi Ary CandraFundamentals of Testing - Andika Dwi Ary Candra
Fundamentals of Testing - Andika Dwi Ary Candra
 
Why Software Testing is Crucial in Software Development_.pdf
Why Software Testing is Crucial in Software Development_.pdfWhy Software Testing is Crucial in Software Development_.pdf
Why Software Testing is Crucial in Software Development_.pdf
 
ISTQB Chapter 1 Fundamentals of Testing
ISTQB Chapter 1  Fundamentals of TestingISTQB Chapter 1  Fundamentals of Testing
ISTQB Chapter 1 Fundamentals of Testing
 
Reading Summary - Effective Software Defect Tracking + Pragmatic Unit Testing
Reading Summary - Effective Software Defect Tracking + Pragmatic Unit TestingReading Summary - Effective Software Defect Tracking + Pragmatic Unit Testing
Reading Summary - Effective Software Defect Tracking + Pragmatic Unit Testing
 
Overview of software reliability engineering
Overview of software reliability engineeringOverview of software reliability engineering
Overview of software reliability engineering
 
Manual testing interview question by INFOTECH
Manual testing interview question by INFOTECHManual testing interview question by INFOTECH
Manual testing interview question by INFOTECH
 

Recently uploaded

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 

Recently uploaded (20)

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 

Ch01-whyTest.pptx

  • 1. Introduction to Software Testing (2nd edition) Chapter 1 Why Do We Test Software? Paul Ammann & Jeff Offutt http://www.cs.gmu.edu/~offutt/softwarete st/ Updated August 2018 First version, 28 August 2011
  • 2. Testing in the 21st Century  Software defines behavior – network routers, finance, switching networks, other infrastructure  Today’s software market : – is much bigger – is more competitive – has more users  Embedded Control Applications – airplanes, air traffic control – spaceships – watches – ovens – remote controllers  Agile processes put increased pressure on testers – Programmers must unit test – with no training or education! – Tests are key to functional requirements – but who builds those tests ? Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 2 – PDAs – memory seats – DVD players – garage door openers – cell phones Industry is going through a revolution in what testing means to the success of software products
  • 3. Software is a Skin that Surrounds Our Civilization Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 3 Quote due to Dr. Mark Harman
  • 4. Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 4  Software Fault : A static defect in the software  Software Failure : External, incorrect behavior with respect to the requirements or other description of the expected behavior  Software Error : An incorrect internal state that is the manifestation of some fault Faults in software are equivalent to design mistakes in hardware. Software does not degrade. Software Faults, Errors & Failures
  • 5. Fault and Failure Example  A patient gives a doctor a list of symptoms – Failures  The doctor tries to diagnose the root cause, the ailment – Fault  The doctor may look for anomalous internal conditions (high blood pressure, irregular heartbeat, bacteria in the blood stream) – Errors Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 5 Most medical problems result from external attacks (bacteria, viruses) or physical degradation as we age. Software faults were there at the beginning and do not “appear” when a part wears out.
  • 6. A Concrete Example Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 6 public static int numZero (int [ ] arr) { // Effects: If arr is null throw NullPointerException // else return the number of occurrences of 0 in arr int count = 0; for (int i = 1; i < arr.length; i++) { if (arr [ i ] == 0) { count++; } } return count; } Fault: Should start searching at 0, not 1 Test 1 [ 2, 7, 0 ] Expected: 1 Actual: 1 Test 2 [ 0, 2, 7 ] Expected: 1 Actual: 0 Error: i is 1, not 0, on the first iteration Failure: none Error: i is 1, not 0 Error propagates to the variable count Failure: count is 0 at the return statement
  • 7. The Term Bug  Bug is used informally  Sometimes speakers mean fault, sometimes error, sometimes failure … often the speaker doesn’t know what it means !  This class will try to use words that have precise, defined, and unambiguous meanings Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 7 BUG “It has been just so in all of my inventions. The first step is an intuition, and comes with a burst, then difficulties arise—this thing gives out and [it is] then that 'Bugs'—as such little faults and difficulties are called—show themselves and months of intense watching, study and labor are requisite. . .” – Thomas Edison “an analyzing process must equally have been performed in order to furnish the Analytical Engine with the necessary operative data; and that herein may also lie a possible source of error. Granted that the actual mechanism is unerring in its processes, the cards may give it wrong orders. ” – Ada, Countess Lovelace (notes on Babbage’s Analytical Engine)
  • 8. Spectacular Software Failures Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 8  Intel’s Pentium FDIV fault : Public relations nightmare  THERAC-25 radiation machine : Poor testing of safety-critical software can cost lives : 3 patients were killed Mars Polar Lander crash site? THERAC-25 design Ariane 5: exception-handling bug : forced self destruct on maiden flight (64-bit to 16-bit conversion: about 370 million $ lost) We need our software to be dependable Testing is one way to assess  NASA’s Mars lander: September 1999, crashed due to a units integration fault  Ariane 5 explosion : Millions of $$
  • 9. Northeast Blackout of 2003 Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 9 Affected 10 million people in Ontario, Canada Affected 40 million people in 8 US states Financial losses of $6 Billion USD 508 generating units and 256 power plants shut down The alarm system in the energy management system failed due to a software error and operators were not informed of the power overload in the system
  • 10. Costly Software Failures Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 10  NIST report, “The Economic Impacts of Inadequate Infrastructure for Software Testing” (2002) – Inadequate software testing costs the US alone between $22 and $59 billion annually – Better approaches could cut this amount in half  Huge losses due to web application failures – Financial services : $6.5 million per hour (just in USA!) – Credit card sales applications : $2.4 million per hour (in USA)  In Dec 2006, amazon.com’s BOGO offer turned into a double discount  2007 : Symantec says that most security vulnerabilities are due to faulty software World-wide monetary loss due to poor software is staggering
  • 11. Spectacular software Failures Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 11 • Healthcare website : Crashed repeatedly on launch—never load tested Software testers try to find faults before the faults find users • Boeing A220 : Engines failed after software update allowed excessive vibrations • Toyota brakes : Dozens dead, thousands of crashes • Northeast blackout : 50 million people, $6 billion USD lost … alarm system failed • Boeing 737 Max : Crashed due to overly aggressive software flight overrides (MCAS)
  • 12. Testing in the 21st Century  More safety critical, real-time software  Embedded software is ubiquitous … check your pockets  Enterprise applications means bigger programs, more users  Paradoxically, free software increases our expectations !  Security is now all about software faults – Secure software is reliable software  The web offers a new deployment platform – Very competitive and very available to more users – Web apps are distributed – Web apps must be highly reliable Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 12 Industry desperately needs our inventions !
  • 13. The True Cost of Software Failure Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 13 Fail watch analyzed news articles for 2016 • 606 reported software failures • Impacted half the world’s population • Cost a combined $1.7 trillion US dollars Poor software is a significant drag on the world’s economy Not to mention frustrating
  • 14. What Does This Mean? Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 14 Software testing is getting more important What are we trying to do when we test ? What are our goals ?
  • 15. Validation & Verification (IEEE)  Validation : The process of evaluating software at the end of software development to ensure compliance with intended usage  Verification : The process of determining whether the products of a given phase of the software development process fulfill the requirements established during the previous phase IV&V stands for “independent verification and validation” Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 15
  • 16. Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 16 Testing Goals Based on Test Process Maturity  Level 0 : There’s no difference between testing and debugging  Level 1 : The purpose of testing is to show correctness  Level 2 : The purpose of testing is to show that the software doesn’t work  Level 3 : The purpose of testing is not to prove anything specific, but to reduce the risk of using the software  Level 4 : Testing is a mental discipline that helps all IT professionals develop higher quality software
  • 17. Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 17 Level 0 Thinking  Testing is the same as debugging  Does not distinguish between incorrect behavior and mistakes in the program  Does not help develop software that is reliable or safe This is what we teach undergraduate CS majors
  • 18. Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 18 Level 1 Thinking  Purpose is to show correctness  Correctness is impossible to achieve  What do we know if no failures? – Good software or bad tests?  Test engineers have no: – Strict goal – Real stopping rule – Formal test technique – Test managers are powerless This is what hardware engineers often expect
  • 19. Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 19 Level 2 Thinking  Purpose is to show failures  Looking for failures is a negative activity  Puts testers and developers into an adversarial relationship  What if there are no failures? This describes most software companies. How can we move to a team approach ??
  • 20. Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 20 Level 3 Thinking  Testing can only show the presence of failures  Whenever we use software, we incur some risk  Risk may be small and consequences unimportant  Risk may be great and consequences catastrophic  Testers and developers cooperate to reduce This describes a few “enlightened” software companies
  • 21. Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 21 Level 4 Thinking A mental discipline that increases quality  Testing is only one way to increase quality  Test engineers can become technical leaders of the project  Primary responsibility to measure and improve software quality  Their expertise should help the developers This is the way “traditional” engineering works
  • 22. Where Are You? Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 22 Are you at level 0, 1, or 2 ? Is your organization at work at level 0, 1, or 2 ? Or 3? We hope to teach you to become “change agents” in your workplace … Advocates for level 4 thinking
  • 23. Tactical Goals : Why Each Test ? Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 23  Written test objectives and requirements must be documented  What are your planned coverage levels?  How much testing is enough?  Common objective – spend the budget … test until the ship-date … –Sometimes called the “date criterion” If you don’t know why you’re conducting each test, it won’t be very helpful
  • 24. Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 24 Here! Test This! MicroSteff – big software system for the mac V.1.5.1 Jan/2007 Verdatim DataLife MF2-HD 1.44 MB Big software program Jan/2011 Offutt’s first “professional” job A stack of computer printouts—and no documentation
  • 25. Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 25 Why Each Test ?  1980: “The software shall be easily maintainable”  Threshold reliability requirements?  What fact does each test try to verify?  Requirements definition teams need testers! If you don’t start planning for each test when the functional requirements are formed, you’ll never know why you’re conducting the test
  • 26. Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 26 Cost of Not Testing  Testing is the most time consuming and expensive part of software development  Not testing is even more expensive  If we have too little testing effort early, the cost of testing increases  Planning for testing after development is prohibitively expensive Poor Program Managers might say: “Testing is too expensive.”
  • 27. Cost of Late Testing Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 27 60 50 40 30 20 10 0 Fault origin (%) Fault detection (%) Unit cost (X) Software Engineering Institute; Carnegie Mellon University; Handbook CMU/SEI-96-HB-002 Assume $1000 unit cost, per fault, 100 faults
  • 28. Summary: Why Do We Test Software ? Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 28 A tester’s goal is to eliminate faults as early as possible • Improve quality • Reduce cost • Preserve customer satisfaction

Editor's Notes

  1. 28-Oct-2010, at GTAC, added the animation to demonstrate increasing the number of faults found early, thereby decreasing the number of faults found late, and finally saving money. Lots of it! This animation is fairly complicated … must practice first!!