Software Design.

Slides:



Advertisements
Similar presentations
Software Modeling SWE5441 Lecture 3 Eng. Mohammed Timraz
Advertisements

Ch4: Software Architecture and Design. 1 What is a design?
CS189A/172 - Winter 2008 Lecture 7: Software Specification, Architecture Specification.
Design and Software Architecture
Ch4: Software Architecture and Design. 1 Modules: Interface vs. Implementation (contd..)  Interface design considerations:
1 ES 314 Advanced Programming Lec 2 Sept 3 Goals: Complete the discussion of problem Review of C++ Object-oriented design Arrays and pointers.
Developed by Reneta Barneva, SUNY Fredonia Component Level Design.
Architectural Design Establishing the overall structure of a software system Objectives To introduce architectural design and to discuss its importance.
Introduction to Software Design Chapter 1. Chapter 1: Introduction to Software Design2 Chapter Objectives To become familiar with the software challenge.
What is design? Provides structure to any artifact Decomposes system into parts, assigns responsibilities, ensures that parts fit together to achieve a.
Chapter 10 Architectural Design
Lesson 7 Guide for Software Design Description (SDD)
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 12 Object-Oriented.
Design Patterns OOD. Course topics Design Principles UML –Class Diagrams –Sequence Diagrams Design Patterns C#,.NET (all the course examples) Design Principles.
An Introduction to Software Architecture
CSE 303 – Software Design and Architecture
Ceg860 (Prasad)L6MR1 Modularity Extendibility Reusability.
Chapter 1 Introduction Dr. Frank Lee. 1.1 Why Study Compiler? To write more efficient code in a high-level language To provide solid foundation in parsing.
SOFTWARE DESIGN.
Ch. 41 Design and Software Architecture. Ch. 42 Outline What is design How can a system be decomposed into modules What is a module’s interface What are.
1 COMP 3438 – Part II-Lecture 1: Overview of Compiler Design Dr. Zili Shao Department of Computing The Hong Kong Polytechnic Univ.
Ch. 41 Design and Software Architecture. Ch. 42 Outline What is design How can a system be decomposed into modules What is a module’s interface What are.
David Weiss Software Product-Line Engineering: A Family-Based Software Development Process: Designing The Family David Weiss
1 Introduction to Software Engineering Lecture 1.
Unit-1 Introduction Prepared by: Prof. Harish I Rathod
5 - 1 Copyright © 2006, The McGraw-Hill Companies, Inc. All rights reserved.
Design Concepts By Deepika Chaudhary.
Software Engineering Principles. SE Principles Principles are statements describing desirable properties of the product and process.
SOFTWARE DESIGN. INTRODUCTION There are 3 distinct types of activities in design 1.External design 2.Architectural design 3.Detailed design Architectural.
1. 2 Preface In the time since the 1986 edition of this book, the world of compiler design has changed significantly 3.
Overview of Previous Lesson(s) Over View  A program must be translated into a form in which it can be executed by a computer.  The software systems.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
1 Software Design Lecture What’s Design It’s a representation of something that is to be built. i.e. design  implementation.
Basic Characteristics of Object-Oriented Systems
Maitrayee Mukerji. INPUT MEMORY PROCESS OUTPUT DATA INFO.
Slide 1 Unified Modeling Language, Version 2.0 Object-Oriented SAD.
The Software Lifecycle Stuart Faulk. Definition Software Life Cycle: evolution of a software development effort from concept to retirement Life Cycle.
Mohammed I DAABO COURSE CODE: CSC 355 COURSE TITLE: Data Structures.
Introduction to DBMS Purpose of Database Systems View of Data
Introduction to Algorithms
Advanced Computer Systems
CompSci 280 S Introduction to Software Development
Systems Analysis and Design in a Changing World, Fourth Edition
Chapter 6 The Traditional Approach to Requirements.
ITEC 3220A Using and Designing Database Systems
Definition CASE tools are software systems that are intended to provide automated support for routine activities in the software process such as editing.
SOFTWARE DESIGN AND ARCHITECTURE
Chapter 1: Introduction
The Systems Engineering Context
Designing Software for Ease of Extension and Contraction
Introduction to Database Systems
Chapter 2 Database Environment.
Data, Databases, and DBMSs
What is an Architecture?
File Systems and Databases
Subprograms and Programmer Defined Data Type
Higher-Level Testing and Integration Testing
Software Architecture
Chapter 20 Object-Oriented Analysis and Design
Analysis models and design models
An Introduction to Software Architecture
Introduction to DBMS Purpose of Database Systems View of Data
Introduction to Algorithms
What is an Architecture?
CMPE 152: Compiler Design January 29 Class Meeting
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 5 Architectural Design.
Chapter 1: Introduction
Presentation transcript:

