Model-Driven Test Design Jeff Offutt Professor, Software Engineering George Mason University Fairfax, VA USA

Slides:



Advertisements
Similar presentations
Software change management
Advertisements

Introduction to Software Testing Chapter 1 Model-Driven Test Design Paul Ammann & Jeff Offutt
Introduction to Software Testing Chapter 1 Introduction & The Model-Driven Test Design Process Paul Ammann & Jeff Offutt
Model-Driven Test Design Based on the book by Paul Ammann & Jeff Offutt Jeff Offutt Professor, Software Engineering.
Software Verification
CITS5501 Software Testing and Quality Assurance Testing – Introduction Material from Introduction to Software Testing, ed 2, Ammann & Offutt.
The Relationship between Cost & Quality Submitted by: Haya A. El-Agha Submitted to: Eng. Hani Abu Amr.
Introduction to Software Testing Chapter 9.2 Challenges in Testing Software – Software Testability Paul Ammann & Jeff Offutt
Introduction to Software Testing (2nd edition) Chapter 5 Criteria-Based Test Design Paul Ammann & Jeff Offutt
Of 23 Generating Automated Tests from Behavioral Models Jeff Offutt (Research with Dr. Nan Li, currently with MediData Solutions) Software Engineering.
Introduction to Software Testing Chapter 9.3 Challenges in Testing Software Test Criteria and the Future of Testing Paul Ammann & Jeff Offutt
Comparison of Unit-Level Automated Test Generation Tools Shuang Wang Co-authored with Jeff Offutt April 4,
Of 46 How To Teach Testing Based on the book Introduction to Software Testing with Paul Ammann Jeff Offutt Professor,
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 (2nd edition) Chapter 1 Why Do We Test Software? Paul Ammann & Jeff Offutt
Lecture 1: Introduction.
Paul Ammann & Jeff Offutt
Automatically Generating Test Data for Web Applications Jeff Offutt Professor, Software Engineering George Mason University Fairfax, VA USA
Model-Driven Test Design Jeff Offutt Professor, Software Engineering George Mason University Fairfax, VA USA
Terms: Test (Case) vs. Test Suite
Introduction to Software Testing Paul Ammann & Jeff Offutt Updated 24-August 2010.
Cost / Benefits Arguments for Automation and Coverage Jeff Offutt Professor, Software Engineering George Mason University Fairfax, VA USA
Cost / Benefits Arguments for Automation and Coverage Jeff Offutt Professor, Software Engineering George Mason University Fairfax, VA USA
Introduction to Software Testing Chapter 9.3 Challenges in Testing Software Test Criteria and the Future of Testing Paul Ammann & Jeff Offutt
Model-Driven Test Design Jeff Offutt Professor, Software Engineering George Mason University Fairfax, VA USA
Quality Attributes of Web Software Applications – Jeff Offutt By Julia Erdman SE 510 October 8, 2003.
Introduction to Software Testing Chapter 1 Introduction Paul Ammann & Jeff Offutt
Sommerville, Ammann-Offutt, Mejia, 2009 Software Engineering Slide 1 Verification and Validation.
Automatic Test Data Generation The Killer App for Software Testing Jeff Offutt Software Engineering George Mason University Fairfax, VA USA
OBJECT ORIENTED SYSTEM ANALYSIS AND DESIGN. COURSE OUTLINE The world of the Information Systems Analyst Approaches to System Development The Analyst as.
Dr. Tom WayCSC Testing and Test-Driven Development CSC 4700 Software Engineering Based on Sommerville slides.
From Quality Control to Quality Assurance…and Beyond Alan Page Microsoft.
Software Engineering Experimentation Example Experimental Design Jeff Offutt Robert Nilsson.
Software Product Line Material based on slides and chapter by Linda M. Northrop, SEI.
Of 18 Is Bytecode Instrumentation as Good as Source Instrumentation? An Empirical Study with Industrial Tools Nan Li, Xin Meng, Jeff Offutt, and Lin Deng.
The Model-Driven Test Design Process Based on the book by Paul Ammann & Jeff Offutt Jeff Offutt Professor, Software.
Introduction to Software Testing Chapter 9.1 Challenges in Testing Software – Testing for Emergent Properties: Safety and Security.
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.
CS5103 Software Engineering Lecture 02 More on Software Process Models.
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)
Introduction to Software Testing (2nd edition) Chapter 4 Putting Testing First Paul Ammann & Jeff Offutt August.
Automatic Test Data Generation : Who, When and Where? Jeff Offutt Software Engineering George Mason University Fairfax, VA USA
Introduction to Software Testing Why Do We Test Software? Dr. Pedro Mejia Alvarez From Book: Introduction to Software Testing, P.Ammann&J.Offutt.
Formal Methods in Software Engineering1 Today’s Agenda  Mailing list  Syllabus  Introduction.
Introduction to Software Testing Chapter 1 Introduction Paul Ammann & Jeff Offutt
Introduction to Software Testing Model-Driven Test Design and Coverage testing Paul Ammann & Jeff Offutt Update.
Introduction to Software Testing Testing Strategy Dr. Pedro Mejia Alvarez From Book: Introduction to Software Testing: P.Amman & J.Offutt.
Software Testing and Quality Assurance Practical Considerations (1) 1.
INTRODUCTION CSE 470 : Software Engineering. Goals of Software Engineering To produce software that is absolutely correct. To produce software with minimum.
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
Paul Ammann & Jeff Offutt
Paul Ammann & Jeff Offutt
Chapter 1- Introduction
Paul Ammann & Jeff Offutt
Generating Automated Tests from Behavior Models
Software Testing Introduction CS 4501 / 6501 Software Testing
Paul Ammann & Jeff Offutt
Software Testing and Maintenance Introduction
Script-less Automation: An Approach to Shift-Left.
Paul Ammann & Jeff Offutt
Introduction to Software Testing Chapter 2 Model-Driven Test Design
It is great that we automate our tests, but why are they so bad?
Introduction to Software Testing
Software Testing and Maintenance Maintenance and Evolution Overview
Test Automation CS 4501 / 6501 Software Testing
(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.
Presentation transcript:

Model-Driven Test Design Jeff Offutt Professor, Software Engineering George Mason University Fairfax, VA USA

OUTLINE Telechips, October 2009© Jeff Offutt2 1.Consequences of Poor Testing 2.Why is Testing Done so Poorly 3.Model-Driven Test Design 4.How to Improve Testing 5.Software Testing is Changing 1.Consequences of Poor Testing 2.Why is Testing Done so Poorly 3.Model-Driven Test Design 4.How to Improve Testing 5.Software Testing is Changing We are in the middle of a revolution in how software is tested Research is finally meeting practice

Software is a Skin that Surrounds Our Civilization Telechips, October 2009© Jeff Offutt3 Quote due to Dr. Mark Harman

Testing in the 21st Century We are going through a time of change 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 Telechips, October 2009© Jeff Offutt4 – 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

Why Does Testing Matter? Telechips, October 2009© Jeff Offutt5 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 Major failures: Ariane 5 explosion, Mars Polar Lander, Intel’s Pentium FDIV bug n Insufficient testing of safety-critical software can cost lives: n THERAC-25 radiation machine: 3 dead n We need software to be reliable –Testing is usually how we ascertain reliability 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)

