based on the book by paul ammann & jeff...

24
1 Based on the book by Paul Ammann & Jeff Offutt www.cs.gmu.edu/~offutt/softwaretest/ 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, education or tools ! Tests are key to functional requirements – but who builds those tests ? TAROT, June 2010 © Jeff 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

Upload: others

Post on 28-May-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Based on the book by Paul Ammann & Jeff Offutttarot2010.ist.tugraz.at/slides/offutt-MDTD-TAROT2010.pdf · 7 This is the most technical job in software testing Requires knowledge of

1

Based on the book by Paul Ammann & Jeff Offutt

www.cs.gmu.edu/~offutt/softwaretest/

 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, education or tools ! –  Tests are key to functional requirements – but who builds those tests ?

TAROT, June 2010 © Jeff 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

Page 2: Based on the book by Paul Ammann & Jeff Offutttarot2010.ist.tugraz.at/slides/offutt-MDTD-TAROT2010.pdf · 7 This is the most technical job in software testing Requires knowledge of

2

OUTLINE

TAROT, June 2010 © Jeff Offutt 3

1.  Spectacular Software Failures

2.  What Do We Do When We Test ?

•  Test Activities and Model-Driven Testing

3.  Changing Notions of Testing

4.  Test Maturity Levels

5.  Summary

Costly Software Failures

TAROT, June 2010 © Jeff Offutt 4

 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 – Credit card sales applications : $2.4 million per hour

  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

Page 3: Based on the book by Paul Ammann & Jeff Offutttarot2010.ist.tugraz.at/slides/offutt-MDTD-TAROT2010.pdf · 7 This is the most technical job in software testing Requires knowledge of

3

Spectacular Software Failures

TAROT, June 2010 © Jeff Offutt 5

  Major failures: Ariane 5 explosion, Mars Polar Lander, Intel’s Pentium FDIV bug

  Poor testing of safety-critical software can cost lives :   THERAC-25 radiation machine: 3 dead

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)

  NASA’s Mars lander: September 1999, crashed due to a units integration fault

  Toyota brakes : Dozens dead, thousands of crashes

TAROT, June 2010 © Jeff Offutt 6

Quote due to Dr. Mark Harman

Page 4: Based on the book by Paul Ammann & Jeff Offutttarot2010.ist.tugraz.at/slides/offutt-MDTD-TAROT2010.pdf · 7 This is the most technical job in software testing Requires knowledge of

4

TAROT, June 2010 © Jeff Offutt 7

Loss of autopilot

Loss of both the commander’s and the co‑pilot’s primary flight and navigation displays !

Loss of most flight deck lighting and intercom

TAROT, June 2010 © Jeff Offutt 8

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

Page 5: Based on the book by Paul Ammann & Jeff Offutttarot2010.ist.tugraz.at/slides/offutt-MDTD-TAROT2010.pdf · 7 This is the most technical job in software testing Requires knowledge of

5

  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

TAROT, June 2010 © Jeff Offutt 9

OUTLINE

TAROT, June 2010 © Jeff Offutt 10

1.  Spectacular Software Failures

2.  What Do We Do When We Test ?

•  Test Activities and Model-Driven Testing

3.  Changing Notions of Testing

4.  Test Maturity Levels

5.  Summary

Page 6: Based on the book by Paul Ammann & Jeff Offutttarot2010.ist.tugraz.at/slides/offutt-MDTD-TAROT2010.pdf · 7 This is the most technical job in software testing Requires knowledge of

6

 Test Design is the process of designing input values that will effectively test software

 Test design is one of several activities for testing software – Most mathematical – Most technically challenging

 This process is based on my text book with Ammann, Introduction to Software Testing

 http://www.cs.gmu.edu/~offutt/softwaretest/

TAROT, June 2010 © Jeff Offutt 11

  Testing can be broken up into four general types of activities 1.  Test Design 2.  Test Automation 3.  Test Execution 4.  Test Evaluation

  Each type of activity requires different skills, background knowledge, education and training

  No reasonable software development organization uses the same people for requirements, design, implementation, integration and configuration control

TAROT, June 2010 © Jeff Offutt 12

1.a) Criteria-based 1.b) Human-based

Page 7: Based on the book by Paul Ammann & Jeff Offutttarot2010.ist.tugraz.at/slides/offutt-MDTD-TAROT2010.pdf · 7 This is the most technical job in software testing Requires knowledge of

7

  This is the most technical job in software testing   Requires knowledge of :

–  Discrete math –  Programming –  Testing

  Requires much of a traditional CS degree   This is intellectually stimulating, rewarding, and challenging   Test design is analogous to software architecture on the development

side   Using people who are not qualified to design tests is a sure way to

get ineffective tests

