Ch. 51 Specification. Ch. 52 Outline Discussion of the term "specification" Types of specifications –operational Data Flow Diagrams (Some) UML diagrams.

Slides:



Advertisements
Similar presentations
A Brief Introduction. Acknowledgements  The material in this tutorial is based in part on: Concurrency: State Models & Java Programming, by Jeff Magee.
Advertisements

Software Requirements Engineering
Object-Oriented Analysis and Design
Introduction To System Analysis and Design
Use-case Modeling.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 8 Slide 1 System models.
L4-1-S1 UML Overview © M.E. Fayad SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I.
The Unified Software Development Process - Workflows Ivar Jacobson, Grady Booch, James Rumbaugh Addison Wesley, 1999.
SE 555 Software Requirements & Specification1 Use-Case Modeling: Overview and Context.
Lecture 6 & 7 System Models.
Modified from Sommerville’s originalsSoftware Engineering, 7th edition. Chapter 8 Slide 1 System models.
Ch5: Software Specification. 1 Overview  Use of specifications  Specification qualities  Classification of specification styles  Verification of specifications.
Course Instructor: Aisha Azeem
Chapter 7: The Object-Oriented Approach to Requirements
Basic Concepts The Unified Modeling Language (UML) SYSC System Analysis and Design.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 1 System models l Abstract descriptions of systems whose requirements are being.
System Analysis Overview Document functional requirements by creating models Two concepts help identify functional requirements in the traditional approach.
Introduction To System Analysis and design
UML Unified Markup Language Ziya Karakaya Atılım University, Computer Engineering
Functional Modeling Joseph Valacich, Joey George and Jeff Hoffer, Essentials of System Analysis and Design, 4 th edition, Prentice Hall, 2009.
Chapter 5: Specification Yuanfang Cai CS751 Jan 29, 2003.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 1 System models l Abstract descriptions of systems whose requirements are being.
Chapter 4 System Models A description of the various models that can be used to specify software systems.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 20 Object-Oriented.
Systems Analysis and Design in a Changing World, Fifth Edition
Introduction to Formal Methods Based on Jeannette M. Wing. A Specifier's Introduction to Formal Methods. IEEE Computer, 23(9):8-24, September,
Ch. 51 Specification. Ch. 52 Outline Discussion of the term "specification" Types of specifications –operational Data Flow Diagrams (Some) UML diagrams.
Introduction To System Analysis and Design
Programming in Java Unit 3. Learning outcome:  LO2:Be able to design Java solutions  LO3:Be able to implement Java solutions Assessment criteria: 
Copyright 2002 Prentice-Hall, Inc. Chapter 2 Object-Oriented Analysis and Design Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 8 Slide 1 Object-oriented and Structured System Models.
Approaching a Problem Where do we start? How do we proceed?
Chapter 7 System models.
Modified by Juan M. Gomez Software Engineering, 6th edition. Chapter 7 Slide 1 Chapter 7 System Models.
Modeling Shari L. Pfleeger and Joanne M. Atlee, Software Engineering: Theory and Practice, 4 th edition, Prentice Hall, Hans Van Vliet, Software.
Systems Analysis and Design in a Changing World, 3rd Edition
Sommerville 2004,Mejia-Alvarez 2009Software Engineering, 7th edition. Chapter 8 Slide 1 System models.
1 Specification Some slides for Chapter 5 Of Ghezzi, Jazayeri, and Mandrioli.
Requirements as Usecases Capturing the REQUIREMENT ANALYSIS DESIGN IMPLEMENTATION TEST.
Software Engineering Prof. Ing. Ivo Vondrak, CSc. Dept. of Computer Science Technical University of Ostrava
Unified Modeling Language* Keng Siau University of Nebraska-Lincoln *Adapted from “Software Architecture and the UML” by Grady Booch.
UML Use Case Diagramming Guidelines. What is UML? The Unified Modeling Language (UML) is a standard language for specifying, visualizing, constructing,
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 1 Chapter 7 System Models.
Fall 2010 CS4310 Requirements Engineering A Brief Review of UML & OO Dr. Guoqiang Hu Department of Computer Science UTEP 1.
7 Systems Analysis and Design in a Changing World, Fifth Edition.
Requirements Specification. Welcome to Software Engineering: “Requirements Specification” “Requirements Specification”  Verb?  Noun?  “Specification”
Use Case Diagram The purpose is to communicate the system’s functionality and behaviour to the customer or end user. Mainly used for capturing user requirements.
UML as a Specification Language for Embedded Systems. By, Mir Ahmed Ali, Asst. Professor, ECM department, SNIST. By, Prof. Narsiah sir, Director of School.
Functional Modeling Joseph Valacich, Joey George and Jeff Hoffer, Essentials of System Analysis and Design, 4 th edition, Prentice Hall, 2009.
Systems Analysis and Design in a Changing World, Fourth Edition
Lecture 9-1 : Intro. to UML (Unified Modeling Language)
UML - Development Process 1 Software Development Process Using UML.
Requirement Analysis SOFTWARE ENGINEERING. What are Requirements? Expression of desired behavior Deals with objects or entities, the states they can be.
1 Specification A broad term that means definition Used at different stages of software development for different purposes Generally, a statement of agreement.
Daniel Amyot, University of Ottawa Based on Powerpoint slides by Gunter Mussbacher (2009) with material from: Jo Atlee, Dan Berry (both University of Waterloo);
1 CEN 4020 Software Engineering PPT4: Requirement analysis.
Modeling Shari L. Pfleeger and Joanne M. Atlee, Software Engineering: Theory and Practice, 4 th edition, Prentice Hall, Hans Van Vliet, Software.
Chapter 7 Part II Structuring System Process Requirements MIS 215 System Analysis and Design.
Introduction to Software Engineering 1. Software Engineering Failures – Complexity – Change 2. What is Software Engineering? – Using engineering approaches.
Laurea Triennale in Informatica – Corso di Ingegneria del Software I – A.A. 2006/2007 Andrea Polini VII. System Specification (I)
Systems Analysis and Design in a Changing World, Fourth Edition
Unified Modeling Language
Introduction to Unified Modeling Language (UML)
Structured Analysis and Dataflow Diagrams
Modeling Shari L. Pfleeger and Joanne M. Atlee, Software Engineering: Theory and Practice, 4th edition, Prentice Hall, Hans Van Vliet, Software Engineering:
Introduction to UML.
Dynamic Modeling Lecture # 37.
Software Engineering System Modeling Chapter 5 (Part 1) Dr.Doaa Sami
Presentation transcript:

