Introduction to Software Testing (2nd edition) Chapter 1 Why Do We Test Software? Paul Ammann & Jeff Offutt

Slides:



Advertisements
Similar presentations
Introduction to Software Testing Chapter 1
Advertisements

Test process essentials Riitta Viitamäki,
Model-Driven Test Design Based on the book by Paul Ammann & Jeff Offutt Jeff Offutt Professor, Software Engineering.
1 SOFTWARE TESTING Przygotował: Marcin Lubawski. 2 Testing Process AnalyseDesignMaintainBuildTestInstal Software testing strategies Verification Validation.
Introduction to Software Testing Chapter 1 Paul Ammann & Jeff Offutt SUMMARY OF PARTS 1 AND 2 FROM LAST WEEK.
CITS5501 Software Testing and Quality Assurance Testing – Introduction Material from Introduction to Software Testing, ed 2, Ammann & Offutt.
Can We Trust the Computer?
Introduction to Software Testing Chapter 9.3 Challenges in Testing Software Test Criteria and the Future of Testing Paul Ammann & Jeff Offutt
CS 3500 SE - 1 Software Engineering: It’s Much More Than Programming! Sources: “Software Engineering: A Practitioner’s Approach - Fourth Edition” Pressman,
Introduction to Software Testing Chapter 1 Introduction Paul Ammann & Jeff Offutt
1 Basic Definitions: Testing What is software testing? Running a program In order to find faults a.k.a. defects a.k.a. errors a.k.a. flaws a.k.a. faults.
Introduction to Software Testing Why Do We Test Software?
System Implementation
Model-Driven Test Design Jeff Offutt Professor, Software Engineering George Mason University Fairfax, VA USA
Software Dependability CIS 376 Bruce R. Maxim UM-Dearborn.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
Ethical and Social...J.M.Kizza 1 Module 8: Software Issues: Risks and Liabilities Definitions Causes of Software Failures Risks Consumer Protection Improving.
CS527: (Advanced) Topics in Software Engineering Overview of Software Quality Assurance Tao Xie ©D. Marinov, T. Xie.
Introduction to Software Testing Paul Ammann & Jeff Offutt Updated 24-August 2010.
Software Quality Assurance & Testing Mistake in coding is called error, Error found by tester is called defect, Defect accepted by development team then.
Software Quality Assurance Lecture #8 By: Faraz Ahmed.
Introduction to Software Testing Chapter 9.3 Challenges in Testing Software Test Criteria and the Future of Testing Paul Ammann & Jeff Offutt
University of Palestine software engineering department Testing of Software Systems Fundamentals of testing instructor: Tasneem Darwish.
HUMAN RESOURCE MANAGEMENT MIHE Mashal Institute of Higher Education.
Introduction to Software Testing Chapter 1 Introduction
Sommerville, Ammann-Offutt, Mejia, 2009 Software Engineering Slide 1 Verification and Validation.
 CS 5380 Software Engineering Chapter 8 Testing.
CS 4001Mary Jean Harrold 1 Can We Trust the Computer?
Dr. Tom WayCSC Testing and Test-Driven Development CSC 4700 Software Engineering Based on Sommerville slides.
637 – Introduction (Ch 1) Introduction to Software Testing Chapter 1 Jeff Offutt Information & Software Engineering SWE 437 Software Testing
DEBUGGING. BUG A software bug is an error, flaw, failure, or fault in a computer program or system that causes it to produce an incorrect or unexpected.
637 – Introduction (Ch 1) Introduction to Software Testing Chapter 1 Jeff Offutt Information & Software Engineering SWE 437 Software Testing
Today’s Agenda  HW #1  Finish Introduction  Input Space Partitioning Software Testing and Maintenance 1.
1 Introduction to Software Testing. Reading Assignment P. Ammann and J. Offutt “Introduction to Software Testing” ◦ Chapter 1 2.
Software Defects.
Introduction to Software Testing Paul Ammann & Jeff Offutt Updated 24-August 2010.
Introduction to Software Testing. OUTLINE Introduction to Software Testing (Ch 1) 2 1.Spectacular Software Failures 2.Why Test? 3.What Do We Do When We.
CPSC 873 John D. McGregor Session 9 Testing Vocabulary.
Testing. Today’s Topics Why Testing? Basic Definitions Kinds of Testing Test-driven Development Code Reviews (not testing) 1.
Chapter 1: Fundamental of Testing Systems Testing & Evaluation (MNN1063)
637 – Introduction (Ch 1) Introduction to Software Testing Chapter 1 Jeff Offutt Information & Software Engineering SWE 637 Software Testing
CPSC 871 John D. McGregor Module 8 Session 1 Testing.
Software Quality Assurance and Testing Fazal Rehman Shamil.
Introduction to Software Testing Why Do We Test Software? Dr. Pedro Mejia Alvarez From Book: Introduction to Software Testing, P.Ammann&J.Offutt.
637 – Introduction (Ch 1) Introduction to Software Testing Chapter 1 Jeff Offutt Information & Software Engineering SWE 637 Software Testing
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
637 – Introduction (Ch 1) Introduction to Software Testing Chapter 1 Jeff Offutt Information & Software Engineering SWE 637 Software Testing
Introduction to Software Testing Model-Driven Test Design and Coverage testing Paul Ammann & Jeff Offutt Update.
1 Chapter 1- Introduction How Bugs affect our lives What is a Bug? What software testers do?
CPSC 372 John D. McGregor Module 8 Session 1 Testing.
Introduction to Software Testing (2nd edition) Chapter 5 Criteria-Based Test Design Paul Ammann & Jeff Offutt
Introduction to Software Testing Chapter 1 Introduction Paul Ammann & Jeff Offutt
Testing Your Program: Input Space Partitioning
Paul Ammann & Jeff Offutt
Paul Ammann & Jeff Offutt
Paul Ammann & Jeff Offutt
Introduction to Unique Aspects of Web Applications
Software Testing Introduction CS 4501 / 6501 Software Testing
Introduction to Software Testing Chapter 1
Verification and Testing
Faults, Errors, Failures CS 4501 / 6501 Software Testing
Paul Ammann & Jeff Offutt
Introduction to Software Testing
Test Driven Lasse Koskela Chapter 9: Acceptance TDD Explained
Software Testing and Maintenance Maintenance and Evolution Overview
Introduction to Software Testing Chapter 1
Welcome to Corporate Training -1
(some of) My Research Engineering is about getting technology to do what it does well so humans can do what they do well Jeff Offutt Professor of Software.
Paul Ammann & Jeff Offutt
Presentation transcript:

