Illinois Institute of Technology CS 487 Software Engineering

  • Slides: 38
Download presentation
Illinois Institute of Technology CS 487 Software Engineering Requirements II- part B Instructor David

Illinois Institute of Technology CS 487 Software Engineering Requirements II- part B Instructor David Lash CS 48704 -1/47

Example of Modality and Cardinality CS 48704 -2/47

Example of Modality and Cardinality CS 48704 -2/47

Example of ERD CS 48704 -3/47

Example of ERD CS 48704 -3/47

Creating ERDs u u Take each “things” (e. g. , car, contact list) mentioned

Creating ERDs u u Take each “things” (e. g. , car, contact list) mentioned in requirements and ask about relationships to other things Object-relationship pairs and therefore identified – u u u Explore the carinality and modality of that relationship Repeat for each object identified Review the objects and establish attributes Form the ERD and review CS 48704 -4/47

ERD II example - Homesafe u u u u Enables homeowner (HW) to config

ERD II example - Homesafe u u u u Enables homeowner (HW) to config security system (SS), during install HS monitors all sensors connected to SS HS interacts with HW via Keypad on cntl panel (CP) CP is used to program system Each sensor (SEN) is assigned a # and type A master passwd is programmed, Tel number are input for dialing on Sensor event (SEN) on SEN event, alarm invoked & SS dials phone number, and gives info to (MS) monitoring Service CP has keyboard input stuff CS 48704 -5/47

ERD II example - Homesafe CS 48704 -6/47

ERD II example - Homesafe CS 48704 -6/47

ERD II example - Derived Relationships u u u SS monitors sensor SS enables/disables

ERD II example - Derived Relationships u u u SS monitors sensor SS enables/disables sensor SS tests sensor SS program sensor Attributes of Sensor has type, internal id, zone location, alarm level CS 48704 -7/47

ERD II example - Homesafe CS 48704 -8/47

ERD II example - Homesafe CS 48704 -8/47

High-Level Modeling Tools u System Modeling – – System Context Diagram Partitioning u Data

High-Level Modeling Tools u System Modeling – – System Context Diagram Partitioning u Data Modeling – Entity-Relation - Data objects and their relationships u Information flow diagrams – u Data flow diagrams - how data transforms in system- how functions transform data Control Specifications – CS 48704 -9/47 State diagrams - how system behaves as result of external events.

Data Flow Diagrams ( Information Flow ) u A graphical technique that depicts information

Data Flow Diagrams ( Information Flow ) u A graphical technique that depicts information flow and the transforms that are applied as data moves from input to output. – – – Input can be sensor, human operator, web page input, hardware Transformation can be logical comparison, numerical algorithm, graphic algorithm, Output can be LED, web page, report, effect on hardware CS 48704 -10/47

Data Flow Diagram (Divide Operation) Level 0 DF (fundamental) diagram represents system with 1

Data Flow Diagram (Divide Operation) Level 0 DF (fundamental) diagram represents system with 1 bubble CS 48704 -11/47

Data Flow Diagram (Symbols) Process (Data Transformation) External Entity (I/O Src/Dest) External Data Store

Data Flow Diagram (Symbols) Process (Data Transformation) External Entity (I/O Src/Dest) External Data Store (all or part of the information store) Thing System External Thing CS 48704 -12/47 External Thing

Data Flow Diagram (Data Flows or Connectors) CS 48704 -13/47

Data Flow Diagram (Data Flows or Connectors) CS 48704 -13/47

Level 0 Data Flow Input Data CS 48704 -14/47

Level 0 Data Flow Input Data CS 48704 -14/47

Level 0 Data Flow CS 48704 -15/47

Level 0 Data Flow CS 48704 -15/47

Level 0 Data Flow (Interactive System) CS 48704 -16/47

Level 0 Data Flow (Interactive System) CS 48704 -16/47

Data Flow Diagram (Divide Operation) CS 48704 -17/47

Data Flow Diagram (Divide Operation) CS 48704 -17/47

Level 1 - Data Flow (Major Process Operators) CS 48704 -18/47

Level 1 - Data Flow (Major Process Operators) CS 48704 -18/47

Guidelines for building a Data Flow Diagram 1. Show the first level (level 0)

Guidelines for building a Data Flow Diagram 1. Show the first level (level 0) as a single process with all of its external inputs and outputs sources. 2. Primary input and output should be carefully noted. 3. Refinement begins by isolating candidate processes. 4. All data flows and symbols should be labeled with meaningful names. 5. Information flow continuity must be maintained. (within the refinement) 6. One bubble at a time is expanded. 7. Record all components in the data dictionary. CS 48704 -19/47

Level N Data Flow (Detailed Process to Transform) CS 48704 -20/47

Level N Data Flow (Detailed Process to Transform) CS 48704 -20/47

Data-Flow Example R. S. Pressman, Ph. D. Software Engineering: A Practitioner’s Approach. Mc. Graw-Hill,