Ch. 51 Specification

Ch. 52 Outline Discussion of the term "specification" Types of specifications –operational Data Flow Diagrams (Some) UML diagrams Finite State Machines Petri Nets –descriptive Entity Relationship Diagrams Logic-based notations Algebraic notations Languages for modular specifications –Statecharts –Z

Ch. 53 Specification A broad term that means definition that emphasizes on What to do versus How to do it –In traditional engineering it has precise meaning (i.e., the specific parameters of the product). In SE this is not the case. Used at different stages of software development for different purposes Generally, specification is a statement of agreement (contract) between producer and consumer of a service: –implementer and user: requirement spec, non-technical, e.g., plain English –Architect and developer: design spec, technical, e.g., UML diagrams All desirable qualities must be specified

Ch. 54 Uses of specification Statement of user requirements –major failures occur because of misunderstandings between the producer and the user Lack of knowledge of computer –In most cases the owner does not exactly know what he/she wants to be developed –"The hardest single part of building a software system is deciding precisely what to build" (Frederick Brooks)

Ch. 55 Uses of specification (cont.) Statement of the interface between the machine and the controlled environment –serious undesirable effects can result due to misunderstandings between software engineers and domain experts about the phenomena affecting the control function to be implemented by software: Receiving input signals from sensors and generating output signals to control the embedded system.

Ch. 56 Uses of specification (cont.) Statement of requirements for implementation –Software Development process is a chain of: Specification–Implementation–Verification steps Requirements specification refers to definition of external behavior –design specification must be verified against it Design specification refers to definition of the software architecture –code must be verified against it

Ch. 57 Uses of specification (cont.) A reference point during maintenance –Corrective maintenance only changes implementation –Adaptive and Perfective maintenance occur because of requirements changes requirements specification must change accordingly

