You are on page 1of 42

STRUCTURING CHAPTER 3

SYSTEM PROCESS ROHANI BINTI ABU


BAKAR

REQUIREMENTS FACULTY OF COMPUTING


LEARNING OBJECTIVES
1. Able to writing the requirements in form of syntactic requirement
patterns.
2. Use decision tables to represent the logic of choice in conditional
statements.
3. Presenting the conditional and repetition statement in Structured
English.
Where we are?

1. SYNTACTIC REQUIREMENT
PATTERN
2. STRUCTURED ENGLISH
3. DECISION TABLES
Syntactic Requirement Patterns
Defines as documenting requirements in
natural language and defines the meaning of
keywords used in patterns.
Requirements VS Natural
Language
1. Documenting requirements in natural language
 Does not require preparation time
 Universal in the sense can be used to describe any circumstance.

2. Problem with natural language (because inherently from ambiguious)


 Subjective interpretation

 Transformational effects
1. Normalization
2. Nouns without reference index
3. Universal quantifiers
4. Incompletely specified conditions
5. Incompletely specified processes verbs
Requirement Construction using
Template
Requirement Template:
– is a blueprint for the syntactic structure of individual
requirements.
- provide a simple and easily understandable approach to reduce
language effects when documenting requirements.
- support author in achieving high quality and syntactic
unambiguousness in optimal time and at low cost.
- it is advisable to use in conjunction with project glossary.
STEP-BY-STEP USING
REQUIREMENTS TEMPLATE

3. 5. Determine
1. Determine 2. The
Characteristic 4. Insert logical and
the legal requirement
s the activity object temporal
obligation core
of a system condition
1.
Determin 2. The requirement 3. Characteristics the
4. Insert object
5. Determine logical
and temporal
e the legal core activity of a system
condition

obligation
Objective: to determine the degree of legal obligation for a requirements; between
legally obligatory, urgently recommended and future needs.
Degree of legal obligation – specify by requirement attribute.
How? To use the modal verbs; SHALL, SHOULD, WILL and/or MIGHT
Verbs Meaning SHALL
Shall Requirement has to be implemented
Should Requirement urgently/highly SHOULD
THE SYSTEM
recommended <system name>
Will Requirement is a future needs to be WILL
implemented
Might Requirement is optionally implemented MIGHTY
2. The 5. Determine logical
1. Determine the
legal obligation requirement 3. Characteristics the
activity of a system
4. Insert object and temporal
condition
core
Objective of this step is to define the functionality that is specifies.
This functionality referred to as the process.
Process – activities and may only describe by verbs.
They (process) must be defined as clearly as possible and be used
consistently as possible.
3.
1. Determine the 2. The requirement Characteristics 4. Insert object
5. Determine
logical and
legal obligation core
the activity of temporal condition

a system
For functional requirements, the system
activities can be classified as follows:
SHALL <process>
1. Autonomous system activity –
the system performs the process PROVIDE
autonomously. SHOULD <whom?>
THE SYSTEM WITH
2. User interaction – the system <system name> ABILITY TO
provides the process as a service for WILL <process>
user.
BE ABLE TO
3. Interface management – the MIGHTY <process>
system performs a process depending on
a third-party. The system is passive and
waits for an external event.
1. Determine the
2. The
requirement
3. Characteristics the 4. Insert 5. Determine logical
legal obligation
core
activity of a system
object and temporal condition

Objective: To identify a potentially missing objects and supplements of object


to be added into the requirements.
SHALL <process>

PROVIDE
<whom?> <additional details
SHOULD <object>
THE SYSTEM WITH about object>
<system name> ABILITY TO
WILL <process>

BE ABLE TO
MIGHTY <process>
5. Determine
1. Determine the legal
2. The
requirement
3. Characteristics
the activity of a 4. Insert logical and
obligation
core system
object
temporal
Quality requirements that describe the conditions under which a condition
requirement to fulfilled are added in the beginning of a
requirement as a subordinate clause
SHALL <process>

PROVIDE
<whom?> <additional details
SHOULD <object>
{<when? THE SYSTEM WITH about object>
Under what <system ABILITY TO
condition?>} name> WILL <process>

BE ABLE TO
MIGHTY <process>
EXERCISE 1
Based the scenario, write the ONE functional requirement using the given template.
Scenario
...... Based on current procedure, the customer can choose to book the wedding package (available date,
place and wedding type – such as Malay or Chinese or Indian or Modern custom). The customer can
request the suitable wedding package by keying in their range of budget. If they do not care about the
budget, they can choose any wedding package being offered. They also can add another service which is to
select their own menu. The customer can make online payment for the chosen package in their cart. They
can pay via debit card or credit card. They can edit the booking one month before the event date.

