1、Design Engineering,Spring 2014,Design Engineering,It covers the set of principles, concepts, and practices that lead to the development of a high quality system or product. Goal of design engineering is to produce a model or representation that depict: Firmness program should not have any bug that i
2、nhibits its functions. Commodity suitable to its intended use. Delight - pleasurable to use. The design model provides detail about software data structures, architecture, interfaces, and components that are necessary to implement the system.,Software Design,Software design model consists of 4 desig
3、ns: Data/class Design Architectural Design Interface Design Component Design,Translating Analysis Design,Why design is so important?,It is place where quality is fostered. It provides us with representation of software that can be assessed for quality. Only way that can accurately translate a custom
4、ers requirements into a finished software product. It serves as the foundation for all the software engineering and software support activities that follow. Without design difficult to assess: Risk Test Quality,Design Process and Design Quality,Software design is an iterative process through which r
5、equirements are translated into a “blueprint” for constructing the software. As design iteration occur, subsequent refinement leads to design representation at much lower levels of abstraction.,Goal of design process,The design must implement all of the explicit requirements contained in the analysi
6、s model, and it must accommodate all of the implicit requirements desired by the customer. The design must be a readable, understandable guide for those who generate code and for those who test and subsequently support the software. The design should provide a complete picture of the software, addre
7、ssing the data, functional, and behavioral domains from an implementation perspective.,Quality Guidelines,Characteristics of good design A design should exhibit an architecture that has been created using recognizable architectural styles or patterns is composed of components that exhibit good desig
8、n characteristics can be implemented in an evolutionary fashion A design should be modular; that is, the software should be logically partitioned into elements or subsystems. A design should contain distinct representations of data, architecture, interfaces, and components. A design should lead to d
9、ata structures that are appropriate for the classes to be implemented and are drawn from recognizable data patterns.,Quality Guidelines,A design should lead to components that exhibit independent functional characteristics. A design should lead to interfaces that reduce the complexity of connections
10、 between components and with the external environment. A design should be derived using a repeatable method that is driven by information obtained during software requirements analysis. A design should be represented using a notation that effectively communicates its meaning.,Design Principles,Softw
11、are design is both a process and a model. Design process - sequence of steps that enable the designer to describe all aspects of the software to be built. Design model - created for software and provides a variety of different views of the computer based software.,Design concepts,Design concepts pro
12、vide the necessary framework for “to get the thing on right way”. Abstraction Refinement Separation of Concerns Modularity Architecture Information Hiding Functional Independence Refactoring,Abstraction,When you consider a modular solution to any problems, many levels of abstraction can be posed. At
13、 the highest level of abstraction a solution is stated in broad terms using the language of the problem environment. At lower level of abstraction a more detailed description of the solution is provided. At the lowest level of abstraction, the solution is stated in a manner that can be directly impl
14、emented.,Abstraction,As different levels of abstraction are developed, you work to create both procedural and data abstractions. Two types of abstraction: Data abstraction: collection of data that describes a data object. Procedural abstraction: a sequence of instructions that have a specific and li
15、mited function.,Data Abstraction,implemented as a data structure,E.g. Open a door. door is data object. Data abstraction for door would encompass a set of attributes describing the door. (door type, swing direction, opening mechanism, etc.),Procedural Abstraction,implemented with a “knowledge“ of th
16、e object that is associated with enter.,E.g. Open a door: open implies long sequence of procedural steps.(walk to the door, grasp knob, turn knob and pull door, etc.),Refinement,Stepwise refinement is a top-down design strategy. Refinement is actually a process of elaboration. Begin with a statement
17、 of function (or description of information) that is defined at a high level of abstraction. The statement describes function or information conceptually but provides no information about the internal workings of the function or the internal structure of the information. Then provide more and more d
18、etail as each successive refinement (elaboration) occurs.,Refinement,Abstraction and refinement are complementary concepts. Abstraction enables a designer to specify procedure and data and yet suppress low-level details. Refinement helps the designer to expose low-level details as design progresses.
19、,Stepwise Refinement,Separation of Concerns,Any complex problem can be more easily handled if it is subdivided into pieces that can each be solved and/or optimized independently. A concern is a feature or behavior that is specified as part of the requirements model for the software. By separating co
20、ncerns into smaller, and therefore more manageable pieces, a problem takes less effort and time to solve. This lead to divide-and-conquer strategy: its easier to solve a complex problem when you break it into manageable pieces.,Modularity,Modularity is the most common manifestation of separation of
21、concerns. Software is divided into separately named and addressable components, sometimes called modules, which are integrated to satisfy problem requirement.,Modularity and Software Cost,Effort (cost) to develop an individual software module does decrease if total number of modules increase. Howeve
22、r as the number of modules grows, the effort (cost) associated with integrating the modules also grows.,Sizing Modules: Two Views,Modularity: Trade-offs,What is the “right“ number of modules,for a specific software design?,optimal number,of modules,cost of,software,number of modules,module integrati
23、on cost,module development cost,Modularity,We modularize a design so that development can be more easily planned. Software increments can be defined and delivered. Changes can be more easily accommodated. Testing and debugging can be conducted more efficiently and long-term maintenance can be conduc
24、ted without serious side effects.,Information Hiding,module,controlled,interface,“secret“, algorithm, data structure, details of external interface, resource allocation policy,a specific design decision,Information Hiding,Modules should be specified and designed so that information (algorithm and da
25、ta) contained within a module is inaccessible to other modules that have no need for such information. The intent is to hide the details of data structure and procedural processing behind a module interface. When modifications are required during testing and maintenance, unintentional errors introdu
26、ced during modification are less because data and procedure are hiding from other parts of software.,Why Information Hiding?,Reduce the likelihood of “side effects”. Limit the global impact of local design decisions. Emphasize communication through controlled interfaces. Discourage the use of global
27、 data. Lead to encapsulationan attribute of high quality design. Result in higher quality software.,Effective Modular Design,Effective modular design consist of three things: Functional Independence High cohesion Low coupling,Functional Independence,Functional independence is achieved by developing
28、modules with “single-minded“ function and an “aversion“ to excessive interaction with other modules. Each module addresses a specific sub-function of requirements and has a simple interface when viewed from other parts of the program structure. Independence is important Easier to develop Easier to t
29、est and maintain Error propagation is reduced Reusable module,Functional Independence,To summarize, functional independence is a key to good design, and design is the key to software quality. To measure independence, have two qualitative criteria: cohesion and coupling Cohesion is a measure of the r
30、elative functional strength of a module. Coupling is a measure of the relative interdependence among modules.,Cohesion,Cohesion is a natural extension of the information hiding concept. A cohesive module performs a single task within a software procedure, requiring little interaction with procedures
31、 being performed in other parts of a program. High cohesion is characterized by a module that performs one distinct procedural task.,Coupling,Coupling depends on the interface complexity between modules, the point at which entry or reference is made to a module, and what data pass across the interfa
32、ce. In software design, we strive for lowest possible coupling. Simple connectivity among modules results in software that is easier to understand and less prone to a “ripple effect“ caused when errors occur at one location and propagate through a system.,Coupling,“Control flag” (a variable that con
33、trols decisions in a subordinate or superordinate module) is passed between modules d and e (called control coupling).,Coupling,Coupling is characterized by passage of control between modules. Relatively high levels of coupling occur when modules communicate with external to software / infrastructur
34、e components e.g., operation system functions, database capability, telecommunication functions External coupling is essential, but should be limited to a small number of modules/components within a system.,Coupling,High coupling also occurs when a number of modules reference a global data area. How
35、ever, it does not mean “use of global data is bad”. It does mean that a software designer must be take care of this thing.,Refactoring,Refactoring is a reorganization technique that simplifies the design (or code) of a component without changing its function or behavior. “Refactoring is the process
36、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.”,Refactoring,When software is refactored, the existing design is examined for redundancy unused design elements inefficient or unnecessary algorithms poorl
37、y constructed or inappropriate data structures any other design failure these can be corrected to yield a better design.,Architecture,Architecture is the structure or organization of program components (modules), the manner in which these components interact, and the structure of data that are used
38、by the components. Components: in a broader sense, to represent major system elements and their interactions.,“The overall structure of the software and the ways in which the structure provides conceptual integrity for a system.”,Architecture,An architecture design should have a set of properties: 1
39、. Structural properties. Defines the components of a system (e.g., modules, objects, filters) and the manner in which those components are packaged and interact with one another. 2. Extra-functional properties. Should address how the design architecture achieves requirements for performance, capacit
40、y, reliability, security, adaptability, and other system characteristics.,Architecture,An architecture design should have a set of properties: 3. Families of related systems. Should draw upon repeatable patterns that are commonly encountered in the design of families of similar systems. In essence,
41、the design should have the ability to reuse architectural building blocks.,Architecture,Numbers of different models can be used to represent architecture. Structural models represent architecture as an organized collection of components Framework models Increase level of design abstraction by identi
42、fying repeatable architectural design framework. Dynamic models address behavior of the program architecture and indicate how structure or system configuration may change as a function of external events. Process models focus on design of the business or technical process that the system must accomm
43、odate. Functional models represent the functional hierarchy of a system.,What Is Architectural Design?,Architectural design represents the structure of data and program components that are required to build a computer based system. considers the architectural style that the system will take, the str
44、ucture and properties of the components that constitute the system, and the interrelationships that occur among all architectural components of a system.,Why Architecture?,Architecture is not the operational software. Rather, it is a representation that enables a software engineer to: analyze the ef
45、fectiveness of the design in meeting its stated requirements, consider architectural alternatives at a stage when making design changes is still relatively easy, reduce the risks associated with the construction of the software.,Why Is Architecture Important?,Representations of software architecture
46、 are an enabler for communication between all parties (stakeholders) interested in the development of a computer-based system. The architecture highlights early design decisions that will have a profound impact on all software engineering work that follows and, as important, on the ultimate success
47、of the system as an operational entity. Architecture “constitutes a relatively small, intellectually graspable model of how the system is structured and how its components work together” .,Architectural Genres,In the context of architectural design, genre implies a specific category within the overa
48、ll software domain. Within each category, you encounter a number of subcategories. Within each general style, more specific styles might apply. Each style would have a structure that can be described using a set of predictable patterns.,buildings,housescondosapartment buildingsoffice buildingsindust
49、rial buildingwarehouses ,Genre,Styles,Architectural Genres,The following architectural genres for software based system are suggested: Artificial intelligence Commercial and nonprofit Communications Content authoring Devices Entertainment and sports Financial Games Government Industrial,Legal Medica
50、l Military Operating systems Platforms Scientific Tools Transportation Utilities,Architectural Styles,Each style describes a system category that encompasses: a set of components (e.g., a database, computational modules) that perform a function required by a system. a set of connectors that enable “communication, coordination and cooperation” among components. constraints that define how components can be integrated to form the system. semantic models that enable a designer to understand the overall properties of a system by analyzing the known properties of its constituent parts.,