Ch. 58 Specification qualities Precise, clear, unambiguous Consistent Complete –internal completeness –external completeness Incremental

Ch. 59 Clear, unambiguous, understandable Example: specification fragment of a word- processor for “selection” operation. Selecting is the process of designating areas of the document that you want to work on. Most editing and formatting actions require two steps: first you select what you want to work on, such as text or graphics; then you initiate the appropriate action. can an area be scattered?

Ch. 510 Precise, unambiguous, clear Another example (from a real safety- critical system) The message must be triplicated. The three copies must be forwarded through three different physical channels. The receiver accepts the message on the basis of a two-out-of-three voting policy. can a message be accepted as soon as we receive 2 out of 3 identical copies of message or do we need to wait for receipt of the 3 rd ?

Ch. 511 Consistent Example: specification fragment for a word-processor The whole text should be kept in lines of equal length. The length is specified by the user. Unless the user gives an explicit hyphenation command, a carriage return should occur only at the end of a word. What if the length of a word exceeds the length of the line?

Ch. 512 Complete Internal completeness –The specification must define any new concept or terminology that it uses glossary of terms is helpful for this purpose External completeness –The specification must document all the needed requirements difficulty: when should one stop?

Ch. 513 Incremental Referring to the specification process –start from a sketchy document and progressively add details Referring to the specification document –document is structured and can be understood and extended in increments

Ch. 514 Classification of specification styles Informal (plain English), semi-formal (DFD, UML diagrams), formal (languages: Z, Larch, B-method, Petri-nets, SDL, VHDL, LOTOS) Operational –Behavior specification in terms of some abstract machine Descriptive –Behavior described in terms of properties and input/output relation.

Ch. 515 Example 1 Specification of a geometric figure E: Ellipse can be drawn as follows: 1.Select two points P1 and P2 on a plane 2.Get a string of a certain length and fix its ends to P1 and P2 3.Position a pencil as shown in next figure 4.Move the pen clockwise, keeping the string tightly stretched, until you reach the point where you started drawing this is an operational specification

Ch. 516

Ch. 517 A descriptive specification Ellipse E is described by the following equation: ax 2 + by 2 + c = 0 where a, b, and c are suitable constants. Given x as input, the resulting pairs in the form of (x, y 1 ) and (x,y 2 ) would be two points of the Ellipse in the x-y plane. this is a descriptive specification

Ch. 518 Another example: Sorting an array of elements “Let a be an array of n elements. The result of its sorting is an array b of n elements such that the first element of b is the minimum of a (if several elements of a have the same value, any one of them is acceptable); the second element of b is the minimum of the array of n-1 elements obtained from a by removing its minimum element; and so on until all n elements of a have been removed.” “The result of sorting array a is an array b which is a permutation of a and is sorted.” OP DES

Ch. 519 How to verify a specification? Testing specification against the ideal system: “Observe” dynamic behavior of the specified system (simulation, prototyping). “Analyze” properties of the specified system similar to the traditional engineering: –physical model of a bridge –mathematical model of a bridge

Ch. 520 Data Flow Diagrams (DFDs) A semi-formal operational specification System viewed as collection of “data” manipulated by “functions” Data can be persistent –they are stored in data repositories Data can flow –they are represented by data flows DFDs have a graphical notation

Ch. 521 Graphical notation –bubbles represent functions –arcs represent data flows –open boxes represent persistent store –closed boxes represent I/O interaction

Ch. 522 Example specifies evaluation of (a + b) * (c + a * d)

Ch. 523 A construction “method” (1) 1. Start from the “context” diagram

Ch. 524 A construction “method” (2) 2. Proceed by refinements until you reach “elementary” functions (preserve balancing)

Ch. 525 A library example

Ch. 526 Refinement of “Get a book”

Ch. 527 Patient monitoring systems The purpose is to monitor the patients’ vital factors--blood, pressure, temperature, …--reading them at specified frequencies from analog devices and storing readings in a DB. If readings fall outside the range specified for patient or device fails, an alarm must be sent to a nurse. The system also provides reports.

Ch. 528 A refinement

Ch. 529 More refinement

Ch. 530 An evaluation of DFDs (1) Easy to read, but … Informal semantics –How to define leaf functions? –Inherent ambiguities Outputs from A, B, C are all needed? Outputs for E and F are produced at the same time?

