1 / 8

Formal Specification

Formal Specification. Overview. Formal Specification. Describe (specify) software requirements using mathematical notation – mostly set and logic operations Because of the precise meaning of the Maths symbols, o ne is forced to think in a more thorough manner

aren
Download Presentation

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. Formal Specification Overview

  2. Formal Specification • Describe (specify) software requirements using mathematical notation – mostly set and logic operations • Because of the precise meaning of the Maths symbols, one is forced to think in a more thorough manner • Demands clear understanding of the requirements, so helps identify ambiguities and inconsistencies at an early stage in the software lifecycle thus potentially saving many man-hours further on

  3. Formal Specification Languages • Z, VDM and B used for sate based systems where the emphasis is on describing the stae and operations which change the state • CSP, CCS and Petri-nets used for specifying interacting concurrent processes which share resources and communicate • For example in CSP a vending machine and customer VM = coin -> clink -> choc -> thunk-> VM Customer = coin-> scratches -> choc -> Customer

  4. History • Z comes from Oxford Computing Lab, • Successfully in conjunction with IBM in designing a transaction management system • VDM (similar to Z) originally grew out of efforts at IBM Vienna Lab to describe the semantics (meaning) of programming languages so that those who build compilers agree on what a various code statement mean • CSP was invented by Tony Hoare of Oxford Computing Lab who also invented (discovered?) Quick Sort

  5. Advantages • Allows one to reason whether the resulting software would have certain properties or not. E.g. can be used to show that if the software obeys the specification, then certain properties will hold, e.g. safety criteria or maximum response times • For example • in a multithreaded application one may wish to ensure that deadlock or livelock will not occur • In a railway control system that certain events will not occur within the same time interval which could lead to a crash

  6. Advantages • This in turn allows for a deeper understanding of the software to be developed thus ensuring that it will be of higher quality, less buggy and will do what the customer requires • Preconditions, postconditions and invariants can be embedded in code to help with code quality and debugging during development (as in Spec#).Removed later. • Can also be used for functional and unit black box testing.

  7. Advantages • With the skilled use of software tools, it can be used to generate the required program code – less common • Or if the code is developed manually, theorem provers can be used to show that the code satisfies the spec (supported by Boogie in Spec#) • Both situations obviate the need for a lot of functional and unit testing.

  8. Disadvantages • Requires a specific high level skill set which is not very common and takes time and effort to acquire • Necessitates an initial large investment by an organisation • Not useful for certain types of software such as GUI and website design • Spec may only be understandable to the specialist (in contrast with a Use-case)

More Related