Introduction to Software Testing (2nd edition) Chapter 4 Putting Testing First Paul Ammann & Jeff Offutt August.

Slides:



Advertisements
Similar presentations
Introduction to Software Testing Chapter 1 Model-Driven Test Design Paul Ammann & Jeff Offutt
Advertisements

Test process essentials Riitta Viitamäki,
Acceptance Testing.
Introduction to Software Testing Chapter 1 Paul Ammann & Jeff Offutt SUMMARY OF PARTS 1 AND 2 FROM LAST WEEK.
Why Use Test Driven Development (TDD)?.  Why the need to change to TDD.  Talk about what TDD is.  Talk about the expectations of TDD.
Introduction to Software Testing Chapter 2.6 Graph Coverage for Use Cases Paul Ammann & Jeff Offutt
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 17 Slide 1 Rapid software development.
Introduction to Software Testing Chapter 9.2 Challenges in Testing Software – Software Testability Paul Ammann & Jeff Offutt
Introduction to Software Testing Chapter 9.3 Challenges in Testing Software Test Criteria and the Future of Testing Paul Ammann & Jeff Offutt
Introduction to Software Testing Chapter 2.6 Graph Coverage for Use Cases Paul Ammann & Jeff Offutt
CS351 © 2003 Ray S. Babcock Software Testing What is it?
Transitioning to XP or The Fanciful Opinions of Don Wells.
Xtreme Programming. Software Life Cycle The activities that take place between the time software program is first conceived and the time it is finally.
Paul Ammann & Jeff Offutt
Chapter 9 – Software Evolution and Maintenance
SEG Software Maintenance1 Software Maintenance “The modification of a software product after delivery to correct faults, to improve performance or.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 17 Slide 1 Extreme Programming.
Introduction to Software Testing Chapter 5.2 Program-based Grammars Paul Ammann & Jeff Offutt
Introduction to Software Testing Chapter 5.5 Input Space Grammars Paul Ammann & Jeff Offutt
Michael Burnside Blog: Software Quality Assurance, Quality Engineering, and Web and Mobile Test.
Chapter 3 – Agile Software Development 1Chapter 3 Agile software development.
CS 360 Lecture 3.  The software process is a structured set of activities required to develop a software system.  Fundamental Assumption:  Good software.
Extreme/Agile Programming Prabhaker Mateti. ACK These slides are collected from many authors along with a few of mine. Many thanks to all these authors.
LECTURE 38: REFACTORING CSC 395 – Software Engineering.
Software Engineering Experimentation Rules for Reviewing Papers Jeff Offutt See my editorials 17(3) and 17(4) in STVR
Testing -- Part II. Testing The role of testing is to: w Locate errors that can then be fixed to produce a more reliable product w Design tests that systematically.
Dr. Tom WayCSC Testing and Test-Driven Development CSC 4700 Software Engineering Based on Sommerville slides.
Rapid software development 1. Topics covered Agile methods Extreme programming Rapid application development Software prototyping 2.
Automated Acceptance Testing and Continuous Delivery Larry Apke Agile Expert
1 Introduction to Software Testing. Reading Assignment P. Ammann and J. Offutt “Introduction to Software Testing” ◦ Chapter 1 2.
Software Testing and Quality Assurance Practical Considerations (4) 1.
Chapter 2: Testing in Software Life Cycle MNN1063 System Testing and Evaluation.
Introduction to Software Testing Chapter 9.2 Program-based Grammars Paul Ammann & Jeff Offutt
HNDIT23082 Lecture 09:Software Testing. Validations and Verification Validation and verification ( V & V ) is the name given to the checking and analysis.
Software Development Process CS 360 Lecture 3. Software Process The software process is a structured set of activities required to develop a software.
Testing and Evolution CSCI 201L Jeffrey Miller, Ph.D. HTTP :// WWW - SCF. USC. EDU /~ CSCI 201 USC CSCI 201L.
Introduction to Software Testing Model-Driven Test Design and Coverage testing Paul Ammann & Jeff Offutt Update.
Week # 4 Quality Assurance Software Quality Engineering 1.
Software Testing and Quality Assurance Practical Considerations (1) 1.
Cs498dm Software Testing Darko Marinov January 24, 2012.
Testing under the Agile Method CSCI 521 Software Project Management based on the book Testing Extreme Programming by Lisa Crispin and Tip House.
Software Development. The Software Life Cycle Encompasses all activities from initial analysis until obsolescence Analysis of problem or request Analysis.
Introduction to Software Testing (2nd edition) Chapter 5 Criteria-Based Test Design Paul Ammann & Jeff Offutt
Software Development.
Paul Ammann & Jeff Offutt
Paul Ammann & Jeff Offutt
Paul Ammann & Jeff Offutt
Introduction to Software Testing Chapter 9.2 Program-based Grammars
Integrate Agile Testing into the Process
Chapter 18 Maintaining Information Systems
Putting Testing First CS 4501 / 6501 Software Testing
Paul Ammann & Jeff Offutt
Coverage-Based Test Design CS 4501 / 6501 Software Testing
Chapter 2 SW Process Models
Introduction to Software Testing Chapter 2 Model-Driven Test Design
Paul Ammann The Agile Heresy: What Drives Traditional Software Engineering, and Why Agile Turns it Upside Down Paul Ammann.
Paul Ammann & Jeff Offutt
Paul Ammann & Jeff Offutt
Introduction to Software Testing
Lecture 09:Software Testing
Paul Ammann & Jeff Offutt
Introduction to Software Testing Chapter 5.2 Program-based Grammars
Testing and Test-Driven Development CSC 4700 Software Engineering
Putting Testing First CS 4501 / 6501 Software Testing
Test Driven Lasse Koskela Chapter 9: Acceptance TDD Explained
Software Testing and Maintenance Maintenance and Evolution Overview
Managing the Test Process CS 4501 / 6501 Software Testing
Test Driven Lasse Koskela Chapter 9: Acceptance TDD Explained
Move from Scripted Manual Testing to Scenario-Based Testing
Paul Ammann & Jeff Offutt
Presentation transcript:

