1 / 43

Chapter 9 CS 8532: Advanced Software Engineering Dr. Hisham Haddad

Chapter 9 CS 8532: Advanced Software Engineering Dr. Hisham Haddad. Class will start momentarily. Please Stand By …. Design Engineering Highlights of Software Design Concepts and Principles Chapter 9. What is Software Design?

rmims
Download Presentation

Chapter 9 CS 8532: Advanced Software Engineering Dr. Hisham Haddad

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 9 CS 8532: Advanced Software Engineering Dr. Hisham Haddad • Class • will • start • momentarily. • Please Stand By …

  2. Design Engineering Highlights of Software Design Concepts and Principles Chapter 9

  3. What is Software Design? Design is a technical activity during which customer requirements are transformed into architectural elements (blue print for the software to be built). - It is a representation form of a computer software - It answers the “how” question: How to realize the requirements? - It is iterative (refinement) process - Its representation can be assessed for quality (FTRs, Walkthroughs, informal meetings, etc…) - It is the basis for system flexibility, extensibility, portability, and reusability - It consists of process (sequence of steps) and a model (presentations of design elements)

  4. Software Design Challenges - Complexity: complexity factors, > nature of the system (having many states during execution) > complexity is arbitrary as it is dependent on the design rather than the problem. - Conformity: must conform to standards forced by other elements such as HW, existing software, external entities. - Invisibility: being invisible, > limits our ability to form a visual links with software system > limits our ability to conceptualize its characteristics - Changeability: Software tends to have constant need for changes.

  5. modeling Design Model (SDD) Design Process Specs Design’s decisions Constraints (resources, organizational, reuse, experience, etc..) Prototype The Big Picture - Process & Model

  6. Architectural design decisions Detailed design decisions Specs Logical design details Physical design details Another view* * Source: Software Engineering, 2nd ed., by David Budgen

  7. Good Design Guidelines - 1 A good design is based on design principles and employs design concepts throughout the design elements. - It should be iterative in nature (follow the design process) and is derived from requirements (traceable to requirements). - It should exhibit distinct representation for data, structure, interfaces, and components (present design components). - It should exhibit architectural structure with good design characteristics (reusable design patterns and easy to implement). - It should be modular (logical functional partitioning).

  8. Good Design Guidelines - 2 - It should lead to relevant data structures. - It should lead to functionally independent components (minimize coupling among modules). - It should lead to effective interfacing with external entities (minimize system complexity). - It should lead to flexible software (refinement and updates). - It should lead to portable software architecture (facilitate different platforms and future migrations) - It should lead to reusable systems (support evolution of domain applications)

  9. Design and Quality • The design must implement all explicit requirements of the analysis model, and must accommodate all implicit requirements desired by the customer. • The design must be a readable and understandable “guide” for the construction team (development and testing people). • The design should provide a complete picture of the software. That is, modeling the data, functional, and behavioral from implementation perspective.

  10. Design Principles - 1 Software design consists of a process and a model. - The design process should not suffer from ‘tunnel vision’ (explore your options) - The design should be traceable to the analysis model (addressing all customer requirements,explicit and implicit) - The design should not reinvent the wheel (use existing solution structures - design patterns) - The design should mimic the structure of the problem (completeness, quality assessment, testing, etc…) - The design should exhibit uniformity in style and format (i.e., it appears to be done by one person!)

  11. Design Principles - 2 - The design should exhibit well defined interfaces for components and external entities (ease of integration) - The design should be structured to accommodate change (ease of re-organization and additions) and to degrade gently (graceful termination of software) - Design is not coding, coding is not design (abstraction levels) - The design should be assessed for quality as it is being created, not after the fact. - The design should be reviewed to minimize conceptual errors (that is, semantic errors rather than syntax)

  12. Design Concepts Essential design concepts include: - Abstraction: data, procedure, control - Refinement: elaboration of detail for all abstractions - Modularity: compartmentalization of data and function - Software Architecture: overall structure of software components - Data Structures: logical relationships among data elements - Information Hiding: controlled interfaces/access - Functional Independence: high cohesion and low coupling - Patterns:”conveys the essence” of a proven design solution - Refactoring:reorganization technique that simplifies the design

  13. Abstraction Mutli-level details of the software design. Each level is a refinement of the previous level (data and procedures). At the highest level --> general description of the system At the lowest level --> creating source code Door Data Door Procedures Manufacturer Model number Material type Swing direction Color Weight etc… Open Door Close Door Lock Door

  14. repeat until door opens Walk to door; Reach for knob; Open door; Walk through; Close door; turn knob clockwise; if knob doesn't turn, then take key out; find correct key; insert in lock; endif pull/push door move out of way; end repeat Refinement Stepwise top-down elaboration of abstractions to reveal their detailed as design progresses. Refinement prevents omissions of details and facilitates design review. Refinement complements abstraction.

  15. easier to build, easier to change, easier to fix ... Modularity - 1

  16. Modularity - 2 Dividing the system into manageable functional components. A modular design is easier to build, to change, and to fix. Effective modular design is depended on the design method. Guidelines for method evaluation include: - Modular decomposability (support for sub-problems) - Modular compensability (allow reuse) - modular understandability (can a module stand on its own?) - Modular continuity (change impact contained to individual modules, not the entire system) - Modular protection (error impact is contained within the module where it occurred)

  17. module development cost cost of software module integration cost number of modules desired number of modules Modularity - 3 What is the right number of modules for a specific design?

  18. Software Architecture “The overall structure of the software and the ways in which that structure provides conceptual integrity for a system.” [SHA95a] Organization (structure) of components representing elements of the software and their interactions (Ch-10). Properties of an architectural design include: - Structural properties (components and interactions) - Extra-structural properties (performance/reliability/security…) - Families of related systems (reusable architectural building blocks - reusable subsystems and patterns)

  19. Data Structures Data structure is a representation of the logical relationship among data elements of a a data object. The logical relationship dictates the data structure complexity. - scalar structure: one data item structure - sequential (linear) structures: vectors (arrays) of data items - multi-dimension (non-linear) structure: array of data items The implementation view is the organization of data items in the computer memory during software execution. - contiguous storage - linked storage (linked lists)

  20. Module • algorithm Controlled Interface • data structure • details of external interface • resource allocation policy clients "secrets" specific design decisions Information Hiding - 1 It calls for hiding maximum information (procedures and data) from other modules to provide controlled access.

  21. Information Hiding - 2 Some benefits: - Reduces the likelihood of “side effects” - Limits the global impact of local design decisions - Emphasizes communication through controlled interfaces - Discourages the use of global data - Leads to encapsulation - an attribute of high quality design - Results in higher quality software - Facilitates maintainability

  22. Functional Independence Functional independence is the outcome of abstraction, modularity, and information hiding. An independent function is one that performs (implements) a well-defined function (sub-function) of the software with high cohesion and low coupling. Cohesion measures the degree to which a module performs one and only one function/task with little interactions with other modules. Coupling measures the degree to which a module is connected to (dependent on) other modules in the system.

  23. Design Patterns Design Pattern Template (handout and slides are posted) Pattern name: Describes the essence of the pattern in a expressive name Intent: describes the pattern and what it does Also-known-as: lists any synonyms for the pattern Motivation: provides an example of the problem Applicability: notes specific design situations in which the pattern is applicable Structure: describes the classes that are required to implement the pattern Participants: describes the responsibilities of the classes that are required to implement the pattern Collaborations: describes how the participants collaborate to carry out their responsibilities Consequences: describes the “design forces” that affect the pattern and the potential trade-offs that must be considered when the pattern is implemented Related patterns: cross-references related design patterns.

  24. Refactoring Fowler [FOW99] defines Refactoring in the following manner: "Refactoring is the process of changing a software system in such a way that it does not alter the external behavior of the code [design] yet improves its internal structure.” During refactoring, the design is examined for : - Redundancy - Unused design elements - Inefficient or unnecessary algorithms - Poorly constructed or inappropriate data structures - Any other design failure that can be corrected to yield a better design.

  25. Elements of Structured Design Data Design: Creating data structures. (use data dictionary and ERD information) Architectural Design: Creating the software framework, that is processing components that transform inputs to outputs. (use high-level DFD information and design patterns) Interface Design: Creating elements (interfaces) that glue the pieces of the architecture. (use DFD, CFD and STD information) Component Design: Creating algorithmic details for individual components of the architecture. (use DFD, CDF and STD information)

  26. Component design DFD ERD Data Dictionary a i n t e r f c e d e s i g n a r c h i t e c t u r a l d e s i g n STD d a t a d e s i g n Mapping Structured Analysis to Design

  27. OOD: Generic Components - Problem Domain Component: The subsystems that are responsible for implementing customer requirements directly. - Human Interaction Component: The subsystems that implement the user interface (this included reusable GUI subsystems). - Task Management Component: The subsystems that are responsible for controlling and coordinating concurrent tasks that may be packaged within a subsystem or among different subsystems. - Data Management Component: The subsystem that is responsible for the storage and retrieval of objects.

  28. OO Analysis OO Design Implementation OO Testing Deployment OO Analysis OO Design Implementation OO Testing Deployment Object Relationship Modeling Class Design Sub-System Design Class Modeling Object Behavior Modeling Responsibilities Design Message Design OOA and OOD - 1

  29. Design Model Analysis Model Classes Attributes Methods Relationships Behavior Objects Data Structures Algorithms Messaging Control OOA and OOD - 2 Another mapping view:

  30. Attributes Operations Collaborators Responsibilities Design Object Relatio- nships Class Model Message Design Use Cases Class/Object Design Object Behavior Model Design Patterns (domain Objects) Subsystem Design Mapping OO Analysis to OO Design

  31. OOD Layers - 1 - Design Patterns: Deals with reusable designs (domain objects). (repeated (reusable) classes and objects that found to solve specific design problems, e.g., user login and authentication, integrated circuit, car air-condition system, shopping cart, etc…) - Subsystem Design: Deals with subsystems that form the overall system architecture. (detailed design of self-contained and highly-independent groups of classes that define specific requirements (major functions of the system))

  32. OOD Layers - 2 - Class/Object Design: Deals with relationships among classes that define each subsystem. (detailed design of inheritance hierarchies for subsystems) - Message Design: Deals with internal and external interface design. (detailed design of messages exchanged among objects and interactions between system objects and external entities) - Responsibilities Design: Deals with data structures and algorithm design. (internal detailed design of each class - its attributes and operations)

  33. OO Design Concepts • Design classes • Entity classes • Boundary classes • Controller classes • Inheritance: All responsibilities of a superclass is immediately inherited by all subclasses • Messages: Stimulate some behavior to occur in the receiving object • Polymorphism: A characteristic that greatly reduces the effort required to extend the design

  34. Design Classes • Analysis classes are refined during design to become entity classes. • Boundary classesare developed during design to create the interface (e.g., interactive screen or printed reports) that the user sees and interacts with as the software is used. - Boundary classes are designed with the responsibility of managing the way entity objects are represented to users. • Controller classesare designed to manage • The creation or update of entity objects; • The instantiation of boundary objects as they obtain information from entity objects; • Complex communication between sets of objects; • Validation of data communicated between objects or between the user and the application.

  35. Inheritance Design options: - The class can be designed and built from scratch. That is, inheritance is not used. - The class hierarchy can be searched to determine if a class higher in the hierarchy (a superclass) contains most of the required attributes and operations. The new class inherits from the superclass and additions may then be added, as required. - The class hierarchy can be restructured so that the required attributes and operations can be inherited by the new class. - Characteristics of an existing class can be overridden and different versions of attributes or operations are implemented for the new class.

  36. :SenderObject : message (<parameters>) :ReceiverObject : Messages

  37. Polymorphism Conventionalapproach … case of graphtype: if graphtype = linegraph then DrawLineGraph (data); if graphtype = piechart then DrawPieChart (data); if graphtype = histogram then DrawHisto (data); if graphtype = kiviat then DrawKiviat (data); end case; With polymorphism, all of the graphs become subclasses of a general class called graph. Using overloading, each subclass defines an operation called draw. An object can send a draw message to any one of the objects instantiated from any one of the subclasses. The receiving object invokes its own draw operation to create the appropriate graph.

  38. Design Model Elements - 1 • Data element • Data model  data structures (at component level) • Data model  database architecture (at application level) • Data model  data warehouse (at business level) • Data structures influence the software architectural • Architectural element (floor plan) An architecture is derived from: • Application domain • Analysis model (classes, their relationships, collaborations and behaviors) • Patterns and “architectural styles” (Chapter 10)

  39. Design Model Elements - 2 • Interface design element It is the design of interactions with the system, including: • the user interface (GUI elements) (Chapter 12) • external interfaces to other systems, devices, networks, … • internal interfaces between various design components. • Component elements It’s the design of internal data and algorithms details of classes. • Deployment elements It’s the design of the physical environment where the system will be hosted and supported (networks, servers, users, locations, etc…) (see figure 9.7, page 247)

  40. Design Patterns - 1 • A good designers has the ability to identify “patterns” that characterize a problem and corresponding patterns that can be combined to create a solution. • A description of a design pattern may include design forces. • Design forces describe non-functional requirements (environment and conditions) needed to apply design patterns. (e.g., ease of maintainability, portability, usability) • The pattern characteristics (classes, responsibilities, and their collaborations) indicate attributes that may be adjusted to enable the pattern to accommodate different problems.

  41. Design Patterns - 2 • Reusable patterns include: • Architectural patterns: ways (styles) to structure elements (components) of a software system. • Design Patterns: ways to solve design-specific issues. (see posted design pattern handout and slides) • Coding patterns (idioms): language-specific patterns to address coding-specific issues

  42. Frameworks • A framework is not an architectural pattern, but rather a “code skeleton with a collection of “plug points” (also called hooksand slots) that allows designers/developers to adapt it to a specific domain of applications. They are applied without changes. • Gamma et al note that: • Design patterns are more abstract than frameworks. • Design patterns are smaller architectural elements than frameworks. • Design patterns are less specialized than frameworks.

  43. Suggested Problems Consider working the following problems from the end of chapter 9, page 251, for practice purpose: 9.1, 9.2, 9.3, 9.5, 9.7, 9.8, 9.9, 9.10, and 9.11 No submission is required. Think about these problems and work them for yourself!

More Related