Data-Flow Example R. S. Pressman, Ph. D. Software Engineering: A Practitioner’s Approach. Mc. Graw-Hill, New York. 1997. p. 377 CS 48704 -21/47

Level 1 - introduce process and data store R. S. Pressman, Ph. D. Software

Level 1 - introduce process and data store R. S. Pressman, Ph. D. Software Engineering: A Practitioner’s Approach. Mc. Graw-Hill, New York. 1997. p. 378 CS 48704 -22/47

Level 2 - Show more detail for each level 1 process (monitor sensors) R.

Level 2 - Show more detail for each level 1 process (monitor sensors) R. S. Pressman, Ph. D. Software Engineering: A Practitioner’s Approach. Mc. Graw-Hill, New York. 1997. p. 379 CS 48704 -23/47

Behavioral Modeling u Behavior is the observable effects of an event, including its results.

Behavioral Modeling u Behavior is the observable effects of an event, including its results. u Control flow diagramming u – An extension to data flow diagramming – Adds events to the data model State transition diagrams – More traditional behavior model. – Useful for a variety of applications. CS 48704 -24/47

State Diagram u A state diagram illustrates how the system moves from state to

State Diagram u A state diagram illustrates how the system moves from state to state. For example – – monitoring state -> alarm state -> monitoring state (homesafe) What events trigger the change in state? Sense danger, reset alarm u u A state diagram shows the state machine – State Machine A behavior that specifies the sequences of states an object goes through during its lifetime in response to events, together with its responses to those events u CS 48704 -25/47

What is the scientific base for state-machine? Conservation of Momentum Law When the resultant

What is the scientific base for state-machine? Conservation of Momentum Law When the resultant external force acting on a system is zero, the total momentum of the system remains constant. CS 48704 -26/47

What are the components of a state machine? u States – – – Any

What are the components of a state machine? u States – – – Any observable mode of behavior. A condition or situation during the life of an object during which it satisfies some condition, performs some activity or waits for some event. Description is contained in a data dictionary. Name CS 48704 -27/47

What are the components of a state machine? u Transitions – A relationship between

What are the components of a state machine? u Transitions – A relationship between two states indicating that an object in the first state will perform certain actions and enter the second state when a specified event occurs and specified conditions are satisfied. (Event & Conditions) CS 48704 -28/47

Types of state transition diagrams u Action on transition – – – Actions are

Types of state transition diagrams u Action on transition – – – Actions are performed on event transition On the diagram that is where the actions are defined. Events, Conditions and Actions are described in the data dictionary. (Event & Conditions): Action(s) CS 48704 -29/47

Example of action on transition CS 48704 -30/47

Example of action on transition CS 48704 -30/47

Types of state-transition diagrams. u Action on state entry – – – Actions are

Types of state-transition diagrams. u Action on state entry – – – Actions are performed when a state is entered. Transitions carry optional data and not actions. States, events, conditions and data are described in the data dictionary. (Event & Condition): Data CS 48704 -31/47 State Name Action(s)

Parser Example Given a text (stored on a file) consisting of words separated by

Parser Example Given a text (stored on a file) consisting of words separated by SPACE characters or by CR (new line) characters, a program is supposed to read the text and suppress all extra SPACE characters according to the following rules: – Words should be separated only by one SPACE character, – Between a word and CR character there should be no SPACE character, – New line cannot start with a SPACE character, – Program terminates on EOF (End of File) character. CS 48704 -32/47

Example u Processing States – New Line. Last character was a CR or beginning

Example u Processing States – New Line. Last character was a CR or beginning of process. – Word. Last character is not a space or CR. – Space. Last character is a space. – End-of-file. CS 48704 -33/47

Example u Events (must be account for in each state) – End-of-file indicator –

Example u Events (must be account for in each state) – End-of-file indicator – NL Character – Space Character – Text Characters CS 48704 -34/47

Example u Actions – Read Next – Store Word – Set Error – List

Example u Actions – Read Next – Store Word – Set Error – List Stored Words CS 48704 -35/47

State Diagram Example CS 48704 -36/47

State Diagram Example CS 48704 -36/47

Analysis Modeling u u Software models must represent: – the information that the sftwr

Analysis Modeling u u Software models must represent: – the information that the sftwr acts on – the function that enable action – and overall system behavior Requirements Models Roles: – Understand the information, function, behavior and information in the system – Focal Point for the review - Avoids lots of wrds help deal with complexity of problem – Become foundation for design process CS 48704 -37/47

High-Level Modeling Tools u System Modeling – – System Context Diagram Partitioning u Data

High-Level Modeling Tools u System Modeling – – System Context Diagram Partitioning u Data Modeling – Entity-Relation - Data objects and their relationships u Information flow diagrams – u Data flow diagrams - how data transforms in system- how functions transform data Control Specifications – State diagrams - how system behaves as result of external events. CS 48704 -38/47