1 / 11

Introduction to Formal Specification

Introduction to Formal Specification. Murali Sitaraman Clemson University. Requirements vs. Specifications. Requirements definition Intended for customers in addition to software developers Informal descriptions are necessary Specification For use by members of a software development team

heyman
Download Presentation

Introduction to Formal Specification

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to Formal Specification Murali Sitaraman Clemson University

  2. Requirements vs. Specifications • Requirements definition • Intended for customers in addition to software developers • Informal descriptions are necessary • Specification • For use by members of a software development team • Formal (mathematical) descriptions are necessary

  3. Interface Specification Serves as a contract between component users (clients) and developers (implementers) Typically describes the demands on users and responsibilities for implementers Should present the essentials in “user-oriented” terms (abstraction) and hide the inessentials (information hiding)

  4. Informal Specification Examples • Examples • C++ STL Template specifications • Java util component specifications • Questions for discussion • Do they support information hiding? • Do they support abstraction? • Can they generalize? • Is it possible to make them unambiguous?

  5. Informal Specifications • Straightforward descriptions • Push pushes an object on a stack • How much do they help? • Use of metaphors • A Queue is like a line at a fast food restaurant • Do they generalize? • Use of implementation details • Push behaves like AddElement method on Vector • Is this appropriate for a user-oriented cover story?

  6. Informal Specifications • See Bertrand Meyer’s article on Formal Specification in IEEE Computer • Problems with even very carefully designed informal specs • Contradiction • Noise • …

  7. Formal Interface Specification Communicates precisely the demands and responsibilities to component users and developers Allows for independent development of client and implementation components in parallel in a team environment Minimizes integration costs

  8. Reasoning Benefits Formal specifications make it possible to reason about correctness of software formally Such reasoning may be manual or mechanical (i.e., with automated support)

  9. Characteristics of Good Specifications Simple Clear Precise Concise Implementation-independent Consistent Sufficient completeness Others …

  10. Languages for Formal Specification • ANNA (and SPARK) for Ada • JML for Java • Larch/C++ for C++ • Spec# for C# • … • Eiffel • RESOLVE • … • VDM • Z

  11. Specification Language Summary • Some specification languages are designed for particular programming languages • Some are general-purpose • Some specification languages are integrated with programming constructs • A few additionally integrate the ability to perform formal mathematical reasoning

More Related