Monterey Workshop, Chicago, September 2003 in cooperation with Hubert Baumeister and Alexander Knapp Techniques for Improving Test-Driven Design Martin.

Slides:



Advertisements
Similar presentations
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 18 Program Correctness To treat programming.
Advertisements

Writing specifications for object-oriented programs K. Rustan M. Leino Microsoft Research, Redmond, WA, USA 21 Jan 2005 Invited talk, AIOOL 2005 Paris,
Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
Challenges in increasing tool support for programming K. Rustan M. Leino Microsoft Research, Redmond, WA, USA 23 Sep 2004 ICTAC Guiyang, Guizhou, PRC joint.
Formal Methods and Testing Goal: software reliability Use software engineering methodologies to develop the code. Use formal methods during code development.
(c) 2007 Mauro Pezzè & Michal Young Ch 17, slide 1 Test Execution.
ES Seminar1 Communicating Transaction Processes P.S. Thiagarajan National University of Singapore Joint Work with: Abhik Roychoudhury; ……
System Integration Verification and Validation
Introducing Formal Methods, Module 1, Version 1.1, Oct., Formal Specification and Analytical Verification L 5.
Automatic Verification Book: Chapter 6. What is verification? Traditionally, verification means proof of correctness automatic: model checking deductive:
1 1 Regression Verification for Multi-Threaded Programs Sagar Chaki, SEI-Pittsburgh Arie Gurfinkel, SEI-Pittsburgh Ofer Strichman, Technion-Haifa Originally.
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 11.
LIFE CYCLE MODELS FORMAL TRANSFORMATION
M INERVA (Metamodel-based Intuitive Editors with Reports and Visualizations of Analysis) Laura A. Campbell Advisor: Dr. Betty H.C. Cheng Software Engineering.
Data Abstraction II SWE 619 Software Construction Last Modified, Spring 2009 Paul Ammann.
Hydra (A General Framework for Formalizing UML with Formal Languages for Embedded Systems*) *from the Ph.D. thesis of William E. McUmber Software Engineering.
Requirement Analysis and Specification Mr. Manoj Kumar Kar.
Software Failure: Reasons Incorrect, missing, impossible requirements * Requirement validation. Incorrect specification * Specification verification. Faulty.
Software Testing and Quality Assurance
Software Testing and Quality Assurance
VIDE Integrated Environment for Development and Verification of Programs.
1 Evaluation of OCL for Large-Scale Modelling A Different View of the Mondex Smart Card Application Emine G. Aydal, Richard F. Paige, Jim Woodcock University.
Model Checking. Used in studying behaviors of reactive systems Typically involves three steps: Create a finite state model (FSM) of the system design.
OOP #10: Correctness Fritz Henglein. Wrap-up: Types A type is a collection of objects with common behavior (operations and properties). (Abstract) types.
Synthesis of Interface Specifications for Java Classes Rajeev Alur University of Pennsylvania Joint work with P. Cerny, G. Gupta, P. Madhusudan, W. Nam,
A practical approach to formal methods Lecturer: Ralph Back Place: A5059 Time:e very second Monday, Dates: 28.1, 11.2, 25.2, 10.3, 31.3, 14.4,
School of Computer ScienceG53FSP Formal Specification1 Dr. Rong Qu Introduction to Formal Specification
End-to-End Design of Embedded Real-Time Systems Kang G. Shin Real-Time Computing Laboratory EECS Department The University of Michigan Ann Arbor, MI
1 Scenario-based Analysis of UML Design Class Models Lijun Yu October 4th, 2010 Oslo, Norway.
 What is Software Testing  Terminologies used in Software testing  Types of Testing  What is Manual Testing  Types of Manual Testing  Process that.