SHALL <process>

PROVIDE
<whom?> <additional details
SHOULD <object>
{<when? THE SYSTEM WITH about object>
Under what <system ABILITY TO
condition?>} name> WILL <process>

BE ABLE TO
MIGHTY <process>
Where we are?

1. SYNTACTIC REQUIREMENT
PATTERN
2. STRUCTURED ENGLISH
3. DECISION TABLES
WHAT IS STRUCTURED
ENGLISH?
1. Refers to a method of expressing and documenting the logic and flow of a computer
program or system in a structured and easily understandable manner.
2. It is a form of structured programming that uses a restricted set of English-like statements to
represent the various control structures and processes within a program or system.
3. Structured English typically consists of a combination of standard English language
constructs, control flow symbols, and indentation to represent the sequence of actions and
decisions within a program or system.
4. The primary goal of using Structured English in system analysis and design is to make the
system or program's logic clear and understandable to both the developers and other
stakeholders involved in the project
5. Often used in conjunction with other structured design methodologies, such as Structured
Systems Analysis and Design Methodology (SSADM) -- to bridge the gap between high-level
system requirements and low-level programming code,
WHEN TO USES?

Best used when sequence


Does not have strict
and loop in a program
syntax rule, It express all
must be considered and
logic in terms of
the problems needs
sequential decision
sequence of actions with
structures and iteration
decision
COMMON ELEMENTS OF
STRUCTURED ENGLISH
1. Sequence: Sequential steps in the program are represented as a series of statements,
executed one after another.
2. Selection: Conditional statements like "if-then-else" or "switch-case" are used to
represent decision points in the program.
3. Iteration: Loops, such as "for" and "while" loops, are used to represent repetitive
processes.
4. Subroutines: Procedures or functions are defined to break down the program into
modular components, making it more manageable and easier to understand.
5. Input and Output: Statements for input and output operations are used to interact with the
user or external data sources.
GUIDELINES TO WRITE
STRUCTURED ENGLISH
Use capitalize
Express all logic in
accepted keywords Indent blocks of
anyone of these
such as IF, THEN, statements to show
structures: sequential,
ELSE, DO, DO their hierarchy
decision, case or
WHILE, DO UNTIL, (nesting)
iteration
PERFORM
Underline those
Avoid confusion
words or pharases to
when distinguish
signify they have Careful when using
between ‘greater
specialized meaning “and” and “or”
then’ and “greater
(defined in data
than or equal to”
dictionary)
WRITING STRUCTURED
ENGLISH
File Names
 Separate words with hyphens(-)
 Use Title Case, e.g. Invoice-Record
Common verbs
 READ, ACCEPT, GET, WRITE, PRINT, SORT, MOVE, MERGE, ADD,
SUBTRACT, MULTIPLY, DIVIDE
Common nouns:
 Variable names, attributes, data flow inputs and outputs
Focus on how the process converts the inputs to outputs
EXAMPLES STRUCTURE
ENGLISH TYPES
Structure English Type Example
1. Sequential Structure Action #1
Action #2
A block of instruction in which no branching occurs Action #3
.
2. Decision Structure IF Condition A is TRUE
THEN implement Action A
Only IF condition is TRUE, complete the following statements, ELSE implement Action B
OTHERWISE, jump to the ELSE ENDIF

3. Case Structure IF Case#1 implement Action #1


ELSE IF Case #2; implement Action #2
A special type of decision structure in which the cases are mutually ELSE IF Case#3; implement Action #3
exclusive (if one occurs, the others cannot) ELSE print error
END IF
4. Iteration DO WHILE there are customers,
Action #1
Block of statement that are repeated until done. ENDDO
STRUCTURED ENGLISH VS
PSEUDOCODE
Pseudocode
Structured English

PROGRAM PrintNumber:
PROGRAM PrintNumber:
Read A;
Read in a number and
Print A;
print it out.
END.
END.
STRUCTURED ENGLISH VS
PSEUDOCODE
Structured English Pseudocode

