software design & deleopmentchate/2110634/01-fundamentals.pdfcomponent •any piece of software...

38
Software Design & Development Software Design Fundamentals C. Patanothai 01-Design Fundamentals 1

Upload: others

Post on 13-Jul-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Software Design & Deleopmentchate/2110634/01-Fundamentals.pdfComponent •Any piece of software or hardware that has a clear role. –A component can be isolated, allowing you to replace

Software Design & Development

Software Design Fundamentals

C. Patanothai 01-Design Fundamentals 1

Page 2: Software Design & Deleopmentchate/2110634/01-Fundamentals.pdfComponent •Any piece of software or hardware that has a clear role. –A component can be isolated, allowing you to replace

Social Network Architecture

C. Patanothai 01-Design Fundamentals 2

Page 3: Software Design & Deleopmentchate/2110634/01-Fundamentals.pdfComponent •Any piece of software or hardware that has a clear role. –A component can be isolated, allowing you to replace

Android System Architecture

C. Patanothai 01-Design Fundamentals 3

Page 4: Software Design & Deleopmentchate/2110634/01-Fundamentals.pdfComponent •Any piece of software or hardware that has a clear role. –A component can be isolated, allowing you to replace

Core Banking System

C. Patanothai 01-Design Fundamentals 4

Page 5: Software Design & Deleopmentchate/2110634/01-Fundamentals.pdfComponent •Any piece of software or hardware that has a clear role. –A component can be isolated, allowing you to replace

Cloud Switch/VPC Architecture

C. Patanothai 01-Design Fundamentals 5

Page 6: Software Design & Deleopmentchate/2110634/01-Fundamentals.pdfComponent •Any piece of software or hardware that has a clear role. –A component can be isolated, allowing you to replace

NASA JPL, Robots and AWS cloud

C. Patanothai 01-Design Fundamentals 6

Page 7: Software Design & Deleopmentchate/2110634/01-Fundamentals.pdfComponent •Any piece of software or hardware that has a clear role. –A component can be isolated, allowing you to replace

Software Design Fundamentals

• General design concept

• Context of software design in SDLC

• Software design process

• Enabling techniques

C. Patanothai 01-Design Fundamentals 7

Page 8: Software Design & Deleopmentchate/2110634/01-Fundamentals.pdfComponent •Any piece of software or hardware that has a clear role. –A component can be isolated, allowing you to replace

The Process of Design

• Definition: – Design is a problem-solving process whose

objective is to find and describe a way: • To implement the system’s functional

requirements...

• While respecting the constraints imposed by the non-functional requirements... – including the budget

• And while adhering to general principles of good quality

C. Patanothai 01-Design Fundamentals 8

Page 9: Software Design & Deleopmentchate/2110634/01-Fundamentals.pdfComponent •Any piece of software or hardware that has a clear role. –A component can be isolated, allowing you to replace

Design as a series of decisions

• A designer is faced with a series of design issues – These are sub-problems of the overall design problem.

– Each issue normally has several alternative solutions: • design options.

– The designer makes a design decision to resolve each issue. • This process involves choosing the best option from among the

alternatives.

C. Patanothai 01-Design Fundamentals 9

Page 10: Software Design & Deleopmentchate/2110634/01-Fundamentals.pdfComponent •Any piece of software or hardware that has a clear role. –A component can be isolated, allowing you to replace

Making decisions

• To make each design decision, the software engineer uses:

– Knowledge of

• the requirements

• the design as created so far

• the technology available

• software design principles and ‘best practices’

• what has worked well in the past

C. Patanothai 01-Design Fundamentals 10

Page 11: Software Design & Deleopmentchate/2110634/01-Fundamentals.pdfComponent •Any piece of software or hardware that has a clear role. –A component can be isolated, allowing you to replace

Design space

• The space of possible designs that could be achieved by choosing different sets of alternatives is often called the design space

– For example:

C. Patanothai 01-Design Fundamentals 11

Page 12: Software Design & Deleopmentchate/2110634/01-Fundamentals.pdfComponent •Any piece of software or hardware that has a clear role. –A component can be isolated, allowing you to replace

Component

• Any piece of software or hardware that has a clear role.

– A component can be isolated, allowing you to replace it with a different component that has equivalent functionality.

– Many components are designed to be reusable.

– Conversely, others perform special-purpose functions.

C. Patanothai 01-Design Fundamentals 12

Page 13: Software Design & Deleopmentchate/2110634/01-Fundamentals.pdfComponent •Any piece of software or hardware that has a clear role. –A component can be isolated, allowing you to replace

Module

• A component that is defined at the programming language level

– For example, methods, classes and packages are modules in Java.

C. Patanothai 01-Design Fundamentals 13

Page 14: Software Design & Deleopmentchate/2110634/01-Fundamentals.pdfComponent •Any piece of software or hardware that has a clear role. –A component can be isolated, allowing you to replace

System

• A logical entity, having a set of definable responsibilities or objectives, and consisting of hardware, software or both. – A system can have a specification which is then

implemented by a collection of components. – A system continues to exist, even if its components are

changed or replaced. – The goal of requirements analysis is to determine the

