and structured decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfdeveloping...

66
1

Upload: others

Post on 10-Nov-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

1

Page 2: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Describing Process Specificationand Structured Decisions

Group 6

2

Page 3: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Members

3

Nguyen VietSang

Hoang Tran MinhTai

Tran NgocQuy

Nguyen QuangSang

Page 4: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

OverviewHave you ever bought an item on TIKI?

4

Page 5: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Overview

Procedure

5

Page 6: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Overview

Data Flow Diagram for Login6

Page 7: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Overview

Data Flow Diagram for Login

What does process actually do?

7

Page 8: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Overview

Data Flow Diagram for Purchase

What does process actually do?

8

Page 9: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Overview

Need Process Specification

9

Page 10: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Overview

Need Process Specification

Structured Decisions

support to clarify

10

Page 11: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Content● Process specifications● Structured English● Decision tables● Decision trees● Horizontal balancing

11

Page 12: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Content● Process specifications● Structured English● Decision tables● Decision trees● Horizontal balancing

12

Page 13: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Process specifications● Sometimes called minispecs● Create for

○ processes on a data flow diagram○ class methods in object-oriented design○ steps in use case

13

Page 14: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Process specifications - Goals

14

Reduce process ambiguity Precise description of what is accomplished

Validate the system design

Page 15: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Process specifications - Not create for processes that...

15

Physical input/output Simple data validation Prewritten code

Page 16: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Process specifications - Not create for processes that...

16

Simple or computer code already exists!

Page 17: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Process specifications - Form

17

● Number● Name● Description: what the

process accomplishes

Page 18: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Process specifications - Form

18

● Input Data Flow● Output Data Flow● Type of Process● Subprogram/Function Name

E.g: library name

Page 19: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Process specifications - Form

19

● Process Logic: states policy and business rules (conditions, formulas...)

Page 20: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Process specifications - Form

20

● Common Business rules:○ Definitions of business terms○ Business conditions and actions○ Data integrity constraints○ Mathematical and functional derivations○ Logical inferences○ Processing sequences○ Relationships among facts about the business

Page 21: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Process specifications - Form

21

● Logic method reference:If not enough room

● Unresolved Issues

Page 22: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Activity

22Fill the Process Specification for this process

Quantity on Hand

Order Item Quantity

Page 23: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Solution

23

Page 24: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Content● Process specifications● Structured English● Decision tables● Decision trees● Horizontal balancing

24

Page 25: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

What is Structured English?● The use of English Language with syntax of programming structure● Be like limited-form of "pseudocode"● Used for:

○ Communicate Computer Program - Non-tech users○ Give aims to get benefit of both Programming logic - Natural Language○ Logic involves: Formulas, Iterations, …

● 4 Structured English Types:○ Sequential Structure○ Decision Structure○ Case Structure○ Iteration

25

Page 26: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Writing Structured English● All logic should be expressed in 1 of 4 types● Statements should be clear and unambiguous● Indent blocks of statements● One line or indent next line● CAPITALIZE keywords● CAPITALIZE name of block statements, finish with END● Underline words defined in data dictionary● Comment line with *

26

Page 27: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

● 4 Structured English Types● Keywords

27

Writing Structured English

Page 28: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

ExampleIF customer has a Bank Account THEN IF Customer has no dues from previous account THEN Allow loan facility ELSE IF Management Approval is obtained THEN Allow loan facility ELSE Reject ENDIF ENDIFELSE RejectENDIFEXIT

28

Page 29: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Data Dictionary?● Is a structured repository of data elements in system.● Stores description of all DFD data elements● Such as: data flows, data stores, the processes

Example:GET Order RecordGET Customer RecordMove Order Number to shipping statementMove Order Date to Shipping StatementMove Customer Number to Shipping Statement...

29

Page 30: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Advantages of Structured English

● Clarifying the logic and relationships found in human languages● Effective communication tool● It can be taught to and understood by users in the organization

30

Page 31: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Content● Process specifications● Structured English● Decision trees● Decision tables● Horizontal balancing

31

Page 32: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Decision Trees● Used when complex branching occurs in a structured decision process● Keep a string of decisions in a particular sequence

32

Page 33: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Drawing Decision Trees

33

● Identify all conditions, actions, order, timings

● Building Tree from left -> right, make sure all possible alternatives moving to the right

Page 34: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Decision Trees Advantages

34

● The order of checking conditions is immediately noticeable

● Conditions and actions can be available in this branch but none in the other

● Compared to Decision tablesmore readily understood

Page 35: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Content● Process specifications● Structured English● Decision trees● Decision tables● Horizontal balancing

35

Page 36: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Decision table● It is a graphical method for representing process logic.● It provide a way to examine, describe, and document decisions using a

table.● They are used to:

○ Describe the conditions.○ Identify possible decision alternatives.○ Indicate actions should be performed.○ Describe actions.

36

Page 37: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Decision Table ExampleRule 3 says:

If N (the total sale is NOT under $50) ANDIf Y (the customer paid by check and had two forms of ID ) ANDIf N (the customer did not use a credit card) THENDO X ( call the supervisor for approval)

37

conditionsdecision alternatives

actions

Page 38: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Developing Decision TablesTo build decision tables, an analyst needs to determine:

● The maximum size of the table● Eliminate any impossible situations, inconsistencies, or redundancies● Simplify the table as much as possible

38

Page 39: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Developing Decision Tables - Login function

