<<

„ Design activity begins with a set of requirements Design „ Design done before the system is implemented „ Design is the intermediate language between requirements and code „ Moving from problem domain to solution domain „ Proceeding from abstract to more concrete representations „ Result is the design to be used for implementing the system

CSIS0521 1 CSIS0521 Software Design 2

Design… Levels in Design Process

„ Design is a creative activity „ Architectural design „ Goal: to create a plan to satisfy requirements „ Identifies the components needed for the „ Perhaps the most critical activity during system, their behavior, and relationships

system development „ We have already discussed it „ Design determines the major characteristics „ High Design of a system „ Really is the module view of the system „ Has great impact on testing and maintenance „ I.. what modules are in the system and „ Design document forms reference for later how they are organized phases

CSIS0521 Software Design 3 CSIS0521 Software Design 4

Levels.. Design Methodologies

„ Many possibilities for design, methodologies aim to „ Logic design reduce search „ Components and modules are designed to satisfy „ Provide some discipline for handling complexity their specs „ Most methodologies deal with high level design „ How to implement components „ Provide a set of rules for guiding the „ for implementing component are „ Rules do not reduce design to a sequence of designed mechanical steps „ Many methodologies exist „ Different methodologies may be useful for different „ Complete design: the architectural design, applications the high level design, and Logic design of each component

CSIS0521 Software Design 5 CSIS0521 Software Design 6

1 Design Objectives

„ Goal is to find the best possible design „ Correctness is the most fundamental „ Have to explore different „ Does design implement requirements? „ Evaluation criteria are often subjective and non „ Is design feasible, given the constraints? quantifiable

„ Major criteria to evaluate a design „ Correctness „ Efficiency „ Efficiency „ Concerned with the proper use of scarce resources - „ processor & memory „ Cost „ Other factors same, efficiency should be maximized

CSIS0521 Software Design 7 CSIS0521 Software Design 8

Design Principles

„ Maintainability „ Design is a creative process

„ Most important quality criteria „ How to create a design from abstract requirements „ Most affected by architectural design „ There are principles for guiding during design „ Should facilitate testing „ Two fundamental principles in the design process „ Should facilitate discovery and correction of bugs „ Problem partition „ modifying the system easier „ Abstraction „ Cost

„ For same quality, minimize cost

„ Design costs are quite

„ Should try to minimize cost in later phases

CSIS0521 Software Design 9 CSIS0521 Software Design 10

Problem Partitioning Abstraction

„ Basic principle "divide and conquer" „ Necessary for partitioning

„ Divide the problem into manageably small pieces „ Used in all disciplines „ Each piece can be solved separately „ Abstraction of existing components „ Each piece can be modified separately „ Represents components as black boxes „ Pieces can be related to the application „ Hides the details, provide external behavior „ Pieces cannot be independent; they must communicate „ Useful for understanding existing systems „ Necessary for using systems „ Communication adds complexity „ Useful for determining design of existing systems „ As number of components increases, this cost increases „ Stop partitioning when cost is more than benefit

CSIS0521 Software Design 11 CSIS0521 Software Design 12

2 Functional Abstraction

„ Abstraction during design process „ Employs parameterized subprograms „ Specifies the functional behavior of a module „ To decide how components interact, the designer specifies the external behavior of components „ Module is treated as a input/output function

„ Allows concentrating on one component at a time „ Most languages provide features to support this eg functions, procedures „ Permits a component to be considered without worrying about others „ A functional module can be specified using pre and post conditions „ Allows designer to control the complexity

„ Permits gradual transition from abstract to concrete

CSIS0521 Software Design 13 CSIS0521 Software Design 14

Data Abstraction Top-Down vs Bottom-up Design

„ Top down design starts with the system specifications „ An entity in the real world provides some services to the environment it belongs „ Defines a module to implement the specs „ Specifies subordinate modules „ Similar is the case of data entities „ Then treats each specified module as the problem „ Certain operations are required from a data object „ proceeds till bottom level modules „ The internals are not of consequence reached „ Data abstraction supports this view „ At each stage a clear picture of design exists „ Data is treated as a set of pre-defined operations „ Most natural for handling complex problems „ Only operations can be performed on the objects „ Have been propagated by many „ Internals are hidden and protected „ „ Modern languages support data abstraction eg. Ada, Many design methodologies based on this ++, Java „ Feasibility is not know till the end

CSIS0521 Software Design 15 CSIS0521 Software Design 16

Modularity

„ A concept closely tied to abstraction „ In bottom up we start by designing bottom modules „ Modularity supports independence of models „ Building blocks Layers or abstraction or virtual „ Modules support abstraction in software machines „ Supports hierarchical structuring of programs „ Necessary if existing modules have to be reused „ Modularity enhances design clarity, eases „ Pure top-down or bottom-up is not possible implementation „ Reduces cost of testing, and „ In bottom-up must have some idea of the top maintenance „ Often a combination is used „ Cannot simply chop a program into modules to get modularly „ Need some criteria for decomposition: coupling and cohesion.

CSIS0521 Software Design 17 CSIS0521 Software Design 18

3 Detailed Design

„ HLD does not specify module logic „ One way to communicate a design: use natural „ This is done during detailed

„ Logic (PDL) can also be used for „ Is imprecise and can lead to misunderstanding detailed design of modules „ Other extreme is to use a „ Such representations often have a lot of detail, „ PDL can be used to specify the complete design - „ necessary for implementation, but architectural as well as logic design „ not important for communicating the design „ The degree of detail desired is decided by the „ These details are often a hindrance to designer understanding

CSIS0521 Software Design 19 CSIS0521 Software Design 20

„ Ideally would like a language that is „ E.g.. determine the min and max of a set of numbers

„ as precise as possible „ A design in PDL is: „ Does not need too much detail, minmax (in file) „ target language independent ARRAY a

„ can be easily converted in to an implementation DO UNTIL end of input READ an item into a „ This is what PDL attempts to do. ENDDO „ PDL has outer syntax of a structure programming max, min: = first item of a language, but vocabulary of a natural language DO FOR each item in a IF max < item THEN set max to item „ It can be thought as "structured english" IF min > item THEN set min to item „ Some automated processing can be done on PDL ENDDO END

CSIS0521 Software Design 21 CSIS0521 Software Design 22

Design Verification

„ The entire logic is described „ Main objective: does the design

„ Few implementation details implement the requirements

„ For implementation, the pseudo statements „ Analysis for performance, efficiency, etc will have to be converted into programming may also be done language statements „ If formal languages used for design „ PDL allows a successive refinement approach representation, tools can help

„ Encourages use of structured language „ Design reviews remain the most constructs common approach for verification

CSIS0521 Software Design 23 CSIS0521 Software Design 24

4 Summary

„ Design is a creative activity „ Goal is to find the best possible design „ Two levels in the design process „ Architectural design and logic design „ Correctness of design is most fundamental property „ Design principles „ Problem partitioning „ Abstraction „ When using functional abstraction aim for „ Low coupling „ High cohesion „ Design Methodologies - a set of rules/steps to guide the designer CSIS0521 Software Design 25

5