Where Agile Meets Formal Methods

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

Formal techniques for getting software right: some old ideas and some new tools Applied Formal Methods Research Group David Lightfoot:
Configuration management
Configuration management
Design by Contract.
Presenter: Chris Treml
Copyright W. Howden1 Programming by Contract CSE 111 6/4/2014.
Building Bug-Free O-O Software: An Introduction to Design By Contract A presentation about Design By Contract and the Eiffel software development tool.
Carlos D. Rivera February 28, 2007 Design-by-Contract.
Addressing the Challenges of Current Software. Questions to Address Why? What? Where? How?
Design by Contract. Design by contract is the process of developing software based on the notion of contracts between objects, which are expressed as.
Building bug-free O-O software: An introduction to Design by Contract Eiffel Software Presented by Bert Bruce.
1 Design by Contract Building Reliable Software. 2 Software Correctness Correctness is a relative notion  A program is correct with respect to its specification.
Design by Contract ™. 2 Design by Contract A discipline of analysis, design, implementation, management.
Feb 2003 R McFadyen1 Contracts (Ch 13) Used to help understand requirements more completely based on assertions; assertions are applicable to any.
Jan 2005 Ron McFadyen1 Contracts Used to help understand requirements more completely (and so may not always be necessary) based on assertions;
Chapter 15 Design, Coding, and Testing. Copyright © 2005 Pearson Addison-Wesley. All rights reserved Design Document The next step in the Software.
Copyright W. Howden1 Lecture 13: Programming by Contract.
Software Testing and Quality Assurance
Static and Dynamic Contract Verifiers For Java Hongming Liu.
Chair of Software Engineering Einführung in die Programmierung Introduction to Programming Prof. Dr. Bertrand Meyer Lecture 4: The Interface of a Class.
Chair of Software Engineering Einführung in die Programmierung Introduction to Programming Prof. Dr. Bertrand Meyer Lecture 4: The Interface of a Class.
OOP #10: Correctness Fritz Henglein. Wrap-up: Types A type is a collection of objects with common behavior (operations and properties). (Abstract) types.
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 18 Program Correctness To treat programming.
September 2002 R McFadyen1 Domain Model Use Case Model text diagram SSD System operation contracts Design Model Figure 13.3.
1 Introduction to: Design by Contract Fall 2005 OOPD John Anthony.
Eiffel Language and Design by Contract Contract –An agreement between the client and the supplier Characteristics –Expects some benefits and is prepared.
Adding Contracts to Ada Ehud Lamm Adding Design By Contract to Ada.
Sept Ron McFadyen1 Extend Relationship.
1 © Wolfgang Pelz Design by Contract Design by Contract™ Based on material drawn from: Bertrand.
Computer Science 340 Software Design & Testing Design By Contract.
Ranga Rodrigo. Class is central to object oriented programming.
PRAGMATIC PARANOIA Steven Hadfield & Anthony Rice.
Topics Covered: Software requirement specification(SRS) Software requirement specification(SRS) Authors of SRS Authors of SRS Need of SRS Need of SRS.
Lecture 16 March 22, 2011 Formal Methods CS 315 Spring Adapted from slides provided by Jason Hallstrom and Murali Sitaraman (Clemson)
Software Engineering Prof. Dr. Bertrand Meyer March 2007 – June 2007 Chair of Software Engineering Static program checking and verification Slides: Based.
Course: Software Engineering © Alessandra RussoUnit 1 - Introduction, slide Number 1 Unit 1: Introduction Course: C525 Software Engineering Lecturer: Alessandra.
Configuration Management (CM)
Overview of Formal Methods. Topics Introduction and terminology FM and Software Engineering Applications of FM Propositional and Predicate Logic Program.
Dr. Tom WayCSC Testing and Test-Driven Development CSC 4700 Software Engineering Based on Sommerville slides.
Note Excerpts from Object-Oriented Software Engineering WCB/McGraw-Hill, 2008 Stephen R. Schach
ISBN Chapter 3 Describing Semantics -Attribute Grammars -Dynamic Semantics.
CSC 480 Software Engineering Design by Contract. Detail Design Road Map Begin with architectural models  Class model: domain classes  Overall state.
Formal Methods in SE Software Verification Using Formal Methods By: Qaisar Javaid, Assistant Professor Formal Methods1.
1 Devon M. Simmonds, Computer Science Department Design by Contract Devon M. Simmonds Computer Science Department University of North Carolina, Wilmington.
ANU COMP2110 Software Design in 2003 Lecture 10Slide 1 COMP2110 Software Design in 2004 Lecture 12 Documenting Detailed Design How to write down detailed.
L13: Design by Contract Definition Reliability Correctness Pre- and post-condition Asserts and Exceptions Weak & Strong Conditions Class invariants Conditions.
SWE 4743 Abstract Data Types Richard Gesick. SWE Abstract Data Types Object-oriented design is based on the theory of abstract data types Domain.
Defensive Programming CNS 3370 Copyright 2003, Fresh Sources, Inc.
PROGRAMMING PRE- AND POSTCONDITIONS, INVARIANTS AND METHOD CONTRACTS B MODULE 2: SOFTWARE SYSTEMS 13 NOVEMBER 2013.
DBC NOTES. Design By Contract l A contract carries mutual obligations and benefits. l The client should only call a routine when the routine’s pre-condition.
1 Exceptions When the Contract is Broken. 2 Definitions A routine call succeeds if it terminates its execution in a state satisfying its contract A routine.
Object Design More Design Patterns Object Constraint Language Object Design Specifying Interfaces Review Exam 2 CEN 4010 Class 18 – 11/03.
Design by Contract. The Goal Ensure the correctness of our software (correctness) Recover when it is not correct anyway (robustness) Correctness: Assertions.
CSC 520 – Advanced Object Oriented Programming, Fall, 2010 Thursday, September 30 Week 5, Generics and Inheritance Techniques, Meyer Ch. 10 & 16.
The B-Method of Formal Specification By: Marshall Leitem.
Laurea Triennale in Informatica – Corso di Ingegneria del Software I – A.A. 2006/2007 Andrea Polini XVII. Verification and Validation.
Principles of Programming & Software Engineering
Design by Contract Jim Fawcett CSE784 – Software Studio
Design by Contract Jim Fawcett CSE784 – Software Studio
Used to help understand requirements more completely
Principles of Programming and Software Engineering
Design by Contract in Python: Present and Future Aaron Bingham
Testing and Test-Driven Development CSC 4700 Software Engineering
Programming Languages 2nd edition Tucker and Noonan
Design by contract Object-Oriented Software Construction by Bertrand Meyer, Prentice Hall The presence of a precondition or postcondition in a routine.
Design by contract Object-Oriented Software Construction by Bertrand Meyer, Prentice Hall The presence of a precondition or postcondition in a routine.
Assertions References: internet notes; Bertrand Meyer, Object-Oriented Software Construction; 4/25/2019.
Programming Languages 2nd edition Tucker and Noonan
Formal Methods Lecture 16 March 22, 2011 CS 315 Spring 2011
Presentation transcript:

