Lecture 01
Introduction
Software Design &
Architecture
Textbooks
• Some textbooks may be helpful :
• Recommended Text Book:
1. Software architecture in practice by Len Bass, Paul Clements, Rick
Kazman, 3rd
Edition
2. Applying UML and Patterns, An Introduction to Object-Oriented
Analysis and Design and Unified Proces by Craig Larman, 3rd
Edition
2
3. Design Patterns -- Elements of Reusable Object-Oriented by Erich
Gamma, Richard Helm, Ralph Johnson and John Vlissides, 1st
Edition
Course
Outcomes
At the end of the course, the student should be able to:
• How to apply a wide variety of design patterns, frameworks,
and architectures in designing a wide variety of software.
• Design and implement software using several
different middleware technologies.
• Use sound quality metrics as objectives for designs, and then
measure and assess designs to ensure the objectives have been
met.
• Modify designs using sound change control approaches
3
Software
Process
• Review Software Process
• SDLC Phases
4
Main Phases of Software
Process
• Requirements Analysis (answers
“WHAT?”) Specifying what the application must do
• Design (answers “HOW?”)
• Specifying what the parts will be, and how they
will fit together
• Implementation (A.K.A.
“CODING”) Writing the code
• Testing (type of VERIFICATION)
• Executing the application with test data
for input
• Maintenance (REPAIR or
ENHANCEMENT) Repairing defects and adding
capability
5
SDLC Phase 1: Requirement Analysis
• The process of understanding what’s needed or wanted,
and expressing the results in writing
• Key Challenges of Requirement analysis ???
6
SDLC Phase 2: Design
• The design of an application expresses how the application
is to be constructed.
• It describes the parts involved and how they are to
assembled.
• It consists of a set of documents (diagrams and text)
7
SDLC Phase 3: Implementation
• In the form of coding
• Code only against a design
• Before compiling, satisfy yourself that the code you
have typed is correct. Read it thoroughly.
– ‘correct’ means that is satisfies what’s required of it
– This is “author-inspection” (What is it???)
Author Inspection:
Inspect and edit the block of code you have just written until you are
convinced it does exactly what it is meant to do. Only then compile it.
8
SDLC Phase 3: Implementation (Cont...)
• Build-a-little-Test-a-little (Rule)
– Add a relatively small amount of code (“build-a-little”)
– (Again): Read what you have typed and correct it if necessary until
you are totally satisfied it’s correct
– Compile
– Test the new functionality (“test-a-little”)
9
SDLC Phase 4: Testing
• The testing phase consists of supplying input to the application
and comparing the output with that mandated by the software
requirements specification.
• Helps to uncover defects
• Proves the presence of defects, but never their absence
• Types of Testing: Black-Box Testing, White-Box Testing
10
SDLC Phase 4: Testing (Cont...)
Tips on Testing
• Test early and often
• Test with extreme values
– Very small, very big, etc.
– Borderline
– “Illegal” values
• Vary test cases
– Don’t repeat tests with same test data except
when specifically intended
11
SDLC Phase 5: Maintenance
• Maintenance refers to the work performed on the application
that occurs after it has been delivered.
• Types of maintenance
1. Corrective (Defect Removal)
Finding and fixing all inconsistencies with the requirements document
2. Perfective (Enhancement)
Introducing new or improved capability
3. Adaptive
Adapts software to new environment
4. Preventive
Changing some aspect of the system to prevent failures
12
Software Process Phases
Example
• Personal Finance Example:
1. Requirements Analysis: Diagrams and text
– e.g., “ … The application shall display the balance in the user’s bank
account. …”
2. Design: Diagrams and text
– e.g., “ … The design will consist of the classes CheckingAccount,
SavingsAccount, …”
3. Implementation: Source code
– e.g., … class CheckingAccount{ double balance; … } …
13
Software Process Phases
Example
(
Cont
)...
•
Personal Finance Example (Cont...)
:
.4
Testing: Test cases and test results
–
e.g., “… With test case: the balance was $2938.22, which is correct
.
”…
.5
Maintenance: Modified design, code, and text
–
e.g.,
Defect
repair:
“Application
crashes
when
balance
is
$0
and attempt is made to withdraw funds
.
”…
–
e.g., Enhancement: “Allow operation with
”.£
14
The Waterfall Software Process
Basic software process in which requirements , design,
implementation, testing/verification and maintenance are
performed in sequence
.
15
The Spiral
Process
16
Summary: Software Process
• A way of going about the creation and upkeep of a
software product.
• Commonly based on the Waterfall process
1. Specify requirements
2. Create design
3. Write code
4. Test
5. Maintain
In sequence with some overlap
17
Software Design
• Software Design
What is Design?
Why Design is so important?
 Levels of Design
 The Design Process
 Challenges in Design