Introduction to Software Testing (2nd edition) Chapter 1 Why Do We Test Software? Paul Ammann & Jeff Offutt Updated August 2012 First version, 28 August 2011

Testing in the 21st Century n Software defines behavior –network routers, finance, switching networks, other infrastructure n Today’s software market : –is much bigger –is more competitive –has more users n Embedded Control Applications –airplanes, air traffic control –spaceships –watches –ovens –remote controllers n Agile processes put increased pressure on testers –Programmers must unit test – with no training, education or tools ! –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 Faults, Errors & Failures n Software Fault : A static defect in the software n Software Failure : External, incorrect behavior with respect to the requirements or other description of the expected behavior n 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.

Fault and Failure Example n A patient gives a doctor a list of symptoms –Failures n The doctor tries to diagnose the root cause, the ailment –Fault n 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. They 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 n Bug is used informally n Sometimes speakers mean fault, sometimes error, sometimes failure … often the speaker doesn’t know what it means ! n 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 n 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 dependability n NASA’s Mars lander: September 1999, crashed due to a units integration fault Ariane 5 explosion : Very expensive

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 n 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 n 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) n In Dec 2006, amazon.com’s BOGO offer turned into a double discount n 2007 : Symantec says that most security vulnerabilities are due to faulty software World-wide monetary loss due to poor software is staggering

Testing in the 21st Century n More safety critical, real-time software n Embedded software is ubiquitous … check your pockets n Enterprise applications means bigger programs, more users n Paradoxically, free software increases our expectations ! n Security is now all about software faults –Secure software is reliable software n 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 11 Industry desperately needs our inventions !

What Does This Mean? Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 12 Software testing is getting more important What are we trying to do when we test ? What are our goals ?

Validation & Verification ( IEEE ) n Validation : The process of evaluating software at the end of software development to ensure compliance with intended usage n 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 13

Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 14 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 15 Level 0 Thinking n Testing is the same as debugging n Does not distinguish between incorrect behavior and mistakes in the program n 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 16 Level 1 Thinking n Purpose is to show correctness n Correctness is impossible to achieve n What do we know if no failures? –Good software or bad tests? n 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 17 Level 2 Thinking n Purpose is to show failures n Looking for failures is a negative activity n Puts testers and developers into an adversarial relationship n 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 18 Level 3 Thinking n Testing can only show the presence of failures n Whenever we use software, we incur some risk n Risk may be small and consequences unimportant n Risk may be great and consequences catastrophic n Testers and developers cooperate to reduce risk This describes a few “enlightened” software companies

Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 19 Level 4 Thinking A mental discipline that increases quality n Testing is only one way to increase quality n Test engineers can become technical leaders of the project n Primary responsibility to measure and improve software quality n 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 20 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 21 n Written test objectives and requirements must be documented n What are your planned coverage levels? n How much testing is enough? n 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 22 Here! Test This! MicroSteff – big software system for the mac V Jan/2007 Verdatim DataLife MF2-HD 1.44 MB Big software program Jan/2011 My first “professional” job A stack of computer printouts—and no documentation

Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 23 Why Each Test ? n 1980: “The software shall be easily maintainable” n Threshold reliability requirements? n What fact does each test try to verify? n 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 s Thinking They’re teaching a new way of plowing over at the Grange tonight - you going? Naw - I already don’t plow as good as I know how... “Knowing is not enough, we must apply. Willing is not enough, we must do.” Goethe Fail !!!

Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 25 Cost of Not Testing n Testing is the most time consuming and expensive part of software development n Not testing is even more expensive n If we have to little testing effort early, the cost of testing increases n Planning for testing after development is prohibitively expensive Poor Program Managers might say: “Testing is too expensive.”

Cost of Late Testing GTAC, October 2010 © Jeff Offutt Requirements Prog / Unit Test Design Integration Test 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 $6K $13K $20K $360K $250K System TestPost-Deployment $100K

Summary: Why Do We Test Software ? Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 27 A tester’s goal is to eliminate faults as early as possible Improve quality Improve quality Reduce cost Reduce cost Preserve customer satisfaction Preserve customer satisfaction