Where Agile Meets Formal Methods Design by Contract Where Agile Meets Formal Methods

What is Design by Contract? Motivation History Concept Integrate with Agile Example Reviews Current State

What is Design by Contract? Motivation History Concept Integrate with Agile Example Reviews Current State

Motivation Improve software quality and reliability Second NASA Formal Methods Symposium (April 13 – 15, 2010) Verification and Validation of Flight-Critical Systems An Overview of Formal Methods at Intel Decision Engine for Software Analysis at Microsoft.

Motivation What are Formal Methods? “mathematically rigorous techniques and tools for developing specification, design and verification of software and hardware systems” -- Wikipedia

Motivation Agile: Are we building the right product? making sure clients get what they want won’t waste resources unnecessarily Formal: Are we building the product right? making sure code does exactly as specified separate process to determine right product

Motivation Is there a common ground? Alloy (MIT) Object Constraint Language (IBM) Design by Contract (Effiel)

Motivation Why should the Agile community care? Tests often insufficient to safeguard changes Documentations are poorly-written or outdated Collective code ownership  misinterpretation Why should the FM community care? Overemphasized full formalization of design Few people understand formal notations

What is Design by Contract? Motivation History Concept Integrate with Agile Example Reviews Current State

Design by Contract – History Bertrand Meyer developed DbC in 1986 “The quality factors on which we have concentrated — reusability, extendibility, compatibility — must not be attained at the expense of reliability (correctness and robustness).” -- Bertrand Meyer, Object Oriented Software Construction Correctness  Assertions Robustness  Exception Handling