responsibilities of a system.

– Subsystem: • A system that is part of a larger system, and which has a definite

interface

C. Patanothai 01-Design Fundamentals 14

Page 15: Software Design & Deleopmentchate/2110634/01-Fundamentals.pdfComponent •Any piece of software or hardware that has a clear role. –A component can be isolated, allowing you to replace

UML diagram of system parts

C. Patanothai 01-Design Fundamentals 15

Page 16: Software Design & Deleopmentchate/2110634/01-Fundamentals.pdfComponent •Any piece of software or hardware that has a clear role. –A component can be isolated, allowing you to replace

Software Design Process

• Architectural design

– Decomposition

– Component

• Detailed design – Behavior of components

C. Patanothai 01-Design Fundamentals 16

Page 17: Software Design & Deleopmentchate/2110634/01-Fundamentals.pdfComponent •Any piece of software or hardware that has a clear role. –A component can be isolated, allowing you to replace

Software Design

C. Patanothai 01-Design Fundamentals 17

Information

model

Functional

model

Behavioral

model

Other

requirements

Design

Code

Test

Data design

Architectural

design

Procedural

design

Program

modules

Integrated

& validated

software

Page 18: Software Design & Deleopmentchate/2110634/01-Fundamentals.pdfComponent •Any piece of software or hardware that has a clear role. –A component can be isolated, allowing you to replace

Design

• Data design

• Architectural design

• Procedural design

C. Patanothai 01-Design Fundamentals 18

Page 19: Software Design & Deleopmentchate/2110634/01-Fundamentals.pdfComponent •Any piece of software or hardware that has a clear role. –A component can be isolated, allowing you to replace

Design Fundamentals

• Abstraction

• Refinement

• Modularity

• Software Architecture

• Control Hierarchy

• Data Structure

• Software Procedure • Information Hiding

C. Patanothai 01-Design Fundamentals 19

Page 20: Software Design & Deleopmentchate/2110634/01-Fundamentals.pdfComponent •Any piece of software or hardware that has a clear role. –A component can be isolated, allowing you to replace

Design Fundamentals

• Abstraction

– Level of detail/language used to describe a problem

– Types of abstraction

C. Patanothai 01-Design Fundamentals 20

…notion of “abstraction” permits one to concentrate on a

problem at some level of generalization without regard to

irrelevant low level details; use of abstraction also permits one

to work with concepts and terms that are familiar in the problem

environment…

[Wasserman]

Page 21: Software Design & Deleopmentchate/2110634/01-Fundamentals.pdfComponent •Any piece of software or hardware that has a clear role. –A component can be isolated, allowing you to replace

Abstraction and classes

• Classes are data abstractions that contain procedural abstractions – Abstraction is increased by defining all variables as private.

– The fewer public methods in a class, the better the abstraction

– Superclasses and interfaces increase the level of abstraction

– Attributes and associations are also data abstractions.

– Methods are procedural abstractions • Better abstractions are achieved by giving methods fewer

parameters

C. Patanothai 01-Design Fundamentals 21

Page 22: Software Design & Deleopmentchate/2110634/01-Fundamentals.pdfComponent •Any piece of software or hardware that has a clear role. –A component can be isolated, allowing you to replace

Design Fundamentals

• Refinement

– Top/down strategy

– Modularity

C. Patanothai 01-Design Fundamentals 22

In each step, one or several instructions of the given

program are decomposed into more detailed instructions.

This successive decomposition or refinement of

specification terminates when all instructions are

expressed in terms of any underlying computer or

programming language. [Wirth]

Page 23: Software Design & Deleopmentchate/2110634/01-Fundamentals.pdfComponent •Any piece of software or hardware that has a clear role. –A component can be isolated, allowing you to replace

Top-down and bottom-up design

• Top-down design

– First design the very high level structure of the system.

– Then gradually work down to detailed decisions about low-level constructs.

– Finally arrive at detailed decisions such as:

• the format of particular data items;

• the individual algorithms that will be used.

C. Patanothai 01-Design Fundamentals 23

Page 24: Software Design & Deleopmentchate/2110634/01-Fundamentals.pdfComponent •Any piece of software or hardware that has a clear role. –A component can be isolated, allowing you to replace

Top-down and bottom-up design

• Bottom-up design – Make decisions about reusable low-level utilities. – Then decide how these will be put together to create high-

level constructs.

• A mix of top-down and bottom-up approaches are

normally used: – Top-down design is almost always needed to give the

system a good structure. – Bottom-up design is normally useful so that reusable

components can be created.

C. Patanothai 01-Design Fundamentals 24

Page 25: Software Design & Deleopmentchate/2110634/01-Fundamentals.pdfComponent •Any piece of software or hardware that has a clear role. –A component can be isolated, allowing you to replace

Design Fundamentals

• Software Architecture – The hierarchical structure of procedural

components & the structure of data

– Transition between analysis and design

• Control Hierarchy/Program Structure – Organization of modules that implies a hierarchy

of control

– Metrics - depth, width, fan-out, fan-in

– Visibility & connectivity

