Ch01-whyTest - 1 Introduction to Software Testing 2nd...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1 Introduction to Software Testing ( 2nd edition ) Chapter 1 Why Do We Test Software? Paul Ammann & Jeff Offutt http://www.cs.gmu.edu/~offutt/softwaretest/ First version, 28 August 2011 Testing in the 21st Century Software defines behavior – network routers, finance, switching networks, other infrastructure Today’s software market : Industry is going – is much bigger – is more competitive – has more users Embedded Control Applications – airplanes, air traffic control – spaceships watche – PDAs – memory seats – DVD players through a revolution in what testing means to the success of software products – watches – ovens – remote controllers 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 – garage door openers – cell phones 2 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 Software Faults, Errors & Failures Software Fault : A static defect in the software Software Failure : External, incorrect behavior with respect to the 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 Introduction to Software Testing, Edition 2 (Ch 1) © Ammann & Offutt 4 Faults in software are equivalent to design mistakes in Faults in software are equivalent to design mistakes in hardware. hardware. Software does not degrade. Software does not degrade. 3 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 Most medical problems result from external attacks (bacteria, viruses) or physical degradation as we age. (bacteria, viruses) or physical degradation as we age. They were there at the beginning and do not “appear” when They were there at the beginning and do not “appear” when a part wears out. a part wears out. A Concrete Example public static int numZero (int [ ] arr) Fault: Should start searching at 0, not 1 Test 1 { // 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) { t++ Test 1 [ 2, 7, 0 ] Expected: 1 Actual: 1 Test 2 [ 0, 2, 7 ] Expected: 1 Error: i is 1, not 0, on the first iteration Failure: none Introduction to Software Testing, Edition 2...
View Full Document

This note was uploaded on 01/17/2012 for the course SWE 637 taught by Professor Offutt,j during the Fall '08 term at George Mason.

Page1 / 14

Ch01-whyTest - 1 Introduction to Software Testing 2nd...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online