250 likes | 459 Views
Elementary Process Descriptions: Specifying Processes. COMM1B Information Systems Analysis. Outline. The need for process specification Bottom level processes on Process Model (DFD) When complete, precise, unambiguous descriptions are needed to define a process Methods: Structured English
E N D
Elementary Process Descriptions:Specifying Processes COMM1B Information Systems Analysis
Outline • The need for process specification • Bottom level processes on Process Model (DFD) • When complete, precise, unambiguous descriptions are needed to define a process • Methods: • Structured English • Decision tables • Decision trees • Mathematical formulae
Example Specificationfor a Process A product is passed as fit for sale if it passes a mechanical test and an electrical test and has the correct dimensions. If it fails the mechanical test or the electrical test (but not both), it is sent back to the workshop for repair. In all other cases the product is rejected.
Problem with English Narrative • Is the condition ‘correct dimensions’ implied in the second and third paragraphs? • Unclear - ambiguous- may or may not be
Using Diagrams and Tables When a process simply involves a number of decisions to be made to determine an outcome, then Decision Tree diagrams or Decision Tables can be used
Dimensions Mech. test Elec. test ACTION Accept OK Not OK OK Not OK Repair OK Not OK Repair OK Not OK Quality Policy Reject Reject OK Not OK OK Not OK Reject Reject OK Not OK Reject Decision Tree
Dimensions Mech. test Elec. test ACTION Accept OK Not OK OK Not OK Repair OK Not OK Repair OK Not OK Quality Policy Reject Reject Decision Tree:simplified
Limited Entry Decision Tables Conditions (questions) Condition Entries (answers) Actions (list) Action Entries (outcomes)
Correct dimensions? Y Y Y Y N N N N Passed mechanical test? Y Y N N Y Y N N Passed electrical test? Y N Y N Y N Y N Accept product X Repair product X X Reject product X X X X X Limited Entry Decision Tables
Decision Table -Eliminating Redundancy Correct dimensions? Y Y Y Y N Passed mechanical test? Y Y N N - Y N Y N - Passed electrical test? Accept product X Repair product X X Reject product X X
Decision Table -Eliminating Redundancy Further Correct dimensions? Y Y Y E L S E Passed mechanical test? Y Y N Passed electrical test? Y N Y Accept product X Repair product X X X Reject product
Using Structured English When a process is more complex and is expected to be computerised, Structured English is usually written (similar to programming code) Components of Structured English (logic constructs) • Sequence: Events happening one after another • Selection: Choices have to be made • Iteration: Repetition of an action
Sequence Multiply Price by Quantity_Sold giving Net_Price Multiply Net_Price by VAT_rate giving VAT_price Add VAT_price to Net_Price giving Gross_Price
Example Specification for a Process A product is passed as fit for sale if it passes a mechanical test and an electrical test and has the correct dimensions. If it fails the mechanical test or the electrical test (but not both), it is sent back to the workshop for repair. In all other cases the product is rejected.
Selection (helpful style with brackets) IF dimensions not OK Reject product ELSE (dimensions OK) IF mechanical test OK IF electrical test OK Pass product ELSE (electrical test not OK) Repair product ELSE (mechanical test not OK) IF electrical test OK Repair product ELSE (electrical test not OK) Reject product
Selection IF dimensions not OK Reject product ELSE IF mechanical test OK IF electrical test OK Pass product ELSE Repair product ELSE IF electrical test OK Repair product ELSE Reject product
Selection (formal style - technical) IF dimensions not OK Reject product ELSE IF mechanical test OK IF electrical test OK Pass product ELSE Repair product ENDIF ELSE mechanical test not OK IF electrical test OK Repair product ELSE electrical test not OK Reject product ENDIF ENDIF ENDIF
Report-like style (accessible) 1. If the dimensions are incorrect: reject product 2. If a product has the correct dimensions, consider the mechanical and electrical tests as follows: 2.1 Product passes both mechanical and electrical tests: pass product 2.2 Product fails both mechanical and electrical tests: reject product 2.3 Either mechanical test or electrical test failed (but not both): repair product
Selection using CASE structure Select CASE CASE l (O <= Net_Price < lOO) Set Discount to O CASE 2 (100 <= Net_Price < 200) Set Discount to 10% CASE 3 (200 <= Net_Price< 300) Set Discount to 15% CASE 4 (300 <= Net_Price < 500) Set Discount to 20% CASE 5 (Net_Price >= 500) Set Discount to 25%
Iteration REPEAT Add Invoice_Total to Overall_Total Add 1 to No_Invoices UNTIL no more invoices Divide Overall_Total by No_Invoices giving Average_Value
Iteration WHILE more invoices Add Invoice_Total to Overall_Total Add 1 to No_Invoices ENDWHILE Divide Overall_Total by No_Invoices giving Average_Value
Summary • The three main methods for specifying processes at their lowest level of detail (known as elementary process descriptions) are: Decision trees, Decision tables and Structured English • Sometimes a mixture of these is used to describe a single process • In your assignment: • Marks for complexity, logical correctness
Order value > £50 Y Y N Order value > £100 Y N - offer 5% discount X offer 10% discount X X offer free gift X Embedded Decision Table example REPEAT READ next order IF regular order customer No discount, offer free delivery ELSE Determine discount according to following table ENDIF UNTIL no more orders
Further Reading • Lejk and Deeks • An Introduction to Systems Analysis Techniques 2nd Edition • Chapter 6 Specifying Processes • S. Skidmore • Introducing Systems Analysis • Chapter 7 • NCC Blackwell, Oxford 1994