0% found this document useful (0 votes)
14 views4 pages

Software Design Principles and Practices

The design phase of software development transforms the Software Requirements Specification into a structured design document, focusing on module structure, control relationships, and algorithms. Good software design emphasizes high cohesion, low coupling, and modularity, while employing iterative processes and clear hierarchies. Both function-oriented and object-oriented design approaches are valuable, with each offering unique benefits in structuring software systems.

Uploaded by

Apoorv Verma
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views4 pages

Software Design Principles and Practices

The design phase of software development transforms the Software Requirements Specification into a structured design document, focusing on module structure, control relationships, and algorithms. Good software design emphasizes high cohesion, low coupling, and modularity, while employing iterative processes and clear hierarchies. Both function-oriented and object-oriented design approaches are valuable, with each offering unique benefits in structuring software systems.

Uploaded by

Apoorv Verma
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Software Design – Perfect Notes (Week 5)

1. Purpose of Design Phase

 Transforms the SRS (Software Requirements Specification) into a design document


that can be implemented in code.

 Main outputs: module structure, control relationships, interfaces, data structures,


and algorithms for each module.

2. What is a Module?

 A module contains related functions and associated data structures.

 Modules are the building blocks of software design.

3. Design Process: Iterative Nature

 Good designs are rarely achieved in one step; they require several iterations and
refinements.

 Design is divided into two main stages:

o High-level (Preliminary) Design: Identifies modules, their relationships, and


interfaces (results in program architecture).

o Detailed Design: Specifies data structures and algorithms for each module
(results in module specifications).

4. Characteristics of Good Software Design

 Implements all required functionalities correctly.

 Easily understandable (improves maintainability and reduces errors).

 Efficient in terms of performance and resource use.

 Easily modifiable (amenable to change).

5. Improving Understandability

 Use consistent, meaningful names for design components.

 Decompose the system into well-defined, independent modules (modularity).


 Arrange modules in a clear hierarchy (layering).

6. Modularity

 Divides a problem into independent modules (divide and conquer principle).

 Independent modules are easier to understand, develop, and maintain.

 Hierarchical arrangement (layering) helps manage complexity.

7. Cohesion and Coupling

 Cohesion: Measures how strongly the elements within a module are related.

o High cohesion = module does one well-defined task.

 Coupling: Measures the degree of interdependence between modules.

o Low coupling = modules interact minimally.

 Goal: High cohesion, low coupling (functional independence).

Types of Cohesion (from weakest to strongest):

 Coincidental: Unrelated tasks grouped together.

 Logical: Similar operations grouped (e.g., all input functions).

 Temporal: Tasks executed in the same time span (e.g., initialization).

 Procedural: Tasks that must be done in a specific order.

 Communicational: Tasks operate on the same data.

 Sequential: Output of one task is input to the next.

 Functional: All elements contribute to a single, well-defined function.

Types of Coupling (from weakest to strongest):

 Data Coupling: Modules share only necessary data (parameters).

 Stamp Coupling: Modules share composite data structures.

 Control Coupling: One module controls the flow of another (e.g., flags).

 Common Coupling: Modules share global data.

 Content Coupling: One module directly modifies or relies on the internal workings
of another.
8. Advantages of Functional Independence

 Easier to understand and maintain.

 Reduces error propagation between modules.

 Facilitates module reuse in other programs.

9. Measuring Cohesion and Coupling

 No precise quantitative measures, but classification helps estimate quality.

 Aim for modules with high cohesion and low coupling.

10. Hierarchical Design and Module Structure

 Control Hierarchy: Tree-like structure showing which modules control others.

 Fan-out: Number of modules directly controlled by a module (should be low).

 Fan-in: Number of modules that call a given module (high fan-in is good for reuse).

 Layering: Modules at one layer only call modules in the layer below.

11. Abstraction

 Lower-level modules handle detailed tasks; upper-level modules handle


management.

 Layered design: lower modules do not call higher modules.

12. Design Approaches

 Function-Oriented Design:

o System is seen as a set of functions.

o Functions are refined into sub-functions (top-down decomposition).

o State is centralized and accessible to all functions.

 Object-Oriented Design (OOD):

o System is seen as a collection of objects (entities with data and behavior).

o State is decentralized; each object manages its own data.

o Objects communicate via message passing.