Airbus 319 Software Malfunction Telechips, October 2009© Jeff Offutt6 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

NorthAm 2003 Northeast Blackout Telechips, October 2009© Jeff Offutt7 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

Failures in Production Software NASA’s Mars lander, September 1999, crashed due to a units integration fault—over $50 million US ! 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 Stronger testing could solve most of these problems Telechips, October 2009© Jeff Offutt8 World-wide monetary loss due to poor software is staggering Thanks to Dr. Sreedevi Sampath

Web Application Problems Telechips, October 2009© Jeff Offutt9 v — Vasileios Papadimitriou. Masters thesis, Automating Bypass Testing for Web Applications, GMU 2006

Testing in the 21st Century More safety critical, real-time software Enterprise applications means bigger programs, more users Embedded software is ubiquitous … check your pockets 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 Telechips, October 2009© Jeff Offutt10 Industry desperately needs researchers’ inventions !

OUTLINE Telechips, October 2009© Jeff Offutt11 1.Consequences of Poor Testing 2.Why is Testing Done so Poorly 3.Model-Driven Test Design 4.How to Improve Testing 5.Software Testing is Changing 1.Consequences of Poor Testing 2.Why is Testing Done so Poorly 3.Model-Driven Test Design 4.How to Improve Testing 5.Software Testing is Changing

