Putting Testing First CS 4501 / 6501 Software Testing

Slides:



Advertisements
Similar presentations
Why Use Test Driven Development (TDD)?.  Why the need to change to TDD.  Talk about what TDD is.  Talk about the expectations of TDD.
Advertisements

PROC-1 3. Software Process. PROC-2 What’s a process? Set of activities in creating software It involves creativity –hard to automate –Requires human judgment.
Agile Requirements Methods CSSE 371 Software Requirements and Specification Mark Ardis, Rose-Hulman Institute October 26, 2004.
Software Testing. “Software and Cathedrals are much the same: First we build them, then we pray!!!” -Sam Redwine, Jr.
Chapter 16 Maintaining Information Systems
Test-Driven Development “Test first, develop later!” –OCUnit.
Chapter 9 – Software Evolution and Maintenance
Chapter 3 – Agile Software Development 1Chapter 3 Agile software development.
System Analysis and Design
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.
1 Software Engineering Ian Sommerville th edition Instructor: Mrs. Eman ElAjrami University Of Palestine.
Managing Change 1. Why Do Requirements Change?  External Factors – those change agents over which the project team has little or no control.  Internal.
Chapter 2: Testing in Software Life Cycle MNN1063 System Testing and Evaluation.
(1) Test Driven Development Philip Johnson Collaborative Software Development Laboratory Information and Computer Sciences University of Hawaii Honolulu.
Introduction to Software Testing (2nd edition) Chapter 4 Putting Testing First Paul Ammann & Jeff Offutt August.
Software Quality Assurance and Testing Fazal Rehman Shamil.
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.
Chapter 3 Agile software development 1 Chapter 3 – Agile Software Development.
CompSci 280 S Introduction to Software Development
CS223: Software Engineering
Software Development.
Paul Ammann & Jeff Offutt
SOFTWARE TESTING Date: 29-Dec-2016 By: Ram Karthick.
Software Project Configuration Management
Software Engineering (CSI 321)
Developer Testing Tricks
CS 389 – Software Engineering
Software Testing Introduction CS 4501 / 6501 Software Testing
421 Review Questions Does software engineering add documentation that slows down the project? Is there one software process that is better than the others.
Integrate Agile Testing into the Process
Chapter 18 Maintaining Information Systems
Mobile Application Test Case Automation
Chapter 8 – Software Testing
Paul Ammann & Jeff Offutt
Software Engineering and Best Practices
Extreme Programming.
Chapter 2 SW Process Models
Chapter 2: Software Process Models
Applied Software Implementation & Testing
Chapter 2 – Software Processes
Model-Based Design: Software Engineers Wanted
Paul Ammann The Agile Heresy: What Drives Traditional Software Engineering, and Why Agile Turns it Upside Down Paul Ammann.
Paul Ammann & Jeff Offutt
Chapter 2 Software Processes
Test Planning Mike O’Dell (some edits by Vassilis Athitsos)
Lecture 09:Software Testing
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
Process Models Coming up: Prescriptive Models.
Software Testing and Maintenance Maintenance and Evolution Overview
CS240: Advanced Programming Concepts
Chapter 3 – Agile Software Development
Maintaining Information Systems (SAD- 18)
Software Engineering: A Practitioner’s Approach, 6/e Chapter 3 Prescriptive Process Models copyright © 1996, 2001, 2005 R.S. Pressman & Associates, Inc.
Software Verification, Validation, and Acceptance Testing
Capability Maturity Model
CS310 Software Engineering Dr.Doaa Sami Khafaga
Chapter 2: Software Process Models
Chapter 8 Software Evolution.
Test Driven Lasse Koskela Chapter 9: Acceptance TDD Explained
Agile Development – a new way of software development?
Extreme Programming.
Chapter 16 Maintaining Information Systems
Capability Maturity Model
Chapter 7 Software Testing.
Software Engineering: A Practitioner’s Approach, 6/e Chapter 3 Prescriptive Process Models copyright © 1996, 2001, 2005 R.S. Pressman & Associates, Inc.
Extreme Programming (and Pair Programming)
Presentation transcript:

Putting Testing First CS 4501 / 6501 Software Testing

Software Crisis Programmers just programmed Result was ad hoc structure Code eventually became hard to maintain Managing complexity was challenging The tendency towards irreducible number of errors Most software development faced Overdue schedule Exceeding initial budget Inadequate software quality High software maintenance cost

Planned Design Heavy reliance on upfront analysis On time and on budget Requirements Analysis Architectural Design Subsystem Detailed Implementation Acceptance Test System Integration Module Unit Validation Test Design Information Verification [AO, p.23]