TAROT, June 2010 © Jeff Offutt 13

  This is much harder than it may seem to developers   Criteria-based approaches can be blind to special situations   Requires knowledge of :

–  Domain, testing, and user interfaces

  Requires almost no traditional CS –  A background in the domain of the software is essential –  An empirical background is very helpful (biology, psychology, …) –  A logic background is very helpful (law, philosophy, math, …)

  This is intellectually stimulating, rewarding, and challenging –  But not to typical CS majors – they want to solve problems and build things

TAROT, June 2010 © Jeff Offutt 14

Page 8: Based on the book by Paul Ammann & Jeff Offutttarot2010.ist.tugraz.at/slides/offutt-MDTD-TAROT2010.pdf · 7 This is the most technical job in software testing Requires knowledge of

8

  This is slightly less technical   Requires knowledge of programming

–  Fairly straightforward programming – small pieces and simple algorithms

  Requires very little theory   Very boring for test designers   More creativity needed for embedded / RT software   Programming is out of reach for many domain experts   Who is responsible for determining and embedding the expected

outputs ? –  Test designers may not always know the expected outputs –  Test evaluators need to get involved early to help with this

TAROT, June 2010 © Jeff Offutt 15

 This is easy – and trivial if the tests are well automated  Requires basic computer skills

–  Interns – Employees with no technical background

 Asking qualified test designers to execute tests is a sure way to convince them to look for a development job

  If, for example, GUI tests are not well automated, this requires a lot of manual labor

 Test executors have to be very careful and meticulous with bookkeeping

TAROT, June 2010 © Jeff Offutt 16

Page 9: Based on the book by Paul Ammann & Jeff Offutttarot2010.ist.tugraz.at/slides/offutt-MDTD-TAROT2010.pdf · 7 This is the most technical job in software testing Requires knowledge of

9

  This is much harder than it may seem   Requires knowledge of :

–  Domain –  Testing –  User interfaces and psychology

  Usually requires almost no traditional CS –  A background in the domain of the software is essential –  An empirical background is very helpful (biology, psychology, …) –  A logic background is very helpful (law, philosophy, math, …)

  This is intellectually stimulating, rewarding, and challenging –  But not to typical CS majors – they want to solve problems and build things

TAROT, June 2010 © Jeff Offutt 17

  A mature test organization needs only one test designer to work with several test automators, executors and evaluators

  Improved automation will reduce the number of test executors –  Theoretically to zero … but not in practice

  Putting the wrong people on the wrong tasks leads to inefficiency, low job satisfaction and low job performance

–  A qualified test designer will be bored with other tasks and look for a job in development

–  A qualified test evaluator will not understand the benefits of test criteria

  Test evaluators have the domain knowledge, so they must be free to add tests that “blind” engineering processes will not think of

  The four test activities are quite different

TAROT, June 2010 © Jeff Offutt 18

Page 10: Based on the book by Paul Ammann & Jeff Offutttarot2010.ist.tugraz.at/slides/offutt-MDTD-TAROT2010.pdf · 7 This is the most technical job in software testing Requires knowledge of

10

TAROT, June 2010 © Jeff Offutt 19

 This approach lets one test designer do the math

 Then traditional testers and programmers can do their parts – Find values – Automate the tests – Run the tests – Evaluate the tests

TAROT, June 2010 © Jeff Offutt 20

Page 11: Based on the book by Paul Ammann & Jeff Offutttarot2010.ist.tugraz.at/slides/offutt-MDTD-TAROT2010.pdf · 7 This is the most technical job in software testing Requires knowledge of

11

TAROT, June 2010 © Jeff Offutt 21

software artifact

model / structure

test requirements

refined requirements /

test specs

input values

test cases

test scripts

test results

pass / fail

IMPLEMENTATION ABSTRACTION

LEVEL

DESIGN ABSTRACTION

LEVEL

test requirements

TAROT, June 2010 © Jeff Offutt 22

software artifact

model / structure

test requirements

refined requirements /

test specs

input values

test cases

test scripts

test results

pass / fail

IMPLEMENTATION ABSTRACTION

LEVEL

DESIGN ABSTRACTION

LEVEL

analysis

criterion refine

generate

prefix postfix

expected

automate execute evaluate

test requirements domain

analysis

feedback

Page 12: Based on the book by Paul Ammann & Jeff Offutttarot2010.ist.tugraz.at/slides/offutt-MDTD-TAROT2010.pdf · 7 This is the most technical job in software testing Requires knowledge of

12

TAROT, June 2010 © Jeff Offutt 23

software artifact

model / structure

test requirements

refined requirements /

test specs

input values

test cases

test scripts

test results

pass / fail

IMPLEMENTATION ABSTRACTION

LEVEL

DESIGN ABSTRACTION

LEVEL Raising our abstraction level makes

