Structuring System Requirements:
Logic Modeling
Logic Modeling
Level-0 Diagram
FIGURE 7-5
Level-0 DFD of Hoosier Burger’s food-ordering system
Logic Modeling Deliverables and Outcomes
Each process on the lowest level DFD will be represented by one or more of the following:
Modeling Logic with Structured English
Structured English is used to represent processes in a shorthand manner that is relatively easy for users and programmers to read and understand
Modeling Logic with Structured English
Format of Structured English uses indentation used in programming languages
Structured English does not initialize variables, open and close files, or find related records in separate files – all are done in later design process
A sequence of simple, declarative sentences-one after another. Compound sentences are discouraged because they frequently create ambiguity. •
A conditional or decision structure indicates that a process must perform different steps under well-specified conditions. For example,
BEGIN IF
IF Quantity-in-stock is less than Minimum-order-quantity
THEN GENERATE new order
ELSE DO nothing
END IF
• An iteration or repetition structure specifies that a set of steps should be repeated based on some selected condition.
For example,
WHILE NOT End-of-File DO
BEGIN IF
IF Quantity-in-stock is less than Minimum-order-quantity
THEN GENERATE new order
ELSE DO nothing
END IF
END DO
Modeling Logic with� Decision Tables
Structured English is not good to represent complicated logic (having several different conditions) as it becomes difficult to understand
3 Parts of a Decision Table
Indifferent Condition
Decision Table
Note: for salaried employees the action stub chosen will always be the same…therefore hours worked is an indifferent condition
Reduced Decision Table
Because of indifferent condition, the complete decision table can be reduced to one with fewer rules
Modeling Logic with Decision Trees
Decision tree representation of salary decision
Alternative decision tree representation of salary decision