Traditional Cost-of-Change Curve Traditional software development methods Focus: extensive modeling and up front analysis Goal: reveal problems and changes as early as possible Delta Time Cost More work must be revised Root problem is harder to find Original Revision [AO, p.55]

Increased Emphasis on Testing If high-quality testing is not centrally and deeply embedded in your development process, your project is at high risk for failure Fail in the technical sense Lose control of what the code actually does Fail in the business sense Your competitors roll out better functionality faster

Traditional Assumptions Modeling and analysis can identify potential problems early in development Saving implied by the cost-of-change curve justify the cost of modeling and analysis over the life of the project These assumptions are true if the requirements are always complete and current In reality, customers keep changing their mind Changes reflect the requirements

Supporting Evolutionary Design Traditional design advice says to anticipate changes Designers often anticipate changes that don’t happen Both anticipated and unanticipated changes affect design Evolving Design Unanticipated Change Anticipated change that doesn’t happen [AO, Agile Test]

Agile Methods 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 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 [AO, Agile Test]

Traditional vs. Agile What does it mean if your design needs to change? Traditional: Failure in prior design process? Agile: Normal first class problem in software engineering? Agile methods expect software to start small and evolve over time Embraces software evolution instead of fighting it

Defect Discovery: Traditional vs. Agile

Managing the Cost Curve Test harness as guardian (Near) Instant feedback on changes (or mistakes) An hour? Ten minutes? Less? Something is executable from the very beginning Role of continuous integration Effective communication mechanisms De-emphasize non executable artifacts If it doesn’t execute, it’s not checkable Avoid anticipating future needs YAGNI: You Ain’t Gonna Need It

Test Harness as Guardian What is correctness? Traditional correctness: universal Agile correctness: existential Limit view of correctness Traditional correctness: define all correct behavior completely at the beginning Agile correctness: define correctness of some behavior with specific tests If the software behaves correctly on the tests, it is correct Even as the software (including the test cases) evolve, the correctness of the system at any single point in time is subject to immediate verification by running the test set.

Testing as Central Activity [image from http://www.twilightsoftwares.com]

Testing as Central Activity: TDD [More TDD and exercise .. Later]

Test Harness Verify Correctness Tests must be automated Every test must include a test oracle that can evaluate whether that test executed correctly Tests (executable artifacts) replace the requirements (non-executable artifacts) Tests must be high quality and must run quickly We run tests every time we make a change to the software Test harness runs all automated tests efficiently and reports results to the developers

Continuous Integration Agile methods work best when the current version of the software can be run against all tests at all time

Continuous Integration A Continuous integration server rebuilds the system, returns, and re-verifies tests whenever any update is checked into the repository Other developers are aware of changes early The rebuild and re-verify must happen as soon as possible (tests need to execute quickly) A continuous integration server doesn’t just run tests, it decides if a modified system is still correct Mistakes are caught earlier

System Tests in Agile Methods Traditional testers often design system tests from requirements What if there are no traditional requirement documents? Requirements ? System tests

User Stories A few sentences that captures what a user will do with the software In the language of the end user Usually small in scale with few details Not archived Agent sees a list of today’s interview applicants Withdraw money from checking account Support technician sees customer’s history on demand

Acceptance Tests in Agile Methods User Story Acceptance Test (Failing) TDD Test 1 Change software & Refactor Tests archived Acceptance Test (Passing) TDD Test 2 Continue adding TDD tests until acceptance test passes Change software & Refactor Refactoring avoids maintenance debt [AO, p.60]

Test Doubles An object that can stand in for a real object in a test Stand in for dependencies Separation of concerns Replace object with double if real object is Too slow Not available Depends on something that is not available Too difficult to instantiate or configure for a test How to test exceptions such as Dead code? An unplugged network cable? How to interact with something that is nondeterministic?

Test Doubles (2) Stub: simplest possible implementation Fake: more sophisticated implementation (still hand coded) Mock: implementation usually generated by tool Testing for states Verify how an object listens .. consistency Testing for interactions Verify how an object talks to its collaborators Did the expected methods calls happen in the right order?

[Lasse Koskela, Test Driven, p.114] Example Test Double [Lasse Koskela, Test Driven, p.114]

[Lasse Koskela, Test Driven, p.117] Example Test Double (2) [Lasse Koskela, Test Driven, p.117]

Summary More companies are putting testing first This can decrease cost and increase quality The definition of “Correctness” becomes restricted but practical We embrace evolutionary design We use test harness as guardian To facilitate the testing process, sometimes we need test doubles. More TDD and test doubles … later