o Classes group similar objects; inheritance allows sharing features.

Key Differences:

 Function-oriented: focus on functions (verbs), centralized data.

 Object-oriented: focus on objects/entities (nouns), distributed data.

 OOD is often used for overall system structure, with function-oriented techniques for
internal methods.

13. Summary

 Design phase transforms requirements into a structured, implementable plan.

 Good design = high cohesion, low coupling, clear hierarchy, and modularity.

 Both function-oriented and object-oriented approaches are valuable and often


complementary.

Common questions

Powered by AI

Hierarchical arrangement, or layering, helps manage design complexity by decomposing the system into manageable layers where each module in a layer only communicates with modules in the layer below it. This limits interdependencies and simplifies understanding of the system as each module is responsible for a specific layer of functionality, reducing cognitive load. This hierarchy clarifies control flow, and managing complexity becomes easier since changes in one layer have limited impact on others .

The iterative nature of the design process is important because it allows incremental refinement and improvement of the design. Initial designs are often inadequate due to unforeseen issues and complexities, so iterations enable designers to refine module structures, interfaces, and data handling methods, addressing any identified flaws. This approach encourages continuous improvement, ensuring that the design can be adjusted to conform closely to the SRS and meet user needs effectively .

Layering aids in achieving abstraction by structuring the software into levels where each layer provides specific services to the layer above while hiding its implementation details from the layers below. This promotes separation of concerns, where higher-level layers focus on high-level management and lower-level layers handle detailed operational tasks. Layering is significant as it enhances flexibility and maintainability; changes in one layer have limited impact on others, allowing for isolated optimizations and adjustments without disrupting the entire system .

Fan-in and fan-out are concepts that influence module design by dictating the number of interactions a module has, which impacts system complexity and manageability. A low fan-out, meaning a module controls a small number of other modules, is preferred as it limits complexity, making modules simpler and more isolated in terms of functionality. A high fan-in, on the other hand, means a module is called by many other modules, enhancing reusability since this central module provides a common function needed by multiple parts of the software .

Function-oriented design views the system as a collection of functions with centralized state data, focusing on functionality and top-down decomposition into sub-functions. Object-oriented design approaches view the system as a collection of decentralized objects that encapsulate both state and behavior, promoting modularity and reuse through classes and inheritance. Overall, function-oriented design emphasizes processes (verbs), while object-oriented design centers on entities (nouns) and their interactions, often using both to complement each other in achieving a well-rounded design structure .

Modularity offers several advantages, including simplified development and maintenance by dividing complex problems into manageable, independent modules. This separation of concerns helps developers focus on individual components without being overwhelmed by the entire system. Modularity also enhances maintainability as changes can be localized within modules, reducing the risk of introducing errors. It facilitates parallel development, where different teams can work on different modules simultaneously, and improves reusability as well-defined modules can be integrated into new systems .

High coupling implies a strong interdependence between modules, resulting in increased error propagation, as changes or errors in one module can directly affect others. This interconnectivity leads to a rigid system, hindering flexibility since modifying one part often necessitates changes in connected modules, complicating maintenance and leading to higher likelihoods of bugs. Reducing coupling is therefore crucial for promoting system resilience and adaptability .

The main outputs of the software design phase include the module structure, control relationships, interfaces, data structures and algorithms for each module. These outputs contribute to the implementation process by providing a detailed blueprint that guides programmers in writing the code. The module structure helps in organizing the software development logically, interfaces define interactions between modules, data structures are essential for data management, and algorithms specify the logic for module functioning, enabling systematic code development .

Data coupling occurs when modules interact by passing only necessary data (parameters), which helps maintain module independence and minimizes side effects, supporting good design practices. Control coupling, on the other hand, involves one module controlling another's execution through mechanisms like flags, which creates dependence between modules, complicating error tracking and reducing maintainability. High control coupling can lead to tightly bound systems that are difficult to modify without extensive refactoring .

Cohesion plays a crucial role in achieving functional independence by ensuring that all elements of a module are focused on completing a single task or function. High cohesion implies that a module's components tightly relate to and complement each other, which simplifies maintenance and enhances reusability. Functional independence is achieved when modules are highly cohesive with low coupling, reducing error propagation and easing module reuse, ultimately improving the software's robustness and adaptability .

You might also like