Introduction to Software Testing (2nd edition) Chapter 4 Putting Testing First Paul Ammann & Jeff Offutt August 2014

The I n creased E m phasis on Testing n Philosophy of traditional software development methods –Upfront analysis –Extensive modeling –Reveal problems as early as possible Introduction to Software Testing, Edition 2 (Ch 4) © Ammann & Offutt 2 Original Revision Delta Time Cost More work must be revised Root problem is harder to find

Traditional Assumptions n These are true if requirements are always complete and current n But those annoying customers keep changing their minds! –Humans are naturally good at approximating –But pretty bad at perfecting n These two assumptions have made software engineering frustrating and difficult for decades Introduction to Software Testing, Edition 2 (Ch 4) © Ammann & Offutt 3 1.Modeling and analysis can identify potential problems early in development 2.Savings implied by the cost-of-change curve justify the cost of modeling and analysis over the life of the project Thus, agile methods …

Why Be Agile ? n Agile methods start by recognizing that neither assumption is valid for many current software projects –Software engineers are not good at developing requirements –We do not anticipate many changes –Many of the changes we do anticipate are not needed n Requirements (and other “non-executable artifacts”) tend to go out of date very quickly –We seldom take time to update them –Many current software projects change continuously n Agile methods expect software to start small and evolve over time –Embraces software evolution instead of fighting it Introduction to Software Testing, Edition 2 (Ch 4) © Ammann & Offutt 4

Introduction to Software Testing, Edition 2 (Ch 4) 5 Supporting Evolutionary Design Traditional design advice says to anticipate design Designers often anticipate changes that don’t happen Both anticipated and unanticipated changes affect design Evolving Design Unanticipated Change Anticipated Change Anticipated change that doesn’t happen © Ammann & Offutt

The Test Harness as Guardian Introduction to Software Testing, Edition 2 (Ch 4) © Ammann & Offutt 6 What is Correctness ? Agile Correctness (Existential) X Y Traditional Correctness (Universal) V x,y, x ≥ y { (1, 1)  T (1, 0)  T (0, 1)  F (10, 5)  T (10, 12)  F }

A Limited View of Correctness n In traditional methods, we try to define all correct behavior completely, at the beginning –What is correctness? –Does “correctness” mean anything in large engineering products? – People are VERY BAD at completely defining correctness n In agile methods, we redefine correctness to be relative to a specific set of tests –If the software behaves correctly on the tests, it is “correct” –Instead of defining all behaviors, we demonstrate some behaviors –Mathematicians may be disappointed at the lack of completeness Introduction to Software Testing, Edition 2 (Ch 4) © Ammann & Offutt 7 But software engineers ain’t mathematicians!