K. Rustan M. Leino RiSE, Microsoft Research, Redmond joint work with Peter Müller and Jan Smans Lecture 0 1 September 2009 FOSAD 2009, Bertinoro, Italy.
By D. Beyer et. al. Simon Fraser University (Spring 09) Presentation By: Pashootan Vaezipoor.
Formal Methods 1. Software Engineering and Formal Methods  Every software engineering methodology is based on a recommended development process  proceeding.
Cheng/Dillon-Software Engineering: Formal Methods Model Checking.
The Software Development Life Cycle: An Overview
Assurance techniques for code generators Ewen Denney USRA/RIACS, NASA Ames Bernd Fischer ECS, U Southampton.
Balancing Practices: Inspections, Testing, and Others JAXA scenario (formal method) Masa Katahira Japanese Space Agency.
© 2000 Ian Alexander - Introduction to Scenarios Introduction to Scenarios A range of techniques for engineering better systems Ian Alexander
Software Engineering Prof. Dr. Bertrand Meyer March 2007 – June 2007 Chair of Software Engineering Static program checking and verification Slides: Based.
Ed Brinksma Dept. of CS, University of Twente, NL joint work with Angelika Mader Monterey Workshop 2003 Chicago Verification Modelling of Embedded systems.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 1 Requirements Engineering Processes l Processes used to discover, analyse and.
Chapter 25 Formal Methods Formal methods Specify program using math Develop program using math Prove program matches specification using.
© 2012 xtUML.org Bill Chown – Mentor Graphics Model Driven Engineering.
Functional Verification Figure 1.1 p 6 Detection of errors in the design Before fab for design errors, after fab for physical errors.
Software Construction Lecture 18 Software Testing.
1 Qualitative Reasoning of Distributed Object Design Nima Kaveh & Wolfgang Emmerich Software Systems Engineering Dept. Computer Science University College.
Safety-Critical Systems 5 Testing and V&V T
Slide: 1 Copyright © 2009 AdaCore GeneAuto for Ada and SPARK A verifying model compiler GeneAuto2 meeting (Toulouse) September 2009 Matteo Bordin
Validating Requirements Determining Completeness and Correctness of Requirements Using the System Reference Model IV&V Workshop 16 September 2009.
Requirements Management with Use Cases Module 10: Requirements Across the Product Lifecycle Requirements Management with Use Cases Module 10: Requirements.
An Axiomatic Basis for Computer Programming Robert Stewart.
1 Presentation Title Test-driven development (TDD) Overview David Wu.
Facilitating testing and monitoring of number entry systems in medical devices Abigail Cauchi, Christian Colombo, Mark Micallef & Gordon Pace.
HNDIT23082 Lecture 09:Software Testing. Validations and Verification Validation and verification ( V & V ) is the name given to the checking and analysis.
Software Systems Verification and Validation Laboratory Assignment 4 Model checking Assignment date: Lab 4 Delivery date: Lab 4, 5.
Winter 2007SEG2101 Chapter 121 Chapter 12 Verification and Validation.
1 Software Testing and Quality Assurance Lecture 17 - Test Analysis & Design Models (Chapter 4, A Practical Guide to Testing Object-Oriented Software)
Lectures 2 & 3: Software Process Models Neelam Gupta.
Ivan Lanese Computer Science Department University of Bologna/INRIA Italy Adaptive Choreographies Joint work with Mila Dalla Preda, Jacopo Mauro and Maurizio.
Copyright 1999 G.v. Bochmann ELG 7186C ch.1 1 Course Notes ELG 7186C Formal Methods for the Development of Real-Time System Applications Gregor v. Bochmann.
IWFST 2005 Formal Specification and Verification of a Communication Protocol Ho Jung Bang Sung Deok Cha.
Model Checking Early Requirements Specifications in Tropos Presented by Chin-Yi Tsai.
Implementation Topics Describe –Characteristics of good implementations –Best practices to achieve them Understand role of comments Learn debugging techniques.
TQS - Teste e Qualidade de Software (Software Testing and Quality) Test Case Design – Model Based Testing João Pascoal.
Deadlock Freedom by Construction
It is great that we automate our tests, but why are they so bad?
UNIT II.
Lecture 09:Software Testing
SWE 619 Software Construction Last Modified, Fall 2015 Paul Ammann
Chapter 9: Implementation
Presentation transcript:

Monterey Workshop, Chicago, September 2003 in cooperation with Hubert Baumeister and Alexander Knapp Techniques for Improving Test-Driven Design Martin Wirsing LMU München

M. Wirsing: Techniques for Improving Test-Driven Design Test-Driven Design Test scenarios act as (partial) specifications and drive the design of programs Extreme Programming - test for program design Use cases serve as basis for test scenarios OOSE - informal use cases (Jacobson, early 90’ties) FOOSE - formalized use cases (W, Knapp, 97)

M. Wirsing: Techniques for Improving Test-Driven Design Property-Driven Design Improve on Test-Driven Design by Joint development of test / formal spec / model Executable models Immediate feedback Automatic tests Properties Basis for verification and improvement of testing Verification through model checking (and theorem proving) Refinement/Abstraction Adding/Deleting functionality and details Refactoring

M. Wirsing: Techniques for Improving Test-Driven Design Contents Property-driven Development Development approach Case study: A Multi User Dungeon Game

M. Wirsing: Techniques for Improving Test-Driven Design Property-Driven Design: Construction & Validation Techniques Model Use Case Scenario Property extract & generalize Abstracted Model verify (model check) detail Instrumented Model test assertions implements construct Iterated development guided by user stories/use cases

M. Wirsing: Techniques for Improving Test-Driven Design Case Study: Multi User Dungeon Game Game Rules The player moves through the rooms until he finds the Special Room. He can see the other players, trade objects, talk and fight with other players in the same room Start RoomSpecial Room Distributed game played via mobile phones Provided by phone company

M. Wirsing: Techniques for Improving Test-Driven Design Develop Use Cases for the MUD Game MUD Player look other players move to room Use Case Development trade personal object...

