31
CSE 303 – Software Design and Architecture LECTURE 03

CSE 303 – Software Design and Architecture LECTURE 03

Embed Size (px)

Citation preview

Page 1: CSE 303 – Software Design and Architecture LECTURE 03

CSE 303 – Software Design and Architecture

LECTURE 03

Page 2: CSE 303 – Software Design and Architecture LECTURE 03

Previous Lecture

• Design phase in SDLC – architecture and detailed design

• Factors that affect design• Quality Models

Page 3: CSE 303 – Software Design and Architecture LECTURE 03

Outline

• Good design• Quality attributes of software design• Software design principles• Concepts in design

Page 4: CSE 303 – Software Design and Architecture LECTURE 03

GOOD DESIGN

Page 5: CSE 303 – Software Design and Architecture LECTURE 03

Efficiency

• Efficiency refers to the responsiveness of the system, – i.e. the time required to respond to stimuli

(events), – or the number of events processed in some

interval of time.

Page 6: CSE 303 – Software Design and Architecture LECTURE 03

Efficiency

• The time to process a sequence of events can be divided into three parts.

• First, time is needed to communicate between different software components that collaborate to process an event.

• Second, the computation times that components executed may have overlaps or gaps between them.

• Third, the times are needed for each component to complete its computation.

Page 7: CSE 303 – Software Design and Architecture LECTURE 03

Correctness

• Correctness is the property that software implements the specified users’ requirements.

• It is impossible that a design at any level that does not correctly implement the specified requirements would lead to a correct implementation.

Page 8: CSE 303 – Software Design and Architecture LECTURE 03

Reliability

• Reliability can be defined as the probability that a system performs user required functionality correctly – at a specified environment in a given period of

time.

Page 9: CSE 303 – Software Design and Architecture LECTURE 03

Portability

• Portability is the property of a software system that can be easily transported from one hardware/software platform to another,– for example, from a PC/Windows environment

to a Sun/Unix environment or a Macintosh environment.

Page 10: CSE 303 – Software Design and Architecture LECTURE 03

Maintainability

• Maintainability refers to the easiness of maintaining a software system.

• There are two types of software maintenance operations. – corrective maintenance. – adaptive maintenance.

• Well-structured design helps software engineers to understand the system.

Page 11: CSE 303 – Software Design and Architecture LECTURE 03

Reusability

• Reusability is the property of a software system that its components can be easily reused in the development of other software systems.

– Reusability depends on the generality of the components in a given application domain and the extent to which the components are parameterised and configurable.

Page 12: CSE 303 – Software Design and Architecture LECTURE 03

Interoperability

• Interoperability is the property of how easy a software system can be used with other software systems.

• Interoperability mostly depends on the interface between a software system and its environment.

• It requires that the implementation of the software follow certain standard interface and coding conventions.

Page 13: CSE 303 – Software Design and Architecture LECTURE 03

QUALITY ATTRIBUTES OF SOFTWARE DESIGN

Page 14: CSE 303 – Software Design and Architecture LECTURE 03

Quality Attributes – Design Objectives

• Modularity: – The design should be composed of replaceable, self-

contained assemblies of elementary parts, – thereby aiding both the initial development and the later

maintenance.

• Portability: – The designed product should be able to be moved

unchanged • from test environments to operational environments and • from one operational environment to another.

Page 15: CSE 303 – Software Design and Architecture LECTURE 03

Quality Attributes – Design Objectives

• Flexibility or modifiability: – The design should facilitate adaptation to changing end-user

requirements, • changes based on new problems in the end users’ world

• Conceptual integrity: – The design should exhibit harmony, symmetry and

predictability.

• Well structured: – The design should be consistent with chosen design

principles, such as information hiding, to organise the structure of the design.

Page 16: CSE 303 – Software Design and Architecture LECTURE 03

Quality Attributes – Design Objectives

• Simple: – The design should be ‘as simple as possible, but no

simpler’.

• Efficient: – The functions provided by the design should be

computable by using the available resources.

• Adequate: – The design should meet the stated requirements.

Page 17: CSE 303 – Software Design and Architecture LECTURE 03