Software Design

Assignment: Prepare for requirements inspections to be held in-class on Monday 9/18 Read Ghezzi pages 67-124 for Wednesday 9/20

Simple Waterfall Model Requirements Analysis and Specification Design and Specification Coding and Unit Testing Integration and System Testing Delivery and Maintenance

Design Design acts as a bridge between requirements and implementation of software Design gives a structure to an artifact a system must be given a structure that makes it easy to understand and evolve Design refers to both an activity and the result of the activity

The Software Design Activity Design decomposes a system into parts, assigns responsibilities, and ensures that parts fit together to achieve a global goal The design process describes views of the system in steps of increasing detail Produces a Software Design Document Often a software architecture is produced as an overarching framework for a software design

Software Architecture Shows overall structure and organization of the system to be defined Its description includes description of main components of a system relationships among those components rationale for decomposition into its components constraints that must be respected by any design of the components Guides the development of the design

Architectural Diagram Examples V e r s i o n m a n a g e m e n t O b j e c t m a n a g e m e n t D a t a b a s e s y s t e m O p e r a t i n g s y s t e m

Architectural Diagram Example: Compiler tokens AST Lexical Analyzer source code Parser High Level Optimizer AST optimized FRONT END optimized object code Code Generator Low Level Optimizer object code BACK END

Two Important Design Goals Design for change (Parnas) designers tend to concentrate on current needs special effort is needed to anticipate likely changes Product families (Parnas) think of the current system under design as a member of a product family

Sample Changes (1) Algorithms Change of data representation e.g., replace inefficient sorting algorithm with a more efficient one Change of data representation e.g., from array to hashtable a non-trivial percentage of maintenance costs are attributed to data representation changes Changes in platforms

Sample Changes (2) Change of underlying abstract machine new release of operating system new version of DBMS Change of peripheral devices Change of "social" environment new tax regime EURO vs national currency in EU Change due to development processes (e.g., supporting automated testing)

Product Families Different versions of the same system e.g. a family of compilers e.g. a family of mobile phones members of the family may differ in network standards, end-user interaction languages e.g. a facility reservation system for hotels: reserve rooms, restaurant, conference space, equipment (video beamers, projectors) for a university many functionalities are similar, some are different (e.g., facilities may be free of charge or not)

Design Goal for a Product Family Design the whole family as one system, not each individual family member separately Anticipate definition of all family members Identify what is common to all family members, delay decisions that differentiate among different members Software product line engineering focuses on product families

Module A well-defined component of a software system A part of a system that provides a set of services to other modules Services are computational elements that other modules may use When we decompose systems into modules we need to specify relations between them.

Architectural Diagram Example: Compiler tokens AST Lexical Analyzer source code Parser High Level Optimizer AST optimized FRONT END optimized object code Code Generator Low Level Optimizer object code BACK END

Categories of Modules Functional modules traditional form of modularization provide a procedural abstraction encapsulate an algorithm e.g. sorting module, fast Fourier transform module, …

Categories of Modules (cont’d) Libraries a group of related procedural abstractions e.g., mathematical libraries implemented by routines of programming languages Common pools of data data shared by different modules e.g., configuration constants C header files the “COMMON” FORTRAN construct

Categories of Modules (cont’d) Abstract objects Objects manipulated via interface functions Data structure hidden to clients Abstract data types (ADTs) Correspond to Java and C++ classes Many instances of abstract data types may be generated

Modules and Relations Let S be a set of modules S = {M1, M2, . . ., Mn} A binary relation r on S is a subset of S x S If Mi and Mj are in S, <Mi, Mj>  r can be written as Mi r Mj

Example: the CALLS relation S = {A, B, C, D} S x S = ? What are possible binary CALLS relations on S?

Relations Transitive closure r+ of r Mi r+ Mj iff Mi r Mj or  Mk in S s.t. Mi r Mk and Mk r+ Mj Often our relations are irreflexive r is a hierarchy iff there are no two elements Mi, Mj s.t. Mi r+ Mj  Mj r+ Mi

Example: the CALLS relation S = {A, B, C, D} S x S = ? What are possible binary CALLS relations on S? Can CALLS be reflexive? Calculate transitive closures on CALLS

Relations Relations can be represented as graphs A hierarchy is a DAG (directed acyclic graph) a graph a DAG

IS_COMPONENT_OF Used to describe a higher level module as constituted by a number of lower level modules A IS_COMPONENT_OF B B consists of several modules, one of which is A B COMPRISES A (inverse) MS,i={Mk | MkS  Mk IS_COMPONENT_OF Mi} we say that Mi IS_COMPOSED_OF MS,i and that MS,i IMPLEMENTS Mi