Software Testing—Academic View 1970s and 1980s : Academics looked almost exclusively at unit testing –Meanwhile industry & government focused almost exclusively on system testing 1990s : Some academics looked at system testing, some at integration testing –Growth of OO put complexity in the interconnections 2000s : Academics trying to move our rich collection of ideas into practice –Reliability requirements in industry & government are increasing exponentially Telechips, October 2009© Jeff Offutt12

Academics and Practitioners Academics focus on coverage criteria with strong bases in theory—quantitative techniques –Industry has focused on human-driven, domain- knowledge based, qualitative techniques Practitioners said “criteria-based coverage is too expensive” –Academics said “human-based testing is more expensive and ineffective” Telechips, October 2009© Jeff Offutt13 Practice is going through a revolution in what testing means to the success of software products

How to Improve Testing ? We need more and better software tools –A stunning increase in available tools in the last 10 years! We need to adopt practices and techniques that lead to more efficient and effective testing –More education –Different management organizational strategies Testing / QA teams need to specialize more –This same trend happened for development in the 1990s Testing / QA teams need more technical expertise –Developer expertise has been increasing dramatically Telechips, October 2009© Jeff Offutt14

OUTLINE Telechips, October 2009© Jeff Offutt15 1.Consequences of Poor Testing 2.Why is Testing Done so Poorly 3.Model-Driven Test Design 4.How to Improve Testing 5.Software Testing is Changing 1.Consequences of Poor Testing 2.Why is Testing Done so Poorly 3.Model-Driven Test Design 4.How to Improve Testing 5.Software Testing is Changing

Test Design in Context 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 Telechips, October 2009© Jeff Offutt16

Types of Test Activities 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 Telechips, October 2009© Jeff Offutt17 Why do test organizations still use the same people for all four test activities?? This clearly wastes resources 1.a) Criteria-based 1.b) Human-based

1. Test Design – (a) Criteria-Based 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 Telechips, October 2009© Jeff Offutt18 Design test values to satisfy coverage criteria or other engineering goal

1. Test Design – (b) Human-Based 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 Telechips, October 2009© Jeff Offutt19 Design test values based on domain knowledge of the program and human knowledge of testing

2. Test Automation 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 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 Telechips, October 2009© Jeff Offutt20 Embed test values into executable scripts

3. Test Execution This is easy –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 Telechips, October 2009© Jeff Offutt21 Run tests on the software and record the results

4. Test Evaluation 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 Telechips, October 2009© Jeff Offutt22 Evaluate results of testing, report to developers

Summary of Test Activities These four general test activities are quite different It is a poor use of resources to use people inappropriately Telechips, October 2009© Jeff Offutt23 1a.DesignDesign test values to satisfy engineering goals CriteriaRequires knowledge of discrete math, programming and testing 1b.DesignDesign test values from domain knowledge and intuition HumanRequires knowledge of domain, UI, testing 2.AutomationEmbed test values into executable scripts Requires knowledge of scripting 3.ExecutionRun tests on the software and record the results Requires very little knowledge 4.EvaluationEvaluate results of testing, report to developers Requires domain knowledge Most test teams use the same people for ALL FOUR activities !!

Other Testing Activities Test management : Sets policy, organizes team, interfaces with development, chooses criteria, decides how much automation is needed, … Test maintenance : Tests must be saved for reuse as software evolves –Requires cooperation between test designers and automators –Deciding when to trim the test suite is partly policy and partly technical – and in general, very hard ! –Tests should be put in configuration control Test documentation : All parties participate –Each test must document “why” – criterion and test requirement satisfied or a rationale for human-designed tests –Traceability throughout the process must be ensured –Documentation must be kept in the automated tests Telechips, October 2009© Jeff Offutt24

Number of Personnel A mature test organization only needs 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 Telechips, October 2009© Jeff Offutt25

Applying Test Activities Telechips, October 2009© Jeff Offutt26 To use our people effectively and to test efficiently we need a process that lets test designers raise their level of abstraction

Model-Driven Test Design – Steps Telechips, October 2009© Jeff Offutt27 software artifacts model / structure test requirements refined requirements / test specs input values test cases test scripts test results pass / fail IMPLEMENTATION ABSTRACTION LEVEL DESIGN ABSTRACTION LEVEL mathematical analysis criterionrefine generate prefix postfix expected automate execute evaluate test requirements domain analysis feedback