PROGRAM BiggerOfTwo :
PROGRAM BiggerOfTwo:
Read A;
Read in a number.
Read B;
Read in a second number. IF (A>B)
If the first number is bigger, then print out that THEN Print A;
number, otherwise print out the other number.
ELSE Print B;
END. ENDIF;
END.
Process description: Our store has a membership program, but some
customers are not members. Members can rent as many items as they
want and, in fact, if they rent more than 8 items at a time they get a
discount. They usually pay 3.99 per item but if they rent more than 8
items then they only pay 3.49 per item. Customers who aren't members
always pay 4.49 per item. It doesn't matter how many items they rent.
Process: Membership Policy
Begin
If a customer is a member then
the rental cost per item is 3.99
If a customer is a member and rents more than 8 items then
the rental cost per item is 3.49.
If a customer is not a member then
the rental cost is 4.49 per item.
End
EXERCISE 2
We process all our claims in this manner. First, we determine whether the
claimant has ever sent in a claim before; if not, we set up a new record. The
claim totals for the year are then updated.
Next, we determine if a claimant has policy A or policy B, which differ in
deductibles and copayments (the percentage of the claim claimants pay
themselves). For both policies, we check to see if the deductible has been met
($100 for policy A and $50 for policy B).
If the deductible has not been met, we apply the claim to the deductible. Another
step adjusts for the copayment; we subtract the percentage the claimant pays
(40 percent for policy A and 60 percent for policy B) from the claim.
Then we issue a check if there is money coming to the claimant, print a
summary of the transaction, and update our accounts. We do this until all
claims for that day are processed.
DO WHILE there are claims remaining
IF claimant has not sent in a claim
THEN set up new claimant record
ELSE continue

SAMPL Add claim to YTD Claim


IF claimant has policy–plan A

E THEN IF deductible of $100.00 has not been met


THEN subtract deductible–not–met from claim

ANSWE
Update deductible
ELSE continue

R IN
ENDIF
Subtract copayment of 40% of claim from claim
ELSE IF claimant has policy–plan B.
STRUCT THEN IF deductible of $50.00 has not been met
THEN subtract deductible–not–met from claim
URE Update deductible
ELSE continue

ENGLIS ENDIF
Subtract copayment of 60% of claim from claim IF claim is greater than zero

H ELSE continue
ELSE write plan–error–message ENDIF
THEN print check

ENDIF Print summary for claimant


ENDIF Update accounts
ENDDO
Continue here
Where we are?

1. SYNTACTIC REQUIREMENT
PATTERN
2. STRUCTURED ENGLISH
3. DECISION TABLES
WHAT IS DECISION TABLE?
1. Is a diagram of process logic where the logic is reasonably complicated.
2. All the possible choices and the conditions the choices depend on are
represented in a tabular form.
DECISION TABLES
A tabular of conditions and actions and an indication under which conditions, which
actions must be performed
Consists of four quadrants
Condition Stub Rules

A list off possible Contain selectors


conditions that can which identify different
arise within the combination of
process possible conditions
Action Stub Action Entries

A list of all Indicator which


possible actions select the actions
that occur within to be perfomed
the process
PROCEDURE OF
CONSTRUCTING DECISION
TABLE

Name the
Name all
conditions and Define the
possible List all Simplify the
the values that action for each
actions that can possible rules decision table
each condition rules
occur
can assume
SAMPLE CASE STUDY
Consider the following case study for the decision table development.
This case study is concern on the generic Payroll System. There are two type of workers;
monthly salary and hourly salary. There are three categories of hour worked has assigned to
each worker: less than 40, exactly 40 and more than 40 hours per week. For any worker in the
monthly salary category will be paid as Pay Based Salary. On the other hands, for any worker
who are in category of hourly salary will be pay based on their hourly work as follows:
1. Working hours less than 40 hours per week will be paid based on calculate hourly wage and
the office will produce absence report.
2. Working hours exactly 40 hours per week will be calculate hourly wage only.
3. Working hours more than 40 hours per week will be paid based on hourly wage and the
extended values than 40 will be calculate for overtime payment.
Name the conditions
and the values that Name all possible
actions that can
List all possible Define the action Simplify the

each condition can


rules for each rules decision table
occur

assume
Conditions/ Rules
1. Determine all of the Payroll Courses of
conditions that are Action 1 2 3 4 5 6
Policy
relevant to the problem.
Condition Stubs
2. Determine all of the Employee Type
values each condition Hours Worked
can take
Name the conditions
Name all Define the
and the values that
each condition can
assume
possible actions List all possible
rules
action for each
rules
Simplify the
decision table

that can occur


Conditions/ Courses of Rules
Payroll Action
1. Identify all 1 2 3 4 5 6
course of action Policy
Condition
given by a Stubs Employee Type
particular set of Hours Worked
conditions.

