Professional Documents
Culture Documents
DESIGN PHASE
Basic Design sub-Phases
Data design.
Architectural design.
Interface design.
Procedural design.
Procedural
design
Interface
design
Architectural
design
Data
design
Here the abstract data objects are presented with a set of legal
operations but the actual representation and implementation details are
hidden.
The externally visible functions are provided with the abstract data
objects so that the values of the data object can be modified.
Modularity helps in
- system debugging—isolating the system problem
to a component is easier if the system is modular
Coupling
Cohesion
Coupling
Logical cohesion
Logical cohesion is when parts of a module are grouped
because they logically are categorised to do the same
thing, even if they are different by nature.
(e.g. grouping all I/O handling routines).
Communicational cohesion
Communicational cohesion is when parts of a module are
grouped because they operate on the same data
(e.g. a module which operates on the same record of
information).
Sequential cohesion
Sequential cohesion is when parts of a module are grouped
because the output from one part is the input to another part.
(e.g. a function which reads data from a file and processes the
data).
Temporal cohesion
Temporal cohesion is when parts of a module are grouped by when they are
processed - the parts are processed at a particular time in program
execution
(e.g. a function which is called after catching an exception which closes
open files, creates an error log, and notifies the user).
Procedural cohesion
Procedural cohesion is when parts of a module are grouped because they
always follow a certain sequence of execution (e.g. a function which
checks file permissions and then opens the file).
Functional cohesion (best)
Functional cohesion is when parts of a module are
grouped because they all contribute to a single well-
defined task of the module
(e.g. calculating the sine of an angle).
Informational cohesion
It occurs when a module contains a complex data
structure and functions to manipulate it. All the
functions in this module will show functional binding.
Information cohesion is the concrete realization of
abstraction.
Cohesion
The different degree of cohesion in order
High Cohesion
Functional
Sequential
Communication
Procedural
Temporal
Logical
Low Cohesion Coincidental
Functional cohesion is the strongest cohesion.
2. If the sentence contains words relating to time, like "first," "next,“ "when,"
and "after" the module probably has sequential or temporal cohesion.
3. If the predicate of the sentence does not contain a single specific object
following the verb (such as "edit all data") the module probably has
logical cohesion.
Basic Constructs:
Processes
Data flows
Files
Structured English
Decision Tables and Decision Trees
Structured English
A rigid subset of the English language
omitting adjectives, adverbs, compound and
complex sentences, all verb modes except
imperative and most punctuation
Result: A language containing a limited set of
conditional and logic statements with nouns and
strong verbs
Standards vary between organisations -
objectives of: conciseness, preciseness and
lack of ambiguity apply to all variants
Structured English (cont.)
Posesses the three standard control constructs of:
sequence
selection
iteration
and
primitive actions
Credit Satisfactory Y N N N
Prompt Payer - Y N N
Special Clearance - - Y N
Accept Order X X X
Return Order X
Mixed Entry Decision Table
Contains only the binary selectors Y & N and the catch all selector -
in the rules quadrant. In the action entries quadrant, indicators other
than X appear.
1 2 3
Salaried Employee N N Y
Hours Worked > 40 Y N -
1 2 3 4
Approved Credit N Y Y Y
Quantity Ordered - 0-24 25-55 56-99
Discount (%) 0 5 10
Release Order X X X
Reject Order
Validating Decision Tables
Limited and Mixed Decision Entry
Tables can be checked for
completeness, according to the
following algorithm:
i=j
2 number of conditions = Σ 2i c i
i=1
Advantages of Decision Tables
Easily understood
Dog
Scooby-Doo
A little Quiz (cont’d)…
#2 Class or Object?
Dog
Scooby-Doo
Animal
Bird Dog
Car is a Vehicle –
Inheritance
Car has a set of Tires –
Aggregation
Dependency
Dependency occurs when a class uses
another class’ methods
This is a Uses relationship
Example: an application may depend on the
Scanner class to read input
Attributes
Class Diagram
accountBalance
deposit( )
withdraw( )
Add as many (or as few) details as appropriate for the current iteration
and incrementation
Class Diagrams: Notation
Freedom of notation extends to objects
Example:
bank account : Bank Account Class
bank account is an object, an instance of a class Bank Account Class
The underlining denotes an object
The colon denotes “an instance of”
The bold face and initial upper case letters in Bank Account Class
denote that this is a class
UML allows a shorter notation when there is no ambiguity
bank account
The UML notation for modeling the concept of an arbitrary bank
account is
: Bank Account Class
The colon means “an instance of,” so
: Bank Account Class
means “an instance of class Bank Account Class”
Class Diagrams: Visibility Prefixes
(contd)
UML visibility prefixes (used for information hiding)
Prefix + indicates that an attribute or operation is public
Visible everywhere
Figure 16.13
16.6 Interaction Diagrams
Interaction diagrams show how objects interact with one
another
Figure 16.14
Sequence Diagrams
A message is optionally followed by a message sent back to the object
that sent the original message
Even if there is a reply, it is not necessary that a specific new message
be sent back
Instead, a dashed line ending in an open arrow indicates a return
from the original message, as opposed to a new message
Figure 16.14
Sequence Diagrams
Iteration an indeterminate number of times is modeled by an asterisk
(Kleene star)
Example: Elevator *move up one floor
The message means: “move up zero or more floors”
Figure 16.16
Statechart
Ansevent also causes transitions
between states
Example: The receipt of a message
As part of a transition
Action
Technical difference:
An activity can take several seconds
An action takes places essentially instantaneously
A statechart shows
States (specific values of attributes of objects),
Events that cause transitions between states (subject to guards),
and
Actions taken by objects
An interaction diagram (sequence diagram or collaboration diagram)
shows how objects interact as messages are passed between them
16.13 UML and Iteration
Every UML diagram consists of a small required part plus
any number of options
Not every feature of UML is applicable to every information
system
1) individual components,
2)for integrating the components
3) for full business scenarios...
Milestone
Inspection
Walkthrough
Milestones
Verification:
"Are we building the product right”.
The software should conform to its specification (i.e., fault-
free. In reality, as fault-free as possible).
Examples of verifications: Unit testing, integrating testing,
and formal verification
Validation (or Valuation):
"Are we building the right product”.
The software should do what the user really requires (i.e.,
user satisfactory).
Examples of validation: Prototyping, acceptance testing
Verification and Testing
Background:
The initial idea was proposed by Gerry Weinberg in 1970s
(in his book “The Psychology of Computer Programming”)
We often cannot see errors and deficiencies in our own
work, since do so would be to find a fault in ourselves, and
this, apparently, is unacceptable to us
To overcome this weakness as human being, all work
should be checked by someone else.
Structured walkthroughs and inspections are two
techniques to do such a check.
Structured Walkthroughs - Introduction
Scheduling Walkthroughs:
Structured walkthroughs should be conducted during all stages
of the system lifecycle
Walkthroughs should be conducted frequently
Focuses on a specific and small piece of work
Increases the likelihood of uncovering errors
Before author has too great an ego investment
Scheduled only when the creator or author is ready
About 4 or 5 people
Advanced preparation (e.g., no more than 2 hours) should be
required of and performed by each reviewer
Structured Walkthroughs - Procedure
Recorder’s recordkeeping
Review issues list:
Identify problem areas within the product
Action Item checklist for corrections to be made
Review summary report
What was reviewed?
Who reviewed it?
What were the findings and conclusions?
Structured Walkthroughs - Procedure
Variable check
Are all variables properly defined and given
1. Planning
2. Overview
3. Individual preparation
4. Inspection meeting
5. Rework
6. Follow-up
Inspections - Procedure
Software Software
Walkthroughs Inspections
Participants Peer(s) led by Peers in designated roles
author
Rigor Informal to formal Formal