Quality Attributes – Design Objectives

• Flexible: – The design should be able to accommodate likely changes

in the requirements, however these might arise.

• Implementable: – The functions offered by the design should be theoretically

computable with the information available and achievable using currently available software and hardware technology.

• Standardised: – The design should be represented using standard or well

defined and familiar notation for any documentation.

Page 18: CSE 303 – Software Design and Architecture LECTURE 03

Quality Attributes – Design Objectives

• Feasibility: – The designed process of bringing about the product should

be executable.

• Simplicity: – The production (i.e. the development) of the designed

software should be as simple and straightforward as possible without unnecessary complication.

• Reliability: – The designed development process should with high

probability be successful rather than fail to achieve its goal.

Page 19: CSE 303 – Software Design and Architecture LECTURE 03

SOFTWARE DESIGN PRINCIPLES

Page 20: CSE 303 – Software Design and Architecture LECTURE 03

Software Design Principles

• Always consider alternative approaches • The design should be traceable to the analysis model

• The design should not reinvent the wheel

• The design should minimise intellectual distance between the software and the problem as it exists in the real world.

Page 21: CSE 303 – Software Design and Architecture LECTURE 03

Software Design Principles contd…

• The design should exhibit uniformity and integration– A design is uniform if it appears that one person developed

the whole thing. – A design is integrated if care is taken in defining interfaces

between design components.

• The design should be reviewed to minimize conceptual (semantic) errors

Page 22: CSE 303 – Software Design and Architecture LECTURE 03

Software Design Principles contd…

• Design is not coding, coding is not design – Even when detailed designs are created for program

components, the level of abstraction of the design model is higher than source code.

• The design should be structured to accommodate change

• The design should be assessed for quality as it is being created

Page 23: CSE 303 – Software Design and Architecture LECTURE 03

23

CONCEPTS IN DESIGN

Page 24: CSE 303 – Software Design and Architecture LECTURE 03

Concepts in Software Design Process• Abstraction

– Concentrate on a problem at some level of generalization without regard to irrelevant low level details.

• Modularity– Divide the software into separately named and

addressable components, that are integrated to satisfy the problem requirements.

• Refinement– Top down design strategy that successively refines the

levels of procedural details.– Every refinement step involves Design Decisions.

Page 25: CSE 303 – Software Design and Architecture LECTURE 03

Modular Design• Easier to manage• Easier to understand• Reduces complexity• Delegation / division of work• Fault isolation• Independent development• Separation of concerns• Reuse

Page 26: CSE 303 – Software Design and Architecture LECTURE 03

Effective Modular Design• How to decompose a software system into

best set of modules?– Information hiding– Cohesion– Coupling– Functional independence

Page 27: CSE 303 – Software Design and Architecture LECTURE 03

Information Hiding• Design the modules in such a way that information

(data & procedures) contained in one module is inaccessible to other modules that have no need for such information.

• Independent modules.• Benefits:

– when modifications are required, it reduces the chances of propagating to other modules.

Page 28: CSE 303 – Software Design and Architecture LECTURE 03

Cohesion• “A module should ideally do one thing.”• Each module performs a single task requiring little

interaction with other modules. • A cohesive module since accomplished neatly

defined single task so it can be re-used in other projects

• High cohesion is good– Changes are likely to be local to a module– Easier to understand a module in isolation

Page 29: CSE 303 – Software Design and Architecture LECTURE 03

Coupling

• A measure of interconnection among modules in a software structure

• Depends on the interface complexity between the modules

• High coupling causes problems– Change propagation- ripple effect– Difficulty in understanding– Difficult reuse

Page 30: CSE 303 – Software Design and Architecture LECTURE 03

Functional Independence• A module having high cohesion and low coupling is said to

be functionally independent of other modules.

• Each module addresses a specific sub function of requirements and is easier to maintain or modify

• Benefits:– Error isolation– Scope of Re-use– Understandability

Page 31: CSE 303 – Software Design and Architecture LECTURE 03

Summary

• Good design• Quality attributes of software design• Software design principles• A few concepts in design