SlideServe
Menu
Préférences
© SlideServe · v2026

Software Engineering Lecture 8

rafal avatar
10 diapositives · 286 Views · Sep 23, 2014

Software Engineering Lecture 8. Vladimir Safonov , Professor, head of laboratory St. Petersburg University Email: v_o_safonov@mail.ru WWW: http://user.rol.ru/~vsafonov. Program specification. Specification – the stage of software lifecycle , to follow by the requirements & goals stage

Software Engineering Lecture 8 - slide 1
01 / 10Software Engineering Lecture 8
1 / 17

Télécharger la présentation

Software Engineering Lecture 8
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. SoftwareEngineeringLecture8 Vladimir Safonov, Professor, head of laboratory St. Petersburg University Email: v_o_safonov@mail.ru WWW: http://user.rol.ru/~vsafonov

  2. Program specification • Specification– the stage of software lifecycle, to follow by the requirements & goals stage • Specification – a formalized, external, preciseand complete description of the task to be solved by the program or its part in question • Simply: specification is WHAT, rather than HOW • Typical element of specification is a mathematical formula, e.g., fact(n) = 1 * 2 * … * n • Implementation of an algorithm, data representation, etc. are not elements of specification • Complete specification: taking into account all the alternatives, e.g., n = 0 forfact(n): fact(0) = 1 (C) Vladimir O. Safonov, 2004

  3. Specification techniques • Natural language • HIPO diagrams(Hierarchical Input-Process-Output) • Decision tables • Program calculus (operator schemas) by R. Floyd – C.A.R. Hoare: P {S} Q A{S}B, B{T}C |- A{S;T} C • Denotational semantics (D. Scott, J.Donahue at al.): program is a transformer of predicates: P(x1, … xn) -> Q(x1, …, xn), wherexi – free (global) variables • Vienna Definition Method(VDM; IBM Research): program – system of mutually related finite-state automata • Algebraic (G.A. Goguen et al.): program – a collection of ADT, each of them specified as multi-sorted algebra • Petri nets – specifying asynchronous programs and computing systems (see: Kotov V. E. Petri nets.: Nauka, 1986) (C) Vladimir O. Safonov, 2004

  4. Specification languages • VDM – specification using the concept of finite automaton (Ollongren A. Defining programming languages by interpretive automata. – Prentice Hall, 1977) • OBJ, CLEAR, SDL, LARCH –algebraic specification languages (please see OBJ description in J.A. Goguen’s papers) • CIP/L (“Wide Spectrum Multi-Layered Language) – Technical University, Munich, 1979 • References to VDM, Z, LARCH – please see: I. Sommerville’s textbook (C) Vladimir O. Safonov, 2004

  5. OBJ3 (Prof. G. A. Goguen). Example (1/2)ftp://www.cs.ucsd.edu/pub/fac/goguen/obj3/University of California, San Diego obj NAT is sort Nat . op 0 : -> Nat . op s_ : Nat -> Nat [prec 1] . endo obj NATOPS is pr NAT . op 1 : -> Nat . eq 1 = s 0 .  op _+_ : Nat Nat -> Nat [assoc comm prec 3] . vars M N : Nat . eq M + 0 = M . eq M + s N = s(M + N) . (C) Vladimir O. Safonov, 2004

  6. OBJ3: Example (2/2) op _*_ : Nat Nat -> Nat [assoc comm prec 2] . eq M * 0 = 0 . eq M * s N = M * N + M .  op _**_ : Nat Nat -> Nat [prec 4] . eq M ** 0 = 1 . eq M ** s N = (M ** N) * M .  op _-_ : Nat Nat -> Nat . eq M - 0 = M . eq 0 - M = 0 . eq s M - s N = M - N .[ SKIP … ]   [lemma1] cq (N * N)**(M %2) = N ** M if even M . [lemma2] cq N *(N **(M - s 0)) = N ** M if pos M . endo (C) Vladimir O. Safonov, 2004

  7. A monograph on OBJ and algebraic specifications (C) Vladimir O. Safonov, 2004

  8. Other approaches to specification • B Liskov. CLU (M.I.T.): GCD = proc (int M, N) signals (overflow) requires N > 0; effects GCD(M, N) = greatest common divisor of M, N - ср. с “Design-by-Contract” (Dr. B. Meyer, Eiffel) • M. Shaw. ALPHARD (Carnegie-Mellon Univ.) ADT specifications(forms) – by R. Floyd, C.A.R. Hoare. For each ADT,thepre- &post-conditions for each abstract operation, and also abstract invariant and concrete invariant are indicated – a predicate to hold on the abstract (concrete) data items participating in the ADT definition: e.g., SP > 0 (C) Vladimir O. Safonov, 2004

  9. Automated program synthesis by specification (E. Tougu, S.S. Lavrov) • Task formulation: Given a specification of the application domainD (as a collection of equates)and a specification of the pre- and post-conditions: Pre {S} Post Goal: authoated synthesis of the programS • Tools intended to solve similar tasks (U.S.S.R): - PRIZ-> NUT (E. Tougu; please see his monograph: Conceptual programming, Moscow, Science Publishers, 1984) - SPORA (S. Lavrov; automated program synthesis system with the specification language DESCARTES, 1980s) (C) Vladimir O. Safonov, 2004

  10. References • Agafonov V.N.Program specification. Concepts and their organization. – Novosibirsk: Science Publishers, 1988 • Mathematical logic in programming. -Moscow: World Publishers, 1991 • Requirements and Specifications on Program Development. - Moscow, World Publishers, 1984 (C) Vladimir O. Safonov, 2004