What is Design by Contract? Motivation History Concept Integrate with Agile Example Reviews Current State

Design by Contract – Concept Example: a contract between an airline and a customer Obligations Benefits Customer (client) (Must ensure precondition) Be at the Pearson airport at least 5 minutes before scheduled departure time. Bring only acceptable baggage. Pay ticket price. (May benefit from postcondition) Reach Chicago. Airline (supplier) (Must ensure postcondition) Bring customer to Chicago. (May assume precondition) No need to carry passenger who is late, has unacceptable baggage, or has not paid ticket price.

Design by Contract – Concept Precondition: an obligation for the client and a benefit for the supplier Postcondition: a benefit for the client and an obligation for the supplier

Design by Contract – Concept Example: a contract between an airline and a customer Before Purchase After Purchase Airline (supplier) (Must ensure invariant) Ensures plane has certain number of free seats (Must ensure invariant) Number of free seats decreases appropriately Class Invariant: global property of the instances of a class, which must be preserved by all routines

Design by Contract – Concept Example: a contract between an airline and a customer Airline (General) Airline (Business) Customer (client) Be at the Pearson airport at least 5 minutes before scheduled departure time. Bring only acceptable baggage. Pay ticket price. Be at the Pearson airport at least 30 minutes before scheduled departure time. Bring only acceptable baggage. Pay ticket price. Airline (supplier) Bring customer to Chicago. Bring customer to O’Hare International Airport in Chicago.

Design by Contract – Concept Subcontract: Precondition can be weaken Postcondition can be strengthen

Design by Contract – Concept Example: a contract between an airline and a customer While Loading Baggage Handling Airline (supplier) Detected a snake in Customer A’s baggage Ask Customer A to leave the plane along with his baggage Exception: a run-time event that may cause a routine call to fail

What is Design by Contract? Motivation History Concept Integrate with Agile Example Reviews Current State

Design by Contract – Integrate "We will derive tremendous benefits from writing the assertions at the same time as we write the software, or indeed before we write the software." -- Bertran Meyer, Object Oriented Software Construction Differ from TDD, DbC checks for all cases ESC/Java2 checks spec consistency at runtime JMLUnit auto-generates test cases JMLDoc embeds JML in JavaDoc

What is Design by Contract? Motivation History Concept Integrate with Agile Example Reviews Current State

What is Design by Contract? Motivation History Concept Integrate with Agile Example Reviews Current State

Design by Contract – Reviews “I've tried to use [DbC] in a number of enterprise application settings, and I've found that in many situations it's as hard to write the pre and post conditions as it is to write the solution.” -- Martin Fowler “Design by Contract practice lessened the number of person-hours required to perform software testing.” -- An Experience With Design by Contract

What is Design by Contract? Motivation History Concept Integrate with Agile Example Reviews Current State

Design by Contract – Current State Effiel – built into the language Java – JCR305 submitted for JML Microsoft – Spec# and Boggie

Q & A