Ch. 531 An evaluation of DFDs (2) Control information is absent Possible interpretations: (a)A produces datum, waits until B consumes it (b)B can read the datum many times without consuming it (c)a pipe is inserted between A and B

Ch. 532 Formalization/extensions There have been attempts to formalize DFDs There have been attempts to extend DFDs (e.g., for real-time systems)

Ch. 533 UML diagrams UML (Unified Modeling Language) is a general purpose visual modeling language that provides different types of diagrammatic techniques and notations to specify, visualize, analyze, construct, and document the artifacts of a software system. Software artifacts include: SRS, SDS, test cases, source code, technical/user manual, software architecture, etc. UML diagrams are used to understand, design, browse, configure, maintain, and control information about software system. UML is intended for use with all development methods, lifecycle stages, application domains, and media. In this chapter, we cover use-case diagram, sequence diagram, and collaborative diagram from UML.

Ch. 534 UML History UML was developed in an effort to unify and simplify the large number of OO development methods that use popular OO languages. Simula 67 was the first OO language Smalltalk was introduced in early 1980s followed by Objective C, C++, Eiffle, CLOS, Java. First OO development method was Shlaer-88, then Yourdon 91, and Booch 91 Unification effort: –UML 1995 by Booch, Rumbaugh, Jacobson –OMG 1996 proposed a standard for OO modeling CORBA

Ch. 535 Modeing Software System What is model? –A model captures the important aspects of the artifact being modeled from a certain point of view, and simplifies or omits the rest. Data, Function, Behavior, Process, Implementation… What are models for? –To capture and precisely state requirements and domain knowledge so that all stakeholders may understand and argue on them. –To think about the design of a system –To capture design decisions –To organize, find, filter, retrieve, examine, and edit information about large systems.

Ch. 536 UML use-case diagrams Defines a global view of the actors involved in a system and the actions that the system performs, which in turn provides an observable result that is of value to the actors. Partitions the overall functionality of the system into transactions with respect to the actor and illustrates how actors interact with them. Actors define different roles such as: people, computer systems, environment borrow book return book library update librarian customer

Ch. 537 Use case diagram notations Association: the communication path between an actor and a use case that the actor participates in Extend: the insertion of additional behavior into a base use case that extends its operation. Generalization: relation between a general use case and a more specific use case that inherits from it. Include: the insertion of additional behavior into a base use case that describes the details of the base use case. Place order Order produce Supply Customer data Request catalog Arrange payment Pay cash Pay by credit > Parent use case Child use case Inclusion use case Base use case Extension use case Association > Actor Generalization

Ch. 538 UML sequence diagram Describes how different objects in the system interact by exchanging messages Provides a dynamic and temporal view Emphasizes on time sequence of message exchange

Ch. 539 UML sequence diagram example: Ticket selling box office

Ch. 540 UML collaboration diagrams Represents object interactions and their order Equivalent to sequence diagrams Sequence diagram is intended for time ordering considerations, whereas collaboration is emphasizes on the structural aspect of the system.

Ch. 541 UML collaborative diagram example: Ticket selling box office

Ch. 542 Finite state machines (FSMs) Can specify control flow aspects Defined as a finite set of states, Q; a finite set of inputs, I; a transition function d : Q x I  Q (d can be a partial function)

Ch. 543 Example: a lamp

Ch. 544 Another example: a plant control system

Ch. 545 A refinement

Ch. 546 Classes of FSMs Deterministic/nondeterministic FSMs as recognizers –introduce final states FSMs as transducers –introduce set of outputs...

Ch. 547 FSMs as recognizers q f is a final state

Ch. 548 FSMs as recognizers

Ch. 549 Limitations Finite memory State explosion –Given a number of FSMs with k 1, k 2, … k n states, their composition is a FSM with k 1 * k 2 *… * k n. This growth is exponential with the number of FSMs, not linear (we would like it to be k 1 + k 2 +… + k n )

Ch. 550 State explosion: an example

Ch. 551 The resulting FSM

Ch. 552 FSM simulator

Ch. 553 More Resources on FSM Course web page has several examples of finite state machines in reading questions Wikipedia – For more in-depth study refer to the text books for finite automata theory.