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.

Slides:



Advertisements
Similar presentations
Chapter 5 Errors Bjarne Stroustrup
Advertisements

Welcome to CS 119 Reliable Software: Testing and Monitoring
Test process essentials Riitta Viitamäki,
CSE 331 SOFTWARE DESIGN & IMPLEMENTATION DEBUGGING Autumn 2011 Bug-Date: Sept 9, 1947.
© Dr. Ernest CachiaSlide 1 Consider the nature of a computer as a tool –Non conventional in that it’s universal –Reasons for it being so (separation.
Can We Trust the Computer?
Software Testing.
Introduction to Software Testing (2nd edition) Chapter 1 Why Do We Test Software? Paul Ammann & Jeff Offutt
Topics in Testing We’ve Covered
(Quickly) Testing the Tester via Path Coverage Alex Groce Oregon State University (formerly NASA/JPL Laboratory for Reliable Software)
Working Software (Testing) Today’s Topic – Why testing? – Some basic definitions – Kinds of testing – Test-driven development – Code reviews (not testing)
15 November Essay 1  Methodologies Points on the spectrum All can adapt to changes Required vs. permitted  Releases vs. iterations  Spool’s.
SE 450 Software Processes & Product Metrics Reliability: An Introduction.
Soft. Eng. II, Spr. 2002Dr Driss Kettani, from I. Sommerville1 CSC-3325: Chapter 9 Title : Reliability Reading: I. Sommerville, Chap. 16, 17 and 18.
Software Testing. “Software and Cathedrals are much the same: First we build them, then we pray!!!” -Sam Redwine, Jr.
1 Software Fault Protection Allen Goldberg Kestrel Technology.
CS 603 Communication and Distributed Systems April 15, 2002.
ECI 2007: Specification and Verification of Object- Oriented Programs Lecture 0.
Swami NatarajanJuly 14, 2015 RIT Software Engineering Reliability: Introduction.
Formal verification Marco A. Peña Universitat Politècnica de Catalunya.
Software Dependability CIS 376 Bruce R. Maxim UM-Dearborn.
Software Reliability Categorising and specifying the reliability of software systems.
CS527: (Advanced) Topics in Software Engineering Overview of Software Quality Assurance Tao Xie ©D. Marinov, T. Xie.
Dr. Pedro Mejia Alvarez Software Testing Slide 1 Software Testing: Building Test Cases.
University of Palestine software engineering department Testing of Software Systems Fundamentals of testing instructor: Tasneem Darwish.
Verification and Validation Overview References: Shach, Object Oriented and Classical Software Engineering Pressman, Software Engineering: a Practitioner’s.
2.2 Software Myths 2.2 Software Myths Myth 1. The cost of computers is lower than that of analog or electromechanical devices. –Hardware is cheap compared.
ELN5622 Embedded Systems Class 10 Spring, 2003 Aaron Itskovich
INVARIANTS EEN 417 Fall When is a Design of a System “Correct”? A design is correct when it meets its specification (requirements) in its operating.
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.
CSE403 Software Engineering Autumn 2001 More Testing Gary Kimura Lecture #10 October 22, 2001.
Debugging and Interpreting Exceptions UW CSE 190p Summer 2012.
Debugging Strategies from Software Carpentry. Agan's Rules Many people make debugging harder than it needs to be by: Using inadequate tools Not going.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 20 Slide 1 Critical systems development 3.
1 Reducing the Software Impact to System Safety Paul Mayo – SafeEng Limited.
QuickCheck: A Lightweight Tool for Random Testing of Haskell Programs By Koen Claessen, Juhn Hughes ME: Mike Izbicki.
Software Defects.
Design - programming Cmpe 450 Fall Dynamic Analysis Software quality Design carefully from the start Simple and clean Fewer errors Finding errors.
Welcome to CS 362 Applied Software Engineering
Testing. Today’s Topics Why Testing? Basic Definitions Kinds of Testing Test-driven Development Code Reviews (not testing) 1.
Scientific Debugging. Errors in Software Errors are unexpected behaviors or outputs in programs As long as software is developed by humans, it will contain.
Chapter 1: Fundamental of Testing Systems Testing & Evaluation (MNN1063)
1 Working Software (Testing) Today’s Topic Why testing? Some basic definitions Kinds of testing Test-driven development Code reviews (not testing) Today.
1 Welcome to CS 562 Applied Software Engineering Dr. Alex Groce (KEC 3067) Testing, debugging, running programs Design for testability Implementation (actual.
Introduction to Software Testing Why Do We Test Software? Dr. Pedro Mejia Alvarez From Book: Introduction to Software Testing, P.Ammann&J.Offutt.
Program Correctness. The designer of a distributed system has the responsibility of certifying the correctness of the system before users start using.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
CS 5150 Software Engineering Lecture 22 Reliability 3.
Topic 10Summer Ariane 5 Some slides based on talk from Sommerville.
1 Welcome to CS 362 Applied Software Engineering Dr. Alex Groce (KEC 3067) Testing, debugging, running programs Design for testability Implementation (actual.
Software Testing.
Paul Ammann & Jeff Offutt
Why study Software Design/Engineering ?
Types for Programs and Proofs
Testing and Debugging PPT By :Dr. R. Mall.
Dr. Eng. Amr T. Abdel-Hamid
Software Testing Introduction CS 4501 / 6501 Software Testing
Welcome to CS 119 Reliable Software: Testing and Monitoring
Lessons from The File Copy Assignment
Verification and Testing
Verification and Validation Overview
Faults, Errors, Failures CS 4501 / 6501 Software Testing
Formal Methods (i.e. mathematical, algorithmic) for Software and Hardware Designs and, more generally, Design Tools and Technologies
Paul Ammann & Jeff Offutt
(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.
CSE403 Software Engineering Autumn 2000 More Testing
Working Software (Testing)
Presentation transcript:

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 a.k.a. BUGS

2 Bugs “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) Hopper’s “bug” (moth stuck in a relay on an early machine)

3 Testing What isn’t software testing? Purely static analysis: examining a program’s source code or binary in order to find bugs, but not executing the program Good stuff, and very important, but it’s not testing

4 Why Testing? Ideally: we prove code correct, using formal mathematical techniques (with a computer, not chalk) Extremely difficult: for some trivial programs (100 lines) and many small (5K lines) programs Simply not practical to prove correctness in most cases – often not even for safety or mission critical code

5 Why Testing? Nearly ideally: use symbolic or abstract model checking to prove the system correct Automatically extracts a mathematical abstraction from a system Proves properties over all possible executions In practice, can work well for very simple properties (“this program never crashes in this particular way”), but can’t handle complex properties (“this is a working file system”) Doesn’t work well for programs with complex data structures (like a file system)

6 As a last resort… … we can actually run the program, to see if it works This is software testing Always necessary, even when you can prove correctness – because the proof is seldom directly tied to the actual code that runs “Beware of bugs in the above code; I have only proved it correct, not tried it” – Knuth

7 Why Does Testing Matter? 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 Major failures: Ariane 5 explosion, Mars Polar Lander, Intel’s Pentium FDIV bug Insufficient testing of safety-critical software can cost lives: THERAC-25 radiation machine: 3 dead We want our programs to be reliable Testing is how, in most cases, we find out if they are Mars Polar Lander crash THERAC-25 design Ariane 5: exception-handling bug : forced self destruct on maiden flight (64-bit to 16-bit conversion: about 370 million $ lost)

8 Why is Testing Hard? Because the only way to be SURE a program has no bugs is to run all possible executions We can’t do that

9 Example: File System Testing File system is a library, called by other components of the flight software Accepts a fixed set of operations that manipulate files: OperationResult mkdir (“/eng”, …)SUCCESS mkdir (“/data”, …)SUCCESS creat (“/data/image01”, …)SUCCESS creat (“/eng/fsw/code”, …)ENOENT mkdir (“/data/telemetry”, …)SUCCESS unlink (“/data/image01”) SUCCESS / /eng/data image01/telemetry File system

10 Example: File System Testing Easy to detect many errors: we have access to many working file systems, and can just compare results Choose operation F Perform F on Tested FS Perform F on Reference (if applicable) Compare return values Compare error codes Compare file systems Check invariants (inject a fault, possibly: timed reset, hardware failure, etc.)

11 Example: File System Testing How hard would it be to just try “all” the possibilities? Consider only core 7 operations ( mkdir, rmdir, creat, open, close, read, write ) Most of these take either a file name or a numeric argument, or both Even for a “reasonable” (but not provably safe) limitation of the parameters, there are executions of length 10 to try Not a realistic possibility (unless we have years to test)

12 The Testing Problem This is a primary topic of this class: what “questions” do we pose to the software, i.e., How do we select a small set of executions out of a very large set of executions? Fundamental problem of software testing research and practice An open (and essentially unsolvable, in the general case) problem

13 Faults, Errors, and Failures Fault: a static flaw in a program What we usually think of as “a bug” Error: a bad program state that results from a fault Not every fault always produces an error Failure: an observable incorrect behavior of a program as a result of an error Not every error ever becomes visible

14 To Expose a Fault with a Test Reachability: the test much actually reach and execute the location of the fault Infection: the fault must actually corrupt the program state (produce an error) Propagation: the error must persist and cause an incorrect output – a failure Which tests will achieve all three?

15 What is Testing? What is software testing? Running a program In order to find faults But also, in order to Increase our confidence that the program has high quality and low risk Because we can never be sure we caught all bugs How does a set of executions increase confidence? Sometimes, by algorithmic argument Sometimes by less formal arguments