test design MUCH easier

TAROT, June 2010 © Jeff Offutt 24

Software Artifact : Java Method /** * Return index of node n at the * first position it appears, * -1 if it is not present */ public int indexOf (Node n) { for (int i=0; i<path.size(); i++) if (path.get(i).equals(n)) return i; return -1; }

4 5

3

2

1 i = 0

i < path.size()

if

return i return -1

Control Flow Graph

Page 13: Based on the book by Paul Ammann & Jeff Offutttarot2010.ist.tugraz.at/slides/offutt-MDTD-TAROT2010.pdf · 7 This is the most technical job in software testing Requires knowledge of

13

TAROT, June 2010 © Jeff Offutt 25

Support tool for graph coverage http://www.cs.gmu.edu/~offutt/softwaretest/

4 5

3

2

1

Graph Abstract version

Edges 1 2 2 3 3 2 3 4 2 5 Initial Node: 1 Final Nodes: 4, 5

6 requirements for Edge-Pair Coverage 1. [1,2,3] 2. [1,2,5] 3. [2,3,4] 4. [2,3,2] 5. [3,2,3] 6. [3,2,5]

Test Paths [1,2,5] [1,2,3,2,5] [1,2,3,2,3,4]

Find values …

OUTLINE

TAROT, June 2010 © Jeff Offutt 26

1.  Spectacular Software Failures

2.  What Do We Do When We Test ?

•  Test Activities and Model-Driven Testing

3.  Changing Notions of Testing

4.  Test Maturity Levels

5.  Summary

Page 14: Based on the book by Paul Ammann & Jeff Offutttarot2010.ist.tugraz.at/slides/offutt-MDTD-TAROT2010.pdf · 7 This is the most technical job in software testing Requires knowledge of

14

TAROT, June 2010 © Jeff Offutt 27

 Old view considered testing at each software development phase to be very different form other phases – Unit, module, integration, system …

 New view is in terms of structures and criteria – Graphs, logical expressions, syntax, input space

 Test design is largely the same at each phase – Creating the model is different – Choosing values and automating the tests is different

TAROT, June 2010 © Jeff Offutt 28

Class A

method mA1()

method mA2()

Class B

method mB1()

method mB2()

main Class P   Acceptance testing: Is

the software acceptable to the user?

  Integration testing: Test how modules interact with each other

  System testing: Test the overall functionality of the system

  Module testing: Test each class, file, module or component

  Unit testing: Test each unit (method) individually This view obscures underlying similarities

Page 15: Based on the book by Paul Ammann & Jeff Offutttarot2010.ist.tugraz.at/slides/offutt-MDTD-TAROT2010.pdf · 7 This is the most technical job in software testing Requires knowledge of

15

TAROT, June 2010 © Jeff Offutt 29

g Test Requirements : Specific things that must be satisfied or covered during testing

g Test Criterion : A collection of rules and a process that define test requirements

A tester’s job is simple : Define a model of the software, then find ways to cover it

 These structures can be extracted from lots of software artifacts – Graphs can be extracted from UML use cases, finite

state machines, source code, … – Logical expressions can be extracted from decisions in

program source, guards on transitions, conditionals in use cases, …

 This is not the same as “model-based testing,” which derives tests from a model that describes some aspects of the system under test – The model usually describes part of the behavior – The source is usually not considered a model

TAROT, June 2010 © Jeff Offutt 30

Page 16: Based on the book by Paul Ammann & Jeff Offutttarot2010.ist.tugraz.at/slides/offutt-MDTD-TAROT2010.pdf · 7 This is the most technical job in software testing Requires knowledge of

16

TAROT, June 2010 © Jeff Offutt 31

Coverage Overview

Applied to

Applied to

Applied to