18
What is
Design
?
• Design
is
the creation of a plan or convention for the
construction of an object or a system.
19
What is Design?
(Cont...)
• Another definition for design is a roadmap or a strategic
approach for someone to achieve a unique expectation. It
defines the specifications, plans, parameters, costs, activities,
processes and how and what to do within legal, political,
social, environmental, safety and economic constraints in
achieving that objective.
20
Software Design
“There are two ways of constructing a software design: One
way is to make it so simple that there are obviously no
deficiencies, and the other way is to make it so complicated
that there are no obvious deficiencies.”
-
C.A.R. Hoare
21
Software Design
(Cont...)
• Requirements specification was about the WHAT the system
will do
will perform
its
• Design is about the HOW the
system functions
– provides the overall decomposition of the system
– allows to split the work among a team of developers
– also lays down the groundwork for achieving non-
functional requirements (performance, maintainability, reusability, etc.)
– takes target technology into account (e.g., database design, etc.)
22
Levels of Design
• Two basic Levels of Design:
Architectural design (also: high-level design)
• architecture - the overall structure: main modules and
their connections
• design that covers the main use-cases of the system
• addresses the main non-functional requirements (e.g.,
throughput, reliability)
• hard to change
• Note: A high-level design document will usually include a high-
level architecture diagram depicting the components, interfaces and
networks that need to be further specified or developed.
23
Levels of Design
(Cont...)
Detailed design (also: low-level design)
• the inner structure of the main modules
• may take the target programming language into account
• detailed enough to be implemented in the programming
language
24
The Design
Process
design methods and
• Design requires intelligence
• Design requires experience
• The intelligence can be guided
by techniques, but it can not be
replaced.
25
Top-Down vs. Bottom-Up Design
• Recursively partition
problem into smaller sub-
problems
Top-Down Design: Bottom-Up Design:
• Assemble, adapt, and
extend existing solutions
to fit the problem.
• Continue until tractable
solutions found
• Note: Not practical for
large system in its pure
form
26
Top-Down vs. Bottom-Up Design (Cont...)
Team Leaders
Manager
Developers Team
27
Challenges in Design
Complexity
• Often arbitrary, dependent on designer rather than
problem Conformity
• Often expected to conform to other software (e.g.,
legacy, standards)
Changeability
change due changing requirements,
• Needs to
support constraints,
etc.
Invisibility
• No visible link from between design plans and
product
28
Software Architecture
• Software Architecture
What is Architecture?
 Why Architecture is