Test Harnesses Verify Correctness n Tests must be automated –Test automation is a prerequisite to test driven development n Every test must include a test oracle that can evaluate whether that test executed correctly n The tests replace the requirements n Tests must be high quality and must run quickly n We run tests every time we make a change to the software Introduction to Software Testing, Edition 2 (Ch 4) © Ammann & Offutt 8 A test harness runs all automated tests efficiently and reports results to the developers

Continuous Integration n Agile methods work best when the current version of the software can be run against all tests at any time Introduction to Software Testing, Edition 2 (Ch 4) © Ammann & Offutt 9 A continuous integration server rebuilds the system, returns, and reverifies tests whenever any update is checked into the repository n Mistakes are caught earlier n Other developers are aware of changes early n The rebuild and reverify must happen as soon as possible –Thus, tests need to execute quickly A continuous integration server doesn’t just run tests, it decides if a modified system is still correct

Introduction to Software Testing, Edition 2 (Ch 4) 10 Continuous Integration Reduces Risk Non-integrated functionality is dangerous! © Ammann & Offutt

System Tests in Agile Methods Introduction to Software Testing, Edition 2 (Ch 4) © Ammann & Offutt 11 Traditional testers often design system tests from requirements System tests But … what if there are no traditional requirements documents ? Requirements ?

User Stories Introduction to Software Testing, Edition 2 (Ch 4) © Ammann & Offutt 12 A user story is a few sentences that captures what a user will do with the software Withdraw money from checking account Support technician sees customer’s history on demand Agent sees a list of today’s interview applicants –In the language of the end user –Usually small in scale with few details –Not archived

Acceptance Tests in Agile Methods Introduction to Software Testing, Edition 2 (Ch 4) © Ammann & Offutt 13 Acceptance Test (Failing) User Story TDD Test 1 Change software & Refactor TDD Test 2 Change software & Refactor Acceptance Test (Passing) Tests archived Continue adding TDD tests until acceptance test passes Refactoring avoids maintenance debt

Adding Tests to Existing Systems n Most of today’s software is legacy –No legacy tests –Legacy requirements hopelessly outdated –Designs, if they were ever written down, lost n Companies sometimes choose not to change software out of fear of failure Introduction to Software Testing, Edition 2 (Ch 4) © Ammann & Offutt 14 How to apply TDD to legacy software with no tests? n Create an entire new test set? — too expensive! n Give up? — a mixed project is unmanageable

Incremental TDD n When a change is made, add TDD tests for just that change –Refactor n As the project proceeds, the collection of TDD tests continues to grow n Eventually the software will have strong TDD tests Introduction to Software Testing, Edition 2 (Ch 4) © Ammann & Offutt 15

The Testing Shortfall n Do TDD tests (acceptance or otherwise) test the software well? –Do the tests achieve good coverage on the code? –Do the tests find most of the faults? –If the software passes, should management feel confident the software is reliable? Introduction to Software Testing, Edition 2 (Ch 4) © Ammann & Offutt 16 NO!

Why Not? n Most agile tests focus on “happy paths” –What should happen under normal use n They often miss things like –Confused-user paths –Creative-user paths –Malicious-user paths Introduction to Software Testing, Edition 2 (Ch 4) © Ammann & Offutt 17 The agile methods literature does not give much guidance

What Should Testers Do? Introduction to Software Testing, Edition 2 (Ch 4) © Ammann & Offutt 18 Ummm... Excuse me, Professor... What do I do?

Design Good Tests Introduction to Software Testing, Edition 2 (Ch 4) © Ammann & Offutt 19 Use a human-based approach Create additional user stories that describe non-happy paths Create additional user stories that describe non-happy paths How do you know when you’re finished? How do you know when you’re finished? Some people are very good at this, some are bad, and it’s hard to teach Some people are very good at this, some are bad, and it’s hard to teach Use modeling and criteria Model the input domain to design tests Model the input domain to design tests Model software behavior with graphs, logic, or grammars Model software behavior with graphs, logic, or grammars A built-in sense of completion A built-in sense of completion Much easier to teach—engineering Much easier to teach—engineering Requires discrete math knowledge Requires discrete math knowledge Part 2 of book …

Summary n More companies are putting testing first n This can dramatically decrease cost and increase quality n A different view of “correctness” –Restricted but practical n Embraces evolutionary design n TDD is definitely not test automation –Test automation is a prerequisite to TDD n Agile tests aren’t enough Introduction to Software Testing, Edition 2 (Ch 4) © Ammann & Offutt 20