TAROT, June 2010 © Jeff Offutt 32

 Black-box testing : Deriving tests from external descriptions of the software, including specifications, requirements, and design

 White-box testing : Deriving tests from the source code internals of the software, specifically including branches, individual conditions, and statements

 Model-based testing : Deriving tests from a model of the software (such as a UML diagram

Page 17: Based on the book by Paul Ammann & Jeff Offutttarot2010.ist.tugraz.at/slides/offutt-MDTD-TAROT2010.pdf · 7 This is the most technical job in software testing Requires knowledge of

17

OUTLINE

TAROT, June 2010 © Jeff Offutt 33

1.  Spectacular Software Failures

2.  What Do We Do When We Test ?

•  Test Activities and Model-Driven Testing

3.  Changing Notions of Testing

4.  Test Maturity Levels

5.  Summary

TAROT, June 2010 © Jeff Offutt 34

 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

Page 18: Based on the book by Paul Ammann & Jeff Offutttarot2010.ist.tugraz.at/slides/offutt-MDTD-TAROT2010.pdf · 7 This is the most technical job in software testing Requires knowledge of

18

TAROT, June 2010 © Jeff Offutt 35

 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

TAROT, June 2010 © Jeff Offutt 36

 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

Page 19: Based on the book by Paul Ammann & Jeff Offutttarot2010.ist.tugraz.at/slides/offutt-MDTD-TAROT2010.pdf · 7 This is the most technical job in software testing Requires knowledge of

19

TAROT, June 2010 © Jeff Offutt 37

 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?

TAROT, June 2010 © Jeff Offutt 38

 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 the consequences catastrophic

 Testers and developers work together to reduce risk

Page 20: Based on the book by Paul Ammann & Jeff Offutttarot2010.ist.tugraz.at/slides/offutt-MDTD-TAROT2010.pdf · 7 This is the most technical job in software testing Requires knowledge of

20

TAROT, June 2010 © Jeff Offutt 39

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

OUTLINE

TAROT, June 2010 © Jeff Offutt 40

1.  Spectacular Software Failures

2.  What Do We Do When We Test ?

•  Test Activities and Model-Driven Testing

3.  Changing Notions of Testing

4.  Test Maturity Levels

5.  Summary

Page 21: Based on the book by Paul Ammann & Jeff Offutttarot2010.ist.tugraz.at/slides/offutt-MDTD-TAROT2010.pdf · 7 This is the most technical job in software testing Requires knowledge of

21

 Testers need more and better software tools  Testers need to adopt practices and techniques that

lead to more efficient and effective testing – More education – Different management organizational strategies

 Testing / QA teams need more technical expertise – Developer expertise has been increasing dramatically

 Testing / QA teams need to specialize more – This same trend happened for development in the 1990s

TAROT, June 2010 © Jeff Offutt 41

TAROT, June 2010 © Jeff Offutt 42

1.  Lack of test education

2.  Necessity to change process

3.  Usability of tools

4.  Weak and ineffective tools

Number of UG CS programs in US that require testing ? Number of MS CS programs in US that require testing ? Number of UG testing classes in the US ?

Most test tools don’t do much – but most users do not realize they could be better

Adoption of many test techniques and tools require changes in development process

Many testing tools require the user to know the underlying theory to use them

This is very expensive for most software companies

Do we need to know how an internal combustion engine works to drive ? Do we need to understand parsing and code generation to use a compiler ?

Few tools solve the key technical problem – generating test values automatically

Bill Gates says half of MS engineers are testers, programmers spend half their time testing

Page 22: Based on the book by Paul Ammann & Jeff Offutttarot2010.ist.tugraz.at/slides/offutt-MDTD-TAROT2010.pdf · 7 This is the most technical job in software testing Requires knowledge of

22

1.  Isolate : Invent processes and techniques that isolate the theory from most test practitioners

2.  Disguise : Discover engineering techniques, standards and frameworks that disguise the theory

3.  Embed : Theoretical ideas in tools 4.  Experiment : Demonstrate economic value of

criteria-based testing and ATDG –  Which criteria should be used and when ? –  When does the extra effort pay off ?

5.  Integrate high-end testing with development

TAROT, June 2010 © Jeff Offutt 43

1.  Disguise theory from engineers in classes 2.  Omit theory when it is not needed 3.  Restructure curriculum to teach more than test

design and theory – Test automation – Test evaluation – Human-based testing – Test-driven development

TAROT, June 2010 © Jeff Offutt 44

Page 23: Based on the book by Paul Ammann & Jeff Offutttarot2010.ist.tugraz.at/slides/offutt-MDTD-TAROT2010.pdf · 7 This is the most technical job in software testing Requires knowledge of

23

1.  Reorganize test and QA teams to make effective use of individual abilities

–  One math-head can support many testers 2.  Retrain test and QA teams

–  Use a process like MDTD –  Learn more of the concepts in testing

3.  Encourage researchers to embed and isolate –  We are very responsive to research grants

4.  Get involved in curricular design efforts through industrial advisory boards

TAROT, June 2010 © Jeff Offutt 45

1.  Increased specialization in testing teams will lead to more efficient and effective testing

2.  Testing and QA teams will have more technical expertise 3.  Developers will have more knowledge about testing and

motivation to test better 4.  Agile processes puts testing first—putting pressure on

both testers and developers to test better 5.  Testing and security are starting to merge 6.  We will develop new ways to test connections within

software-based systems

TAROT, June 2010 © Jeff Offutt 46

Page 24: Based on the book by Paul Ammann & Jeff Offutttarot2010.ist.tugraz.at/slides/offutt-MDTD-TAROT2010.pdf · 7 This is the most technical job in software testing Requires knowledge of

24

© Jeff Offutt 47 TAROT, June 2010