important?
Software Architecture
29
What is
Architecture
?
Architecture (ANSI/IEEE 1471-2000)
• The fundamental organization of a system embodied in its
components, their relationships to each other, and to the
environment, and the principles guiding its design and
evolution
*
Reference [5]
30
Architecture
(Cont...)
Architecture is not:
• About development.
• About algorithms.
• About data structures.
Architecture is:
• All about communication.
• What ‘parts’ are there?
• How do the
‘parts’ fit together?
31
The Art and Science of Building:
Architecture
• Architects are not concerned with the creation of building
technologies and materials—making glass with better thermal
qualities or stronger concrete.
• Architects are concerned with how building materials can be
put together in desirable ways to achieve a building suited to
its purpose.
• The design process that assembles the parts into a useful,
pleasing (hopefully) and cost-effective (sometime) whole that
is called “architecture”.
32
Why Architecture is
important
?
• Architecture “constitutes a relatively small, intellectually
graspable model of how the system is structured and how its
components work together” -- L. Bass
• Representations of software architecture are an enabler for
communication between all parties (stakeholders) interested in
the development of a computer-based system.
*
Reference [6]
33
Software Architecture
Software Architecture (Eoin Woods)
“Software architecture is the set of design decisions which, if
made incorrectly, may cause you project to be cancelled.’
A software architecture defines:
• The components of the software system
• How the components use each other’s functionality and data
• How control is managed between the components
34
Software Design Vs
Architecture
35
What is Software
Architecture
?
• A software architecture is typically a set
of design decisions to address
various
non-functional requirements
and attributes of a software
system/application.
• It primarily focuses on aspects such as
performance, reliability, scalability,
testability, maintainability and various
other attributes, which can be key both
structurally and behaviourally of a
software system.
*
Reference [7]
36
Software Design Vs
Architecture
• Grady Booch says: "All architecture is design but not all
design is architecture".
• Software architecture deals with high level concepts without
regard to any implementation details. Software design on the
other hand takes high level concepts and applies concrete
details so that software can be implemented.
37
Software Design Vs
Architecture
• The architecture of a system is its 'skeleton'. It's the
highest level of abstraction of a system. For example:
How do modules interact with each other.
While
• Software
design
is about designing the
individual
modules / components. What are the
responsibilities, functions, of module x? Of class Y?
• So in short, Software architecture is more about the
design of the entire system, while software design
emphasizes on module / component / class level.
38
Reference
s
Paul
1. http://java.dzone.com/articles/challenges-requirements
2. http://eduhunch.com/why-design-is-the-most-important-
factor-for-future-products/
3. http://www.informationweek.com/mobile/mobile-devices/1
0- best-and-worst-cellphones-of-all-time/d/d- id/1109416?
page_number=6
4. http://en.wikipedia.org/wiki/Sustainable_design
5. http://en.wikipedia.org/wiki/IEEE_1471
6. Software architecture in practice by Len
Bass, Clements, Rick Kazman
7. http://www.prowareness.com/blog/software-architectur
e/
39