Pay base salary

Action Stubs Calculate hourly wage


Name the conditions and Name all possible
List all
Define the action Simplify the
the values that each
condition can assume
actions that can
occur
possible for each rules decision table
rules
1. Create exhaustive set of Conditions/ Courses Rules
rules.
Payroll of Action
Policy 1 2 3 4 5 6
2. Every possible
combinations must be Condition
Stubs Employee Type S H S H S H
represented.
3. Some rules may redundant Hours Worked <40 <40 40 40 >40 >40
or make no sense; should be
remove after have list.
4. Number of rules = (Con1*
numOfRules1) * (Con2*
numOf Rules2) * ConN* Pay base salary
numOfRulesN).
Action Calculate hourly
Stubs wage
Name the conditions and Name all possible List all
Define the
Simplify the
the values that each
condition can assume
actions that can
occur
possible
rules
action for decision table
each rules
1. Create exhaustive set of Payroll Conditions/ Courses Rules
rules. of Action
Policy 1 2 3 4 5 6
2. Every possible
combinations must be Condition
Stubs Employee Type S H S H S H
represented.
3. Some rules may redundant Hours Worked <40 <40 40 40 >40 >40
or make no sense; should be
remove after have list.
4. Number of rules = (Con1*
numOfRules1) + (Con2*
numOf Rules2) + ConN* Pay base salary X X X
numOfRulesN).
Action Calculate hourly X X X
Stubs wage
Name the conditions and Name all possible List all Define the
Simplify
the values that each
condition can assume
actions that can
occur
possible
rules
action for
each rules
the decision
table
1. Make decision table Payroll Conditions/ Courses Rules
as simple as possible by of Action
Policy 1 2 3 4 5 6
removing any rules with
impossible or redundant Condition
Stubs Employee Type S H S H S H
actions.
Hours Worked <40 <40 40 40 >40 >40
2. Consult user on the
rules where system
actions aren’t clear and
either decide on an
action or remove the Pay base salary X X X
rules. Calculate hourly X X X
Action
Stubs wage
Name the conditions and Name all possible List all Define the
Simplify
the values that each
condition can assume
actions that can
occur
possible
rules
action for
each rules
the decision
table
Final version of Payroll Conditions/ Courses of Rules
Action
decision table with Policy 1 2 3 4
simplification number Condition
of rules. Stubs Employee Type S H H H
Hours Worked - <40 40 >40

Pay base salary X

Action Stubs Calculate hourly wage X X X


Calculate overtime X
EXERCISE 3
An airline offers only flights to India and Asia. Under special conditions, a discount is
offered on the normal airfare:
a) Passengers older than 18 with destinations in India are offered a discount of 20%, as
long as the departure is not on a Monday or Friday.
b) For destinations outside of India, passengers are offered a discount of 25%, if the
departure is not on a Monday or Friday.
c) Passengers who stay at least 6 days at their destination receive an additional discount
of 10%.
d) Passengers older than 2 but younger than 18 years are offered a discount of 40% for
all destinations.
e) Children 2 and under travel for free.
Conditions:
Destination (India, Asia)
Passenger Age (<= 2, > 2 & < 18, > 18)
Depart on Monday or Friday (Yes, No)
Stay 6 days or more (Yes, No)
Actions:
Travel Free
0% discount
10% discount
20% discount
40% discount
Number of rules: 2 values * 3 values * 2 values * 2 values = 24 rules
Exercise
ABS Courier Sdn. Bhd. has just announced that it will offer free shipping
for all orders over RM250.00 in the future. Shipping charges for all orders will be prorated.
Develop a decision table; consider all the conditions and actions to get the rules.
For order less than RM250.00, For order over RM250.00,
the shipping charge will be calculated as follows: the shipping charge will be calculated as follows:
If the number of items is 3 or less: If the number of items is 3 or less:
Delivery Day Shipping Charge Delivery Day Shipping Charge
Next Day RM35.00 Next Day RM25.00
2nd Day RM15.00 2nd Day RM10.00
Standard RM10.00 Standard N * RM1.50

If the number of items is 4 or more: If the number of items is 4 or more:


Delivery Day Shipping Charge, Delivery Day Shipping Charge,
N = number of items N = number of items
Next Day N * RM7.50 Next Day N * RM6.00
2nd Day N * RM3.50 2nd Day N * RM2.50
Standard N * RM2.50 Standard FREE

You might also like