Process Specification


Introduction

Context of Process Specifications (Pspecs)

Goals for Process Specifications

Use the method(s) that best achieve(s) the goals.

Methods for Process Specifications


Structured English

Sentences of structured English (or pseudocode) consist of:
Verbs/Actions
Nouns/Objects
Adjectives from Domain
Structured Programming Constructs
Not Used

Other Guidelines

Examples

Number-Days-Late = Today - Due-Date
Fine = Number-Days-Late * Per-Diem-Fine

IF Due-Date > Today THEN
	Fine = (Due-Date - Today) * Per-Diem-Fine

WHILE User-Not-Done AND NOT Timed-Out DO
	Process-User-Request

Pre/Post Conditions

Types of Conditions


Decision Tables

General Form

Condition StubCondition Matrix
Action StubAction Matrix

Example...


_____________ 12345678
Age>> 21 ____ YYYYNNNN
Sex _________ MMFFMMFF
Weight>> 150. YNYNYNYN
Medication 1. X___X__X
Medication 2. _X__X___
Medication 3. __X__X_X
No Medication ___X__X_

Constructing a Decision Table

  1. Identify conditions/variables and all values they can take on
    (use ranges of values to create discrete classes)
  2. Calculate the number of combinations
    product of number of values for each decision variable
  3. Identify all possible actions/decisions
  4. Create an empty decision table by listing all conditions and decisions on left side, and all combinations of decisions across top
  5. List all combinations of conditions in each column
  6. Identify the appropriate decision for each combination of conditions
  7. Identify any problems (omissions, contradictions, ambiguities)
  8. Discuss any problems with the user and revise decision table based on answers

Example Decision Table

Choosing a method for delivery
Variables (conditions) [4*3*3*3 = 108]
Carriers (actions)

Decision Trees

Constructing a Decision Tree

  1. Identify all decision variables and possible values
    this is the same as for decision tables
  2. Determine the number of rules
    this is the same as for decision tables
  3. Generate the tree from left to right
  4. Attach independent actions to leaves
  5. Formulate questions to resolve problems
  6. Revise Decision Tree based on answers
  7. Consider pruning the tree

Generating the Tree

Example Decision Tree

Compute the roots of quadratic equation:
    ? a = 0 ?
        yes
            ? b = 0 ?
                yes
                    ? c = 0 ?
                        yes
                            x = 0
                        no
                            no solution
                no
                    x = -c/b
        no
            ? ac < 0 ?
                yes
                    imaginary roots
                no
                    ? c = 0 ?
                        yes
                            x = -b/2a
                        no
                            tmp = sqrt (4ac)
                            x1 = (-b + tmp) / 2a
                            x2 = (-b - tmp) / 2a
Another format, with "yes" branches above and "no" branches below.
                x = 0
            ? c = 0 ?
                no solution
        ? b = 0 ?
            x = -c/b
    ? a = 0 ?
            imaginary roots
        ? ac < 0 ?
                x = -b/2a
            ? c = 0 ?
                tmp = sqrt (4ac)
                x1 = (-b + tmp) / 2a
                x2 = (-b - tmp) / 2a

Choosing the Best Method

IF simple transformations
THEN
	Pseudocode (Structured English)
ELSE IF complex transformations using known algorithm
THEN
	Pre/Post-Conditions
ELSE IF many decision variables
THEN
	Decision Table
ELSE IF many combinations of actions
THEN
	Decision Table
ELSE IF few decision variables
THEN
	Decision Tree
ELSE IF need to check combinations of conditions with customer
THEN
	Decision Table, possibly then converted to Decision Tree
END IF


From Perlman, Ohio State University, 1996