Software Design And Architecture Introduction

  • 1.
  • 2.
    Textbooks • Some textbooksmay be helpful : • Recommended Text Book: 1. Software architecture in practice by Len Bass, Paul Clements, Rick Kazman, 3rd Edition 2. Applying UML and Patterns, An Introduction to Object-Oriented Analysis and Design and Unified Proces by Craig Larman, 3rd Edition 2 3. Design Patterns -- Elements of Reusable Object-Oriented by Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides, 1st Edition
  • 3.
    Course Outcomes At the endof the course, the student should be able to: • How to apply a wide variety of design patterns, frameworks, and architectures in designing a wide variety of software. • Design and implement software using several different middleware technologies. • Use sound quality metrics as objectives for designs, and then measure and assess designs to ensure the objectives have been met. • Modify designs using sound change control approaches 3
  • 4.
    Software Process • Review SoftwareProcess • SDLC Phases 4
  • 5.
    Main Phases ofSoftware Process • Requirements Analysis (answers “WHAT?”) Specifying what the application must do • Design (answers “HOW?”) • Specifying what the parts will be, and how they will fit together • Implementation (A.K.A. “CODING”) Writing the code • Testing (type of VERIFICATION) • Executing the application with test data for input • Maintenance (REPAIR or ENHANCEMENT) Repairing defects and adding capability 5
  • 6.
    SDLC Phase 1:Requirement Analysis • The process of understanding what’s needed or wanted, and expressing the results in writing • Key Challenges of Requirement analysis ??? 6
  • 7.
    SDLC Phase 2:Design • The design of an application expresses how the application is to be constructed. • It describes the parts involved and how they are to assembled. • It consists of a set of documents (diagrams and text) 7
  • 8.
    SDLC Phase 3:Implementation • In the form of coding • Code only against a design • Before compiling, satisfy yourself that the code you have typed is correct. Read it thoroughly. – ‘correct’ means that is satisfies what’s required of it – This is “author-inspection” (What is it???) Author Inspection: Inspect and edit the block of code you have just written until you are convinced it does exactly what it is meant to do. Only then compile it. 8
  • 9.
    SDLC Phase 3:Implementation (Cont...) • Build-a-little-Test-a-little (Rule) – Add a relatively small amount of code (“build-a-little”) – (Again): Read what you have typed and correct it if necessary until you are totally satisfied it’s correct – Compile – Test the new functionality (“test-a-little”) 9
  • 10.
    SDLC Phase 4:Testing • The testing phase consists of supplying input to the application and comparing the output with that mandated by the software requirements specification. • Helps to uncover defects • Proves the presence of defects, but never their absence • Types of Testing: Black-Box Testing, White-Box Testing 10
  • 11.
    SDLC Phase 4:Testing (Cont...) Tips on Testing • Test early and often • Test with extreme values – Very small, very big, etc. – Borderline – “Illegal” values • Vary test cases – Don’t repeat tests with same test data except when specifically intended 11
  • 12.
    SDLC Phase 5:Maintenance • Maintenance refers to the work performed on the application that occurs after it has been delivered. • Types of maintenance 1. Corrective (Defect Removal) Finding and fixing all inconsistencies with the requirements document 2. Perfective (Enhancement) Introducing new or improved capability 3. Adaptive Adapts software to new environment 4. Preventive Changing some aspect of the system to prevent failures 12
  • 13.
    Software Process Phases Example •Personal Finance Example: 1. Requirements Analysis: Diagrams and text – e.g., “ … The application shall display the balance in the user’s bank account. …” 2. Design: Diagrams and text – e.g., “ … The design will consist of the classes CheckingAccount, SavingsAccount, …” 3. Implementation: Source code – e.g., … class CheckingAccount{ double balance; … } … 13
  • 14.
    Software Process Phases Example ( Cont )... • PersonalFinance Example (Cont...) : .4 Testing: Test cases and test results – e.g., “… With test case: the balance was $2938.22, which is correct . ”… .5 Maintenance: Modified design, code, and text – e.g., Defect repair: “Application crashes when balance is $0 and attempt is made to withdraw funds . ”… – e.g., Enhancement: “Allow operation with ”.£ 14
  • 15.
    The Waterfall SoftwareProcess Basic software process in which requirements , design, implementation, testing/verification and maintenance are performed in sequence . 15
  • 16.
  • 17.
    Summary: Software Process •A way of going about the creation and upkeep of a software product. • Commonly based on the Waterfall process 1. Specify requirements 2. Create design 3. Write code 4. Test 5. Maintain In sequence with some overlap 17
  • 18.
    Software Design • SoftwareDesign What is Design? Why Design is so important?  Levels of Design  The Design Process  Challenges in Design 18
  • 19.
    What is Design ? • Design is thecreation of a plan or convention for the construction of an object or a system. 19
  • 20.
    What is Design? (Cont...) •Another definition for design is a roadmap or a strategic approach for someone to achieve a unique expectation. It defines the specifications, plans, parameters, costs, activities, processes and how and what to do within legal, political, social, environmental, safety and economic constraints in achieving that objective. 20
  • 21.
    Software Design “There aretwo ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies.” - C.A.R. Hoare 21
  • 22.
    Software Design (Cont...) • Requirementsspecification was about the WHAT the system will do will perform its • Design is about the HOW the system functions – provides the overall decomposition of the system – allows to split the work among a team of developers – also lays down the groundwork for achieving non- functional requirements (performance, maintainability, reusability, etc.) – takes target technology into account (e.g., database design, etc.) 22
  • 23.
    Levels of Design •Two basic Levels of Design: Architectural design (also: high-level design) • architecture - the overall structure: main modules and their connections • design that covers the main use-cases of the system • addresses the main non-functional requirements (e.g., throughput, reliability) • hard to change • Note: A high-level design document will usually include a high- level architecture diagram depicting the components, interfaces and networks that need to be further specified or developed. 23
  • 24.
    Levels of Design (Cont...) Detaileddesign (also: low-level design) • the inner structure of the main modules • may take the target programming language into account • detailed enough to be implemented in the programming language 24
  • 25.
    The Design Process design methodsand • Design requires intelligence • Design requires experience • The intelligence can be guided by techniques, but it can not be replaced. 25
  • 26.
    Top-Down vs. Bottom-UpDesign • Recursively partition problem into smaller sub- problems Top-Down Design: Bottom-Up Design: • Assemble, adapt, and extend existing solutions to fit the problem. • Continue until tractable solutions found • Note: Not practical for large system in its pure form 26
  • 27.
    Top-Down vs. Bottom-UpDesign (Cont...) Team Leaders Manager Developers Team 27
  • 28.
    Challenges in Design Complexity •Often arbitrary, dependent on designer rather than problem Conformity • Often expected to conform to other software (e.g., legacy, standards) Changeability change due changing requirements, • Needs to support constraints, etc. Invisibility • No visible link from between design plans and product 28
  • 29.
    Software Architecture • SoftwareArchitecture What is Architecture?  Why Architecture is important? Software Architecture 29
  • 30.
    What is Architecture ? Architecture (ANSI/IEEE1471-2000) • The fundamental organization of a system embodied in its components, their relationships to each other, and to the environment, and the principles guiding its design and evolution * Reference [5] 30
  • 31.
    Architecture (Cont...) Architecture is not: •About development. • About algorithms. • About data structures. Architecture is: • All about communication. • What ‘parts’ are there? • How do the ‘parts’ fit together? 31
  • 32.
    The Art andScience of Building: Architecture • Architects are not concerned with the creation of building technologies and materials—making glass with better thermal qualities or stronger concrete. • Architects are concerned with how building materials can be put together in desirable ways to achieve a building suited to its purpose. • The design process that assembles the parts into a useful, pleasing (hopefully) and cost-effective (sometime) whole that is called “architecture”. 32
  • 33.
    Why Architecture is important ? •Architecture “constitutes a relatively small, intellectually graspable model of how the system is structured and how its components work together” -- L. Bass • Representations of software architecture are an enabler for communication between all parties (stakeholders) interested in the development of a computer-based system. * Reference [6] 33
  • 34.
    Software Architecture Software Architecture(Eoin Woods) “Software architecture is the set of design decisions which, if made incorrectly, may cause you project to be cancelled.’ A software architecture defines: • The components of the software system • How the components use each other’s functionality and data • How control is managed between the components 34
  • 35.
  • 36.
    What is Software Architecture ? •A software architecture is typically a set of design decisions to address various non-functional requirements and attributes of a software system/application. • It primarily focuses on aspects such as performance, reliability, scalability, testability, maintainability and various other attributes, which can be key both structurally and behaviourally of a software system. * Reference [7] 36
  • 37.
    Software Design Vs Architecture •Grady Booch says: "All architecture is design but not all design is architecture". • Software architecture deals with high level concepts without regard to any implementation details. Software design on the other hand takes high level concepts and applies concrete details so that software can be implemented. 37
  • 38.
    Software Design Vs Architecture •The architecture of a system is its 'skeleton'. It's the highest level of abstraction of a system. For example: How do modules interact with each other. While • Software design is about designing the individual modules / components. What are the responsibilities, functions, of module x? Of class Y? • So in short, Software architecture is more about the design of the entire system, while software design emphasizes on module / component / class level. 38
  • 39.
    Reference s Paul 1. http://java.dzone.com/articles/challenges-requirements 2. http://eduhunch.com/why-design-is-the-most-important- factor-for-future-products/ 3.http://www.informationweek.com/mobile/mobile-devices/1 0- best-and-worst-cellphones-of-all-time/d/d- id/1109416? page_number=6 4. http://en.wikipedia.org/wiki/Sustainable_design 5. http://en.wikipedia.org/wiki/IEEE_1471 6. Software architecture in practice by Len Bass, Clements, Rick Kazman 7. http://www.prowareness.com/blog/software-architectur e/ 39