CAS 703 SoftwareDesign
Dr. R. Khedri
CAS 703 Software Design
Dr. Ridha Khedri
Department of Computing and Software, McMaster UniversityCanada L8S 4L7, Hamilton, Ontario
Dr. R. Khedri CAS 703 Software Design
CAS 703 SoftwareDesign
Dr. R. Khedri
Dr. R. Khedri CAS 703 Software Design
CAS 703 SoftwareDesign
Dr. R. Khedri
Introduction to Software DesignåOverview
During the last half century, the world witnessedgrowth in the scale, complexity, and space distributionof software systems
When a system is complex in its functionality, itsaspects (qualities), and its environment, an obviousneed to reduce that complexity emerges
A top-down strategy in software construction to divideand conquer the complexities faced by the constructors
Roughly speaking, the decomposition of asystem/artifact into “manageable” parts is one of aimsof design
Dr. R. Khedri CAS 703 Software Design
CAS 703 SoftwareDesign
Dr. R. Khedri
Introduction to Software DesignåSoftware Requirements
The requirements specification serves as a startingpoint for the next phase (design)
In the design phase, the architecture of the system isdevised
Requirements analysis and design generally cannot bestrictly separated in time
the requirements specification is very formal and canbe viewed as a high-level design specification of thesystem to be built
Often, a preliminary design is done after an initial setof requirements has been determined
Dr. R. Khedri CAS 703 Software Design
CAS 703 SoftwareDesign
Dr. R. Khedri
Introduction to Software DesignåFunctional Requirements
We look at those requirements that are there becauseof the product’s fundamental reason for existence
The functional requirements specify what the productmust do
They relate to the actions that the product must carryout in order to satisfy the fundamental reasons for itsexistence
The product shall determine which road sections pass through
areas that are predicted to freeze.
It describes an action that the product must take if it isto carry out the work for which it is intended.
Dr. R. Khedri CAS 703 Software Design
CAS 703 SoftwareDesign
Dr. R. Khedri
Introduction to Software DesignåFunctional Requirements
Functional requirements are:
Specifications of the product’s functionality;
Actions the product must take - check, calculate,record, retrieve;
Derived from the fundamental purpose of the product;
Not a quality - for example, ’fast’ is a quality, andtherefore it is a non-functional requirement.
Think of the functional requirements as the businessrequirements
Dr. R. Khedri CAS 703 Software Design
CAS 703 SoftwareDesign
Dr. R. Khedri
Introduction to Software DesignåFunctional Requirements
The functional requirements are a specification of thereal work, or business,
:::::::::::independent of the way that
work will be carried out
The functional requirements must fully describe theactions that the intended product can perform
So a requirement for the requirements is that theproduct’s builder be able to use them to construct theproduct desired by your client.
At their discovery stage they are not necessarilyrigorous nor complete
The writing activity formalises each requirement
Dr. R. Khedri CAS 703 Software Design
CAS 703 SoftwareDesign
Dr. R. Khedri
Introduction to Software DesignåFunctional Requirements
The product shall show the weather for the next twenty-four
hours.
The product shall show all roads predicted to freeze.
Anything has the potential to be ambiguous
Continually minimise that risk by clarifying the context
Shut off the pumps if the water level is above 100 meters for 4
seconds
Dr. R. Khedri CAS 703 Software Design
CAS 703 SoftwareDesign
Dr. R. Khedri
Introduction to Software DesignåFunctional Requirements
Shut off the pumps if the water level is above 100 meters for 4
seconds.
There are several reasonable interpretations
1 “Shut off the pumps if the:::::mean water level over the
past 4 seconds was above 100 meters”.[( ∫ TT−4WL(t)dt
)÷ 4 > 100
]2 “Shut off the pumps if the
:::::::median water level over the
past 4 seconds was above 100 meters”.
(Max[t−4,t](WL(t)) + Min[t−4,t](WL(t)))÷ 2 > 100
3 “Shut off the pumps if the:::::::::minimum water level over
the past 4 seconds was above 100 meters”.
Min[t−4,t](WL(t)) > 100. . . . . . . . .Dr. R. Khedri CAS 703 Software Design
CAS 703 SoftwareDesign
Dr. R. Khedri
Introduction to Software DesignåNon-functional Requirements
Look and Feel Requirements
The product shall have the same layout as the district maps that
the engineering department uses now.
Usability Requirements
Ease of use
The product shall be easy for 11-year-old children to use.
Ease of learning
The product shall be easy for an engineer to learn.
Dr. R. Khedri CAS 703 Software Design
CAS 703 SoftwareDesign
Dr. R. Khedri
Introduction to Software DesignåNon-functional Requirements
Performance RequirementsSpeed requirements
Any interface between a user and the automated product musthave a maximum response time of two seconds.
Safety critical requirements
The product shall not emit noxious gases.
Precision requirements
All monetary amounts must be accurate to two decimal places.
Reliability and availability requirements
The product shall be available for use 24 hours per day, 365 daysper year.
Dr. R. Khedri CAS 703 Software Design
CAS 703 SoftwareDesign
Dr. R. Khedri
Introduction to Software DesignåNon-functional Requirements
Performance Requirements (Continued ...)Capacity requirements
The product must be able to cater for 300 simultaneous userswithin the period from 9:00 a.m. to 11:00 a.m. Maximum loadingat other periods will be 150.
Operational RequirementsExpected physical environment
The product is to be used by a worker, standing up, outside incold, rainy conditions.
Expected technological environmentPartner applications
We must be able to interface with any HTML (Hyper-TextMark-up Language) browser.
Dr. R. Khedri CAS 703 Software Design
CAS 703 SoftwareDesign
Dr. R. Khedri
Introduction to Software DesignåNon-functional Requirements
Maintainability and Portability Requirements
How easy must it be to maintain this product?
New MIS (Management Information System) reports must beavailable within one working week of the date the requirementsare agreed.
Are there special conditions that apply to themaintenance of this product?
The maintenance releases will be offered to end-users once a year.
Portability requirements
The product is expected to run under Windows 95 and UNIX.
Dr. R. Khedri CAS 703 Software Design
CAS 703 SoftwareDesign
Dr. R. Khedri
Introduction to Software DesignåNon-functional Requirements
Security Requirements
Is the product confidential?
Only direct managers can see the personnel records of their staff.
File integrity requirementsAudit requirements + Prevention, detection andrecovery policies
Cultural and Political Requirements
Are there any special factors about the product thatwould make it unacceptable for some political reason?
The product shall not use icons that could be considered offencive
in any of our market countries.
Dr. R. Khedri CAS 703 Software Design
CAS 703 SoftwareDesign
Dr. R. Khedri
Introduction to Software DesignåNon-functional Requirements
Legal RequirementsDoes the product fall under the jurisdiction of any law?
Personal information must be implemented so as to comply withthe Data Protection Act.
Are there any standards with which we must comply?
The product must comply with the appropriate MilSpec (MilitarySpecification) standards.
Open IssuesIssues that have been raised and do not yet have aconclusion
Our investigation into whether or not the new version of theprocessor will be suitable for our application is not yet complete.
Dr. R. Khedri CAS 703 Software Design
CAS 703 SoftwareDesign
Dr. R. Khedri
Introduction to Software DesignåNon-functional Requirements
Off-the-Shelf Solutions
Is there a ready-made product that could be bought?
Can ready-made components be used for this product?
Is there something that we could copy?
Another electricity company has built a customer service system.
Their hardware is different from ours but we could buy their
specification and cut our analysis effort by approximately 60%.
Dr. R. Khedri CAS 703 Software Design
CAS 703 SoftwareDesign
Dr. R. Khedri
Introduction to Software DesignåNon-functional Requirements
New Problems
What problems could the new product cause in thecurrent environment?
Any change to the scheduling system will affect the work of theengineers in the divisions and the truck drivers.
Will any of our existing users be adversely affected bythe new development?What limitations exist in the anticipatedimplementation environment that may inhibit the newproduct?
The planned new server is not powerful enough to cope with ourprojected growth pattern.
Will the new product create other problems?
Dr. R. Khedri CAS 703 Software Design
CAS 703 SoftwareDesign
Dr. R. Khedri
Introduction to Software DesignåProcess Requirements
Tasks
What steps have to be taken to deliver the product?Development phases
Cutover
What special requirements do we have to get theexisting data, and procedures to work for the newproduct?What data has to be modified/translated for the newproduct?
Risks
What risks do you face when you develop this product?What contingency plans are you making?
Dr. R. Khedri CAS 703 Software Design
CAS 703 SoftwareDesign
Dr. R. Khedri
Introduction to Software DesignåProcess Requirements
Costs
User Documentation
The plan for building the user documentation
Waiting Room
requirements that will not be part of the agreed product
These requirements might be included in futureversions of the product
Dr. R. Khedri CAS 703 Software Design
CAS 703 SoftwareDesign
Dr. R. Khedri
Introduction to Software DesignåWhat is Design?
What is Design?
One cannot define design as would define amathematical activity such as “rewriting“,“derivation”, etc.
The nature of design is not easy to grasp in a cleardefinition
Looking for a definition of design may not help yougrasp what it is
Design can be seen in any human artefact and in nature
The single word “design” encompasses an awful lot ofobjectives and subjective aspects
Dr. R. Khedri CAS 703 Software Design
CAS 703 SoftwareDesign
Dr. R. Khedri
Introduction to Software DesignåWhat is Design?
They can be
aesthetic (subjective)
functional (Objective)
many other aspects of an object or a process (Objectiveor subjective), which usually requires considerable
research,thought,modeling,interactive adjustment,and re-design
Dr. R. Khedri CAS 703 Software Design
CAS 703 SoftwareDesign
Dr. R. Khedri
Introduction to Software DesignåWhat is Design?
Depending on the designed entity, either the objectiveor the subjective aspects might takeover
When the subjective aspects take over, design is thenviewed as a more rigorous form of art, or art with aclearly defined purpose
When the objective aspects take over, design is thenviewed as a simple mathematical transformation of themathematical entities expressing the functionalrequirements into a design which is a collection ofmathematical entities with their mathematicalconnectorsSo, design involves both mathematics and art astransformation means (and may be other skills?!!!)
Dr. R. Khedri CAS 703 Software Design
CAS 703 SoftwareDesign
Dr. R. Khedri
Introduction to Software DesignåWhat is Design?
Example
Design as a mathematical activity Construction of adeterministic finite automaton (DFA) that accepts all binarystrings with an even number of 0’s and the number of 1’s isa multiple of 3.Design Process: Let L(M3) be the language that containsonly all binary strings with an even number of 0’s and thenumber of 1’s is a multiple of 3.
L(M3)
= 〈 From the textual description of the languagesas given by the question. 〉
{x | x ∈ {0, 1}∗ ∧ x contains even number of 0’s
∧ x contains a number of 1’s that is multiple of 3}= 〈 Definition of set intersection 〉{x | x ∈ {0, 1}∗ ∧ x contains even number of 0’s}∩ {x | x ∈ {0, 1}∗ ∧ x ∧ contains a number of 1’s that is multiple of 3}
Dr. R. Khedri CAS 703 Software Design
CAS 703 SoftwareDesign
Dr. R. Khedri
Introduction to Software DesignåWhat is Design?
Example
From the above derivation, we can notice that L(M3) is theintersection of two languages:
1 L(M1) = {x | x ∈ {0, 1}∗ ∧x contains even number of 0’s}
2 L(M2) = {x | x ∈ {0, 1}∗ ∧ x ∧contains a number of 1’s that is multiple of 3}
L(M1) and L(M2) are regular since they are accepted by themachine M1 and M2, respectively.Since L(M3) = L(M1) ∩ L(M2), then M3 can be obtainedfrom M1 and M2 using the product construction.
Dr. R. Khedri CAS 703 Software Design
CAS 703 SoftwareDesign
Dr. R. Khedri
Introduction to Software DesignåWhat is Design?
Example
Continued ...Product construction:
1 Q3 = {α, β} × {a, b, c} ={(α, a), (α, b), (α, c), (β, a), (β, b), (β, c)}
2 Σ = {0, 1}3 s3 = (s1, s2) = (α, a)
4 F3 = F1 × F2 = {α} × {a} = {(α, a)}5 δ3 is given by the following table.
0 1
(α, a) (β, a) (α, b)
(α, b) (β, b) (α, c)
(α, c) (β, c) (α, a)
(β, a) (α, a) (β, b)
(β, b) (α, b) (β, c)
(β, c) (α, c) (β, a)
Dr. R. Khedri CAS 703 Software Design
CAS 703 SoftwareDesign
Dr. R. Khedri
Introduction to Software DesignåWhat is Design?
Example
Continued ...The graphical representation of M3.
1
( , a)α
( , b)
( , c)
( , b)
( , c)
α
α β
( , a)β
01
0
β
1
01
0
1
0
1
0
Figure: Machine M3 (The product of M1 and M2)
Dr. R. Khedri CAS 703 Software Design
CAS 703 SoftwareDesign
Dr. R. Khedri
Introduction to Software DesignåWhat is Design?
Example
Design as an artistic activity
Figure: Game Interface
Dr. R. Khedri CAS 703 Software Design
CAS 703 SoftwareDesign
Dr. R. Khedri
Introduction to Software DesignåWhat is Design?
Example
Design as an artistic activity (Continued...)
Figure: Game Interface
Dr. R. Khedri CAS 703 Software Design
CAS 703 SoftwareDesign
Dr. R. Khedri
Introduction to Software DesignåWhat is Design?
In the literature, you find some unsuccessful attempts todefine the term design:
In some literature, you find that design is “makingthings better for people”
But, for instance, we all could say that we too “makethings better for people”!!!!!!!
“Design is that area of human experience, skill andknowledge which is concerned with man’s ability tomould his environment to suit his material and spiritualneeds.”[Archer, B (1973) The Need for Design Education.Royal College of Art]
Dr. R. Khedri CAS 703 Software Design
CAS 703 SoftwareDesign
Dr. R. Khedri
Introduction to Software DesignåWhat is Design?
Design could be viewed as an activity that translates anidea/goal/wish into a blueprint for an artefact or aprocess that is fit for its environment
We will focus on examples of design that would giveeach one of us his/her own understanding of design(which enhances creativity)
We however agree that the obtained artefact or processis suitable for (fit for use in) the intended environment
Dr. R. Khedri CAS 703 Software Design
CAS 703 SoftwareDesign
Dr. R. Khedri
Introduction to Software DesignåWhat is Design?
What is in design more than the translation of an idea to anartefact or process?
Design can be seen as an activity of reconciliationbetween conflicting needs or constraints put by theenvironment
Design is a creative process based around the ”buildingup” of ideas
Avoiding negative judgments of contributors whendesigning eliminates the fear of failure and encouragesmaximum input and participation
Encourage outside the box thinking in this processsince this can often lead to creative solutions
Dr. R. Khedri CAS 703 Software Design
CAS 703 SoftwareDesign
Dr. R. Khedri
Introduction to Software DesignåWhat is Design?
Although design is subject to personal taste, designthinkers share a common set of values that driveinnovation
These values are mainly creativity, fertile imagination,“whole brain thinking”, teamwork, end-user focus,curiosity
The design thinking process should evolve through thefollowing stages: define, research, ideate, prototype,choose, implement, and learn
Dr. R. Khedri CAS 703 Software Design
CAS 703 SoftwareDesign
Dr. R. Khedri
Introduction to Software DesignåWhat is Design?
A bad software design may result in
a poor quality software product which does not meetuser requirement,
A system that is not adaptive to any furtherrequirement changes
A system that is not reusable
A system that has unpredictable behavior
A system that has poor performance
Software production itself may be very ineffective interms of time and cost
Dr. R. Khedri CAS 703 Software Design
CAS 703 SoftwareDesign
Dr. R. Khedri
Introduction to Software DesignåWhat is Design?
A good software design
Reduces risks in software production
Coordinates development teams to work togetherorderly
Makes the system traceable for implementation andtesting
Allows the software product to have better overallsystem-qualities (quality attributes)
Dr. R. Khedri CAS 703 Software Design
CAS 703 SoftwareDesign
Dr. R. Khedri
Introduction to Software DesignåWhere does software design sit in SDLC?
Software Development Life Cycle (SDLC)
8. System Testing
5. Coding
4. Detailed Design
9. Production Operation & Maintenance
6. Unit Testing
7. Integration & Testing
Cost
2. Product Requirements Spec.
3. Architecture Design
1. Pre−requirements
Figure: Software Process V-model
Dr. R. Khedri CAS 703 Software Design
CAS 703 SoftwareDesign
Dr. R. Khedri
Introduction to Software DesignåWhat is meant by Software Architecture?
Software architecture can be seen as a blueprintguideline for developing a large and complex softwaresystem based on the software requirement analysisspecification
The architecture highlights early design decisions thathave a decisive impact on the ultimate success ofsoftware products
Must be included in a high level design called ”softwarearchitecture”
The specializations of software elementsConnection typesSet of constraints (space, time, budget, etc.) on howthey can be plannedSet of desired quality attributes (such as performance)
Dr. R. Khedri CAS 703 Software Design
CAS 703 SoftwareDesign
Dr. R. Khedri
Introduction to Software DesignåWhat is meant by Software Architecture?
However, the proposed architecture can addresspartially or totally some of the desired quality attributes
Families of architectures that have “similar” choices onelement types and connections are very often calledarchitecture style
Each architecture style represents
The way the elements are arrangedThe connections and interactions among the elementsThe control transfer among the elements in the systemThe semantic constraints and behaviors concerningdata transfer of the architecture styleThe quality attributes trade-off
Dr. R. Khedri CAS 703 Software Design
CAS 703 SoftwareDesign
Dr. R. Khedri
Introduction to Software DesignåWhat is meant by Software Architecture?
A partial list of quality attributes: performance,reliability, portability, usability, security, maintainability,adaptability, usability, etc.
Quality attributes are closely related to architecturestyles
Each architecture style contributes some qualityfeatures
An architecture style represents tradeoffs among manyconflicting quality attributes
Dr. R. Khedri CAS 703 Software Design
CAS 703 SoftwareDesign
Dr. R. Khedri
Introduction to Software DesignåWhat is meant by Software Architecture?
BA A controls B
Sub−system
Component/Element
Connector
Figure: Rough representation of a software system architecture
Dr. R. Khedri CAS 703 Software Design
CAS 703 SoftwareDesign
Dr. R. Khedri
Introduction to Software DesignåWhat is meant by Software Architecture?
IEEE Std 1471 defines the system architecture as ”thefundamental organization of a system embodied in itscomponents, their relationships to each other, and tothe environment, and the principle guiding its designand evolution”
The basis of a software architecture design is thesoftware requirement specification document
The requirement process covers information domainmodeling, data modeling, function modeling,behavioral modeling, and user interface modeling
Software requirements has two aspects (functional,non-functional)
Dr. R. Khedri CAS 703 Software Design
CAS 703 SoftwareDesign
Dr. R. Khedri
Introduction to Software DesignåWhat is meant by Software Architecture?
Role of the software architect
System static partitioning and decomposition intosub-systems and communications between sub-systems
Establishing dynamic control relationships betweendifferent sub-systems in data flow controlling, orcontrol flow orchestration, or message dispatching
Considering and evaluating all alternative architecturestyles for the problem domain
Analysis of the trade-off on quality attributes duringthe selection of architecture styles
Dr. R. Khedri CAS 703 Software Design
CAS 703 SoftwareDesign
Dr. R. Khedri
Introduction to Software DesignåWhat is meant by Software Architecture?
Map a requirement specification to the softwarearchitecture and guarantee that the softwarearchitecture satisfies all functional and non-functionalrequirements
There are many kind of traceabilities
The architect does backward traceability
Might get involved in the forward traceability
If the requirements cannot be practically materialized,system analysts and software architects can go back tostakeholders in order to amend the requirements
Dr. R. Khedri CAS 703 Software Design
CAS 703 SoftwareDesign
Dr. R. Khedri
Dr. R. Khedri CAS 703 Software Design