C. Patanothai 01-Design Fundamentals 25

Page 26: Software Design & Deleopmentchate/2110634/01-Fundamentals.pdfComponent •Any piece of software or hardware that has a clear role. –A component can be isolated, allowing you to replace

Control Hierarchy

Module D Module E

Module F

Module I

Module G

Module J

Module H

Module A

Module K

Module B

Module L

Module N

Module R

Module O Module P Module Q

Module M

Module C

Manager

C. Patanothai 01-Design Fundamentals 26

Page 27: Software Design & Deleopmentchate/2110634/01-Fundamentals.pdfComponent •Any piece of software or hardware that has a clear role. –A component can be isolated, allowing you to replace

Design Fundamentals

• Data Structure – Logical representation of the relationship among

individual data elements

– Scalar, sequential vector, array, linked list, hierarchical data structure

• Software Procedure – Processing details of each module

– Precise specification includes sequence of events, decision points, repetitive operations, data organization

C. Patanothai 01-Design Fundamentals 27

Page 28: Software Design & Deleopmentchate/2110634/01-Fundamentals.pdfComponent •Any piece of software or hardware that has a clear role. –A component can be isolated, allowing you to replace

Design Fundamentals

• Information Hiding

– Modules should be “characterized by design decisions that each hides from all others”

– Modules are designed so that information within a module is inaccessible to other modules with no need for the information

– Defines and enforces access constraints

C. Patanothai 01-Design Fundamentals 28

Page 29: Software Design & Deleopmentchate/2110634/01-Fundamentals.pdfComponent •Any piece of software or hardware that has a clear role. –A component can be isolated, allowing you to replace

Modular Design

• Benefits

– Reduces complexity

– Facilitates changes

– Easier implementation

• Activation mechanisms

• Pattern of control

C. Patanothai 01-Design Fundamentals 29

Page 30: Software Design & Deleopmentchate/2110634/01-Fundamentals.pdfComponent •Any piece of software or hardware that has a clear role. –A component can be isolated, allowing you to replace

Functional Independence

• Benefits

– Easier to develop

– Easier to maintain & test

• Measures of Independence

– Cohesion

– Coupling

C. Patanothai 01-Design Fundamentals 30

“Design software so that each module addresses a specific

sub-function of requirements and has a simple interface when

viewed from other parts of the program structure”

Page 31: Software Design & Deleopmentchate/2110634/01-Fundamentals.pdfComponent •Any piece of software or hardware that has a clear role. –A component can be isolated, allowing you to replace

Cohesion

• “A cohesive module should do just one thing.”

• Levels of Cohesion – Coincidental

– Logical

– Temporal

– Procedural

– Communicational

– Sequential

– Functional

C. Patanothai 01-Design Fundamentals 31

Page 32: Software Design & Deleopmentchate/2110634/01-Fundamentals.pdfComponent •Any piece of software or hardware that has a clear role. –A component can be isolated, allowing you to replace

Coupling

• Measure of interconnection among modules

• Levels of Coupling – No direct coupling

– Data coupling

– Stamp coupling

– Control coupling

– External coupling

– Common coupling

– Content coupling

C. Patanothai 01-Design Fundamentals 32

Page 33: Software Design & Deleopmentchate/2110634/01-Fundamentals.pdfComponent •Any piece of software or hardware that has a clear role. –A component can be isolated, allowing you to replace

Design for Portability

• Have the software run on as many platforms as possible

– Avoid the use of facilities that are specific to one particular environment

– E.g. a library only available in Microsoft Windows

C. Patanothai 01-Design Fundamentals 33

Page 34: Software Design & Deleopmentchate/2110634/01-Fundamentals.pdfComponent •Any piece of software or hardware that has a clear role. –A component can be isolated, allowing you to replace

Design for Testability

• Take steps to make testing easier

– Design a program to automatically test the software

• Ensure that all the functionality of the code can by driven by an external program, bypassing a graphical user interface

– In Java, you can create a main() method in each class in order to exercise the other methods

C. Patanothai 01-Design Fundamentals 34

Page 35: Software Design & Deleopmentchate/2110634/01-Fundamentals.pdfComponent •Any piece of software or hardware that has a clear role. –A component can be isolated, allowing you to replace

Open Close Principle (OPC)

• Open for extension and closed for modification

C. Patanothai 01-Design Fundamentals 35

Page 36: Software Design & Deleopmentchate/2110634/01-Fundamentals.pdfComponent •Any piece of software or hardware that has a clear role. –A component can be isolated, allowing you to replace

Interface Segregation Principle

C. Patanothai 01-Design Fundamentals 36

Page 37: Software Design & Deleopmentchate/2110634/01-Fundamentals.pdfComponent •Any piece of software or hardware that has a clear role. –A component can be isolated, allowing you to replace

Package Dependency

C. Patanothai 01-Design Fundamentals 37

Page 38: Software Design & Deleopmentchate/2110634/01-Fundamentals.pdfComponent •Any piece of software or hardware that has a clear role. –A component can be isolated, allowing you to replace

Acyclic Dependencies Principle

C. Patanothai 01-Design Fundamentals 38