M. Wirsing: Techniques for Improving Test-Driven Design Develop Scenarios for trade Use Case offer(mask) Scenario Development offer(book) closeTrade()cancelTrade() offer(mask) offer(book) p1:Playe r p2:Playe r has(mask)has(book) unsuccessful trade successful trade p1:Playe r p2:Playe r has(mask)has(book) successTrade has(mask) assert has(mask) !successTrade has(book) assert

M. Wirsing: Techniques for Improving Test-Driven Design Construct Class Diagram and Derive Invariants and Pre-/Post Conditions 0..*0..1 > PersonalObject move(Room) offer(PersObj o, Player to) closeTrade() cancelTrade()... post: to.lastOffer.object = o and to.lastOffer.player = self inv: has  forAll(pObj | pObj.player = self ) has inv: player != null implies player.has  includes( self ) Property Extraction > Player Offer lastOffer object Last offer obtained from another player

M. Wirsing: Techniques for Improving Test-Driven Design Define State Diagrams for players and environment Construct State Diagrams and Define Properties waitingreceivedOffer offer(o,to)/ p._recOffer(o,this) closeTrade()/ p._closeTrade() successTrade=true has.add(lastOffer.object) p._del(lastOffer.object) offer(o,from)/ p._recOffer(o,from) _recOffer(o,from)/ u.offer(o,from) _cancelTrade()/ u.cancelTrade() successTrade=false _closeTrade()/ u.closeTrade() has.add(lastOffer.object) p._del(lastOffer.object) cancelTrade()/ p._cancelTrade() successTrade=false _cancelTrade()/ u.cancelTrade() successTrade=false Modelling Define safety and lifeness properties: No Deadlock Players agree on the outcome of a trade : p1.waiting and p2.waiting implies p1.successTrade = p2.successTrade... Property Extraction

M. Wirsing: Techniques for Improving Test-Driven Design has(book) successTrade has(mask) Validation I: All Tests are Successful… offer(mask) offer(book) closeTrade() p1:Playe r p2:Playe r has(mask)has(book) assert Test Validation & Refactoring

M. Wirsing: Techniques for Improving Test-Driven Design Model checking gives: No Deadlock, but we get... Construct homomorphic abstraction of state diagrams Validation II: Model Checking waitingreceivedOffer offer(o,to)/ p._recOffer(o,this) closeTrade()/ p._closeTrade() successTrade=true has.add(lastOffer.object) p._del(lastOffer.object) offer(o,from)/ p._recOffer(o,from) _recOffer(o,from)/ u.offer(o,from) _cancelTrade()/ u.cancelTrade() successTrade=false _closeTrade()/ u.closeTrade() has.add(lastOffer.object) p._del(lastOffer.object) cancelTrade()/ p._cancelTrade() successTrade=false _cancelTrade()/ u.cancelTrade() successTrade=false Validation & Refactoring a counterexample: Players may not agree on the outcome of a trade

M. Wirsing: Techniques for Improving Test-Driven Design Error found by testing Assertion checking shows source of error in closeTrade closeTrade() offer(mask) offer(book) p1:Playe r p2:Playe r has(mask)has(book) assert successTrade has(book)has(mask) Revising the Test and Testing Without and With Assertions successTrade Validation & Refactoring Additional test Test Add additional check for successTrade Run test again Run test with assertions

M. Wirsing: Techniques for Improving Test-Driven Design Revise State Diagrams waitingreceivedOffer offer(o,to)/ p._recOffer(o,this) closeTrade()/ p._closeTrade() successTrade=true has.add(lastOffer.object) p._del(lastOffer.object) offer(o,from)/ p._recOffer(o,from) _recOffer(o,from)/ u.offer(o,from) _cancelTrade()/ u.cancelTrade() successTrade=false _closeTrade()/ u.closeTrade() has.add(lastOffer.object) p._del(lastOffer.object) successTrade=true cancelTrade()/ p._cancelTrade() successTrade=false _cancelTrade()/ u.cancelTrade() successTrade=false Error correction Validation & Refactoring Correct the state diagrams Validation yields: All tests successful! Model checking successful!

M. Wirsing: Techniques for Improving Test-Driven Design Validation Results of the MUD Game MUD Player look other players move to room trade personal object... Sequence and Activity Diagrams for Mobility Sequence and Activity Diagrams Sequence and State Diagrams Validation completed: All tests and checks successful! Validation & Refactoring

M. Wirsing: Techniques for Improving Test-Driven Design Tool Support Model Use Case Scenario Property extract & generalize detail Abstracted Model verify (model check) test Instrumented Model test assertions Hugo model checking and simulation (using SPIN and UPPAAL) JML assertions Testing with FitNesse and JUnit Test Scenario Editor (under develpt) Program

M. Wirsing: Techniques for Improving Test-Driven Design Summary and Challenges Property-Driven Design Joint development of formal properties and model Tests Formal specification Joint validation and verification Executable models (based on state/activity diagrams) Immediate feedback Allows to experiment with the system Tests/Specs + Refactoring = "Soft"ware Challenges Integrating interactive theorem proving Specification covering criteria Abstraction techniques