39

Page 40: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Developing Decision Tables - Login functionStep 1: Determine conditions that affect the decision

● Combine rows that overlap,such as conditions that aremutually exclusive.

● The number of conditions becomesThe number of rows in thetop half of the decision table.

40

Page 41: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Developing Decision Tables - Login function

41

Conditions and ActionsRules

Username

Password

Page 42: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Developing Decision Tables - Login functionStep 2: Determine the number of possible actions that can be taken.

That number becomes the number of rows in the lower half of the decision table.

● Show error: Please enter username● Show error: Please enter a valid username● Show error: Login failed● Show error: Please enter password● Show home page

42

Page 43: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Developing Decision Tables - Login function

43

Conditions and ActionsRules

Username

Password

Show error: Please enter username

Show error: Please enter a valid username

Show error: Login failed

Show error: Please enter password

Show home page

Page 44: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Developing Decision Tables - Login functionStep 3: Determine the number of condition alternatives for each condition.

● Username:○ Blank○ Invalid○ Valid

● Password:○ Blank○ Invalid○ Valid

44

Page 45: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Developing Decision Tables - Login functionStep 4: Calculate the maximum number of columns in the decision table by multiplying the number of alternatives for each condition.

Condition 1: x 3 alternatives

Condition 2: x 3 alternatives

9 possibilities

45

Page 46: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Developing Decision Tables - Login function

46

Conditions and ActionsRules

1 2 3 4 5 6 7 8 9

Username

Password

Show error: Please enter username

Show error: Please enter a valid username

Show error: Login failed

Show error: Please enter password

Show home page

Page 47: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Developing Decision Tables - Login functionStep 5: Fill in the condition alternatives.

(Blank - B, Invalid - I, Valid - V)

Condition 1: B B B I I I V V V

Condition 2: B I V B I V B I V

Step 6: Complete the table by inserting an X where rules suggest certain actions.

47

Page 48: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Developing Decision Tables - Login function

48

Conditions and ActionsRules

1 2 3 4 5 6 7 8 9

Username B B B I I I V V V

Password B I V B I V B I V

Show error: Please enter username X X X

Show error: Please enter a valid username X X

Show error: Login failed X X

Show error: Please enter password X

Show home page X

Page 49: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Developing Decision Tables - Login functionStep 7: Combine rules where it is apparent that an alternative does not make a difference in the outcome.

Username: B B B B

Password: B I V __

Enter username: X X X X

49

Page 50: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Developing Decision Tables - Login functionStep 8: Check the table for any impossible situations, contradictions, and redundancies. They are discussed in more detail later.

Step 9: Rearrange the conditions and actions (or even rules) if it makes the decision table more understandable.

50

Page 51: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Developing Decision Tables - Login function

51

Conditions and ActionsRules

1 2 3 4 5 6 7

User name B I I I V V V

Password _ B I V B I V

Show error: Please enter username X

Show error: Please enter a valid username X X

Show error: Login failed X X

Show error: Please enter password X

Show home page X

Page 52: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Checking for Completeness and Accuracy ● Decision tables help analysts ensure completeness and

accuracy.● Four main problems that can occur in developing

decision tables:○ Incompleteness.○ Impossible situations.○ Contradictions.○ Redundancy.

52

Page 53: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Checking for Completeness and Accuracy

53

Rule 1 is not feasible, because a person cannot earn greater than $50,000 per year and less than $2,000 per month at the same time.

Contradictions often occur of dashes [--] are incorrectly inserted into the table. Redundancy occurs when identical sets of alternatives require the exact same action. The analyst has to determine what is correct and then resolve the contradiction or redundancy.

Page 54: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

More Advanced Decision Tables● Decision tables can become very big because they grow rapidly as the

number of conditions and alternatives increases.● In order to avoid a decision table to grow rapidly, we can use Extended

Entries or ELSE rule.○ Extended entries: to reduce the possibility of redundancy and contradiction.

54

C1: Did not order YNNNC2: Ordered once NYNNC3: Ordered twice NNYNC4: Ordered more than twice NNNY

C1: Number of times customer ordered: 0 1 2 >2

Page 55: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

More Advanced Decision Tables2. ELSE Rule: to eliminate repetitive rules requiring the exact same action.

55

Page 56: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Content● Process specifications● Structured English● Decision tables● Decision trees● Horizontal balancing

56

Page 57: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Content● Process specifications● Structured English● Decision tables● Decision trees● Horizontal balancing

57

Page 58: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Horizontal Balancing

58

● A method where the process specifications are used to analyze the DFD and data dictionary

● Ensure method logic in process has all the informations required to complete its work

Page 59: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Horizontal Balancing Rules

59

● All output data flow elements must be either present on input data elements or described in the process logic

Page 60: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Horizontal Balancing

60

Page 61: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Horizontal Balancing Rules

61

● Process has the formulas and logic necessary to produce the output

Page 62: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Horizontal Balancing

62

Page 63: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Horizontal Balancing

63

Page 64: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Horizontal Balancing

64

Page 65: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Summary● Process specifications

○ Structured English○ Decision tables○ Decision trees

● Horizontal balancing

65

Page 66: and Structured Decisionscse.hcmut.edu.vn/~thanhtung/downloads/sad/181901/181901-66.pdfDeveloping Decision Tables - Login function Step 8: Check the table for any impossible situations,

Thank you

66

Any question?