Architectural Diagram Example: Compiler tokens AST Lexical Analyzer source code Parser High Level Optimizer AST optimized FRONT END optimized object code Code Generator Low Level Optimizer object code BACK END

A Graphical View They are hierarchies M 1 2 4 5 6 7 8 9 3 (IS_COMPONENT_OF) (COMPRISES) They are hierarchies

IS_COMPONENT_OF in Designs Higher level modules in comprises graphs are abstractions of those they comprise. They provide structure and support understanding. Only modules that are not composed of others, however, ultimately have physical roles within software systems.

Architectural Diagram Example: Compiler tokens AST Lexical Analyzer source code Parser High Level Optimizer AST optimized FRONT END optimized object code Code Generator Low Level Optimizer object code BACK END

The USES Relation A uses B A is a client of B; B is a server A requires the correct operation of B A can access the services exported by B through its interface A depends on B to provide its services example: A calls a routine exported by B A is a client of B; B is a server

Architectural Diagram Example: Compiler tokens AST Lexical Analyzer source code Parser High Level Optimizer AST optimized FRONT END optimized object code Code Generator Low Level Optimizer object code BACK END

Desirable Property USES should be a hierarchy Hierarchy makes software easier to understand we can proceed from leaf nodes (who do not use others) upwards They make software easier to build They make software easier to test

Hierarchy Organizes the modular structure through levels of abstraction Each level defines an abstract (virtual) machine for the next level level can be defined precisely Mi has level 0 if no Mj exists s.t. Mi r Mj let k be the maximum level of all nodes Mj s.t. Mi r Mj. Then Mi has level k+1

Interface vs. Implementation (1) To understand the nature of USES, we need to know what a used module exports through its interface The client imports the resources that are exported by its servers Modules implement the exported resources Implementation is hidden to clients

Interface vs. Implementation (2) Clear distinction between interface and implementation is a key design principle Supports separation of concerns clients care about resources exported from servers servers care about implementation Interface acts as a contract between a module and its clients

Information Hiding Basis for design (i.e. module decomposition) Implementation secrets are hidden to clients They can be changed freely if the change does not affect the interface Golden design principle INFORMATION HIDING Try to encapsulate changeable design decisions as implementation secrets within module implementations

How to Design Module Interfaces? Example: design of an interpreter for language MINI We introduce a SYMBOL_TABLE module provides operations to CREATE an entry for a new variable GET the value associated with a variable PUT a new value for a given variable the module hides the internal data structure of the symbol table the data structure may freely change without affecting clients

Interface Design Interface should not reveal what we expect may change later It should not reveal unnecessary details Interface acts as a firewall preventing access to hidden parts

Design Notations Notations allow designs to be described precisely They can be textual or graphic Two sample notations TDN (Textual Design Notation) GDN (Graphical Design Notation)

TDN & GDN Illustrate how a notation may help in documenting design Illustrate what a generic notation may look like Are representative of many proposed notations TDN inherits from modern languages, like Java, Ada, …

An Example

Example (cont.)

Benefits Notation helps describe a design precisely Design can be assessed for consistency having defined module X, modules R and T must be defined eventually if not  incompleteness R, T replace X  either one or both must use Y, Z

Example: A Compiler (Different From Earlier Example) module COMPILER exports procedure MINI (PROG: in file of char; CODE: out file of char); MINI is called to compile the program stored in PROG and produce the object code in file CODE implementation A conventional compiler implementation. ANALYZER performs both lexical and syntactic analysis and produces an abstract tree, as well as entries in the symbol table; CODE_GENERATOR generates code starting from the abstract tree and information stored in the symbol table. MAIN acts as a job coordinator. is composed of ANALYZER, SYMBOL_TABLE, ABSTRACT_TREE_HANDLER, CODE_GENERATOR, MAIN end COMPILER

Other Modules module MAIN uses ANALYZER, CODE_GENERATOR exports procedure MINI (PROG: in file of char; CODE: out file of char); … end MAIN module ANALYZER uses SYMBOL_TABLE, ABSTRACT_TREE_HANDLER exports procedure ANALYZE (SOURCE: in file of char); SOURCE is analyzed; an abstract tree is produced by using the services provided by the tree handler, and recognized entities, with their attributes, are stored in the symbol table. ... end ANALYZER

Other Modules module CODE_GENERATOR uses SYMBOL_TABLE, ABSTRACT_TREE_HANDLER exports procedure CODE (OBJECT: out file of char); The abstract tree is traversed by using the operations exported by the ABSTRACT_TREE_HANDLER and accessing the information stored in the symbol table in order to generate code in the output file. … end CODE_GENERATOR

GDN Description of Module X

X's Decomposition