MDTD – Activities Telechips, October 2009© Jeff Offutt28 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 Design Test Execution Test Evaluation Raising our abstraction level makes test design MUCH easier Herebemath Test Design

Using MDTD in Practice 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 Telechips, October 2009© Jeff Offutt29 Testers ain’t mathematicians !

OUTLINE Telechips, October 2009© Jeff Offutt30 1.Consequences of Poor Testing 2.Why is Testing Done so Poorly 3.Model-Driven Test Design 4.How to Improve Testing 5.Software Testing is Changing 1.Consequences of Poor Testing 2.Why is Testing Done so Poorly 3.Model-Driven Test Design 4.How to Improve Testing 5.Software Testing is Changing

Mismatch in Needs and Goals Industry & contractors want simple and easy testing –Testers with no background in computing or math Universities are graduating scientists –Industry needs engineers Testing needs to be done more rigorously Agile processes put lots of demands on testing –Programmers have to do unit testing – with no training, education or tools ! –Tests are key components of functional requirements – but who builds those tests ? Telechips, October 2009© Jeff Offutt31 Bottom line result—lots of poor software

How to Improve Testing ? 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 Telechips, October 2009© Jeff Offutt32

Quality of Industry Tools A recent evaluation of three industrial automatic unit test data generators : –Jcrasher, TestGen, JUB –Generate tests for Java classes –Evaluated on the basis of mutants killed Compared with two test criteria –Random test generation (special-purpose tool) –Edge coverage criterion (by hand) Eight Java classes –61 methods, 534 LOC, 1070 faults ( seeded by mutation ) Telechips, October 2009© Jeff Offutt33 — Shuang Wang and Jeff Offutt, Comparison of Unit-Level Automated Test Generation Tools, Mutation 2009

Unit Level ATDG Results Telechips, October 2009© Jeff Offutt34 These tools essentially generate random values !

Quality of Criteria-Based Tests In another study, we compared four test criteria –Edge-pair, All-uses, Prime path, Mutation –Generated tests for Java classes –Evaluated on the basis of finding hand-seeded faults Twenty-nine Java packages –51 classes, 174 methods, 2909 LOC Eighty-eight faults Telechips, October 2009© Jeff Offutt35 — Nan Li, Upsorn Praphamontripong and Jeff Offutt, An Experimental Comparison of Four Unit Test Criteria: Mutation, Edge-Pair, All-uses and Prime Path Coverage, Mutation 2009

Criteria-Based Test Results Telechips, October 2009© Jeff Offutt36 Researchers have invented very powerful techniques

Industry and Research Tool Gap We cannot compare these two studies directly However, we can compare the conclusions : –Industrial test data generators are ineffective –Edge coverage is much better than the tests the tools generated –Edge coverage is by far the weakest criterion Biggest challenge was hand generation of tests Software companies need to test better And luckily, we have lots of room for improvement! Telechips, October 2009© Jeff Offutt37

Four Roadblocks to Adoption 1.Lack of test education 2.Necessity to change process 3.Usability of tools 4.Weak and ineffective tools Telechips, October 2009© Jeff Offutt38 Bill Gates says half of MS engineers are testers, programmers spend half their time testing Number of UG CS programs in US that require testing ? 0 Number of MS CS programs in US that require testing ? Number of UG testing classes in the US ? 0 ~20 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 understand an internal combustion engine 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

OUTLINE Telechips, October 2009© Jeff Offutt39 1.Consequences of Poor Testing 2.Why is Testing Done so Poorly 3.Model-Driven Test Design 4.How to Improve Testing 5.Software Testing is Changing 1.Consequences of Poor Testing 2.Why is Testing Done so Poorly 3.Model-Driven Test Design 4.How to Improve Testing 5.Software Testing is Changing

Needs From Researchers 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 Telechips, October 2009© Jeff Offutt40

Needs From Educators 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 Telechips, October 2009© Jeff Offutt41

Changes in Practice 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 Telechips, October 2009© Jeff Offutt42

Future of Software Testing 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 Telechips, October 2009© Jeff Offutt43

© Jeff Offutt44Contact Jeff Offutt Telechips, October 2009