Software Design Principles
Software Design Principles
Software design principles are concerned with providing means to handle the
complexity of the design process effectively. Effectively managing the complexity
will not only reduce the effort needed for design but can also reduce the scope of
introducing errors during design.
Problem Partitioning
For software design, the goal is to divide the problem into manageable pieces.
Note: As the number of partition increases = Cost of partition and complexity increases
Abstraction
An abstraction is a tool that enables a designer to consider a component at an
abstract level without bothering about the internal details of the
implementation. Abstraction can be used for existing elements as well as the
component being designed.
Functional Abstraction
1. A module is specified by the method it performs.
2. The details of the algorithm to accomplish the functions are not visible to the user
of the function.
Functional abstraction forms the basis for Function oriented design approaches.
Data Abstraction
Details of the data elements are not visible to the users of data. Data Abstraction
forms the basis for Object Oriented design approaches.
Modularity
Modularity specifies the division of software into separate modules which are
differently named and addressed and are integrated later on in order to obtain
the completely functional software. It is the only property that allows a program
to be intellectually manageable. Single large programs are difficult to understand
and read due to a large number of reference variables, control paths, global
variables, etc.
Advantages of Modularity
Disadvantages of Modularity
Modular Design
Modular design reduces the design complexity and results in easier and faster
implementation by allowing parallel development of various parts of a system.
We discuss a different section of modular design in detail in this section:
The use of information hiding as design criteria for modular system provides the
most significant benefits when modifications are required during testing's and
later during software maintenance. This is because as most data and procedures
are hidden from other parts of the software, inadvertent errors introduced during
modifications are less likely to propagate to different locations within the
software.
Strategy of Design
A good system design strategy is to organize the program modules in such a
method that are easy to develop and latter too, change. Structured design
methods help developers to deal with the size and complexity of programs.
Analysts generate instructions for the developers about how code should be
composed and how pieces of code should fit together to form a program.
1. Top-down Approach: This approach starts with the identification of the main
components and then decomposing them into their more detailed
sub-components.
2. Bottom-up Approach: A bottom-up approach begins with the lower details and
moves towards up the hierarchy, as shown in fig. This approach is suitable in case
of an existing system.
Coupling and Cohesion
Module Coupling
A good design aims for low coupling, which is evaluated by the number of
interconnections and the amount of shared data between modules. As the
degree of coupling increases, so does the likelihood of errors.
1. No Direct Coupling: Modules are unrelated and do not directly interact.
2. Data Coupling: Modules pass only simple data values to each other.
3. Stamp Coupling: Modules share complex data structures, such as objects
or structures.
4. Control Coupling: Data from one module controls the flow of another
module.
5. External Coupling: Modules share externally imposed data formats or
communication protocols.
6. Common Coupling: Modules share data through global variables.
7. Content Coupling: One module directly accesses or modifies another
module’s data or behavior.
Module Cohesion
Cohesion measures how closely related the tasks within a single module are.
High cohesion indicates that the module’s functionality is tightly related, making
it more reliable and maintainable.
Goal Aim for low coupling to Aim for high cohesion for
minimize dependencies focused functionality
In software design, low coupling and high cohesion are preferred as they
contribute to a modular, maintainable, and robust system.
Top-Down Design
Bottom-Up Design
K is the total effort expended (in PM) in product development, and L is the
product estimate in KLOC .
Ck Is the state of technology constant and reflects requirements that impede the
development of the program.
Typical values of Ck = 2 for poor development environment
The exact value of Ck for a specific task can be computed from the historical data
of the organization developing it.
Putnam proposed that optimal staff develop on a project should follow the
Rayleigh curve. Only a small number of engineers are required at the beginning
of a plan to carry out planning and specification tasks. As the project progresses
and more detailed work are necessary, the number of engineers reaches a peak.
After implementation and unit testing, the number of project staff falls.
Where, K is the total effort expended (in PM) in the product development
Ck Is the state of technology constant and reflects constraints that impede the
progress of the program
The Rayleigh Curve shows that a gradual increase in resources early on, a peak at
mid-project, and a decrease as the project nears completion leads to an efficient
allocation of effort. By aligning staffing levels with the project's needs at each
phase, this curve helps optimize productivity, minimize costs, and avoid resource
wastage.
A PERT (Program Evaluation and Review Technique) chart is a project
management tool used to visualize the timeline and dependencies of a project. It
helps in planning and scheduling tasks, assessing the minimum time required to
complete a project, and identifying critical paths and potential bottlenecks. PERT
charts are particularly useful for complex projects with multiple interdependent
tasks.
1. List All Tasks: Identify all tasks required to complete the project.
2. Determine Dependencies: Determine which tasks depend on the
completion of other tasks.
3. Estimate Time for Each Task: Use optimistic, most likely, and pessimistic
times to calculate the expected time for each task.
4. Draw the Chart: Represent each task as a node and use arrows to show
dependencies.
5. Identify the Critical Path: The longest path through the network (in terms
of time) is the critical path, showing the shortest time to complete the
project.
Let’s say we have a project to launch a new product, and the tasks involved are as
follows:
Tas Description Dependen Optimistic Most Likely Pessimistic
k cies (O) (M) (P)
1.
Calculate Expected Times (TE) for Each Task:
○ Task A: TE=1+4(2)+46=2.17TE = \frac{1 + 4(2) + 4}{6} =
2.17TE=61+4(2)+4=2.17 weeks
○ Task B: TE=2+4(4)+66=4TE = \frac{2 + 4(4) + 6}{6} = 4TE=62+4(4)+6=4
weeks
○ Task C: TE=2+4(3)+56=3.17TE = \frac{2 + 4(3) + 5}{6} =
3.17TE=62+4(3)+5=3.17 weeks
○ Task D: TE=1+4(2)+36=2TE = \frac{1 + 4(2) + 3}{6} = 2TE=61+4(2)+3=2
weeks
○ Task E: TE=1+4(3)+46=3TE = \frac{1 + 4(3) + 4}{6} = 3TE=61+4(3)+4=3
weeks
○ Task F: TE=1+4(2)+36=2TE = \frac{1 + 4(2) + 3}{6} = 2TE=61+4(2)+3=2
weeks
2. Draw the PERT Chart:
○ Start with Task A, which has no dependencies.
○ Tasks B and E depend on Task A.
○ Task C depends on Task B.
○ Task D depends on Task C, and Task F depends on both D and E.
3. Identify the Critical Path:
○ The critical path is the sequence of dependent tasks that has the
longest duration, as it determines the minimum project completion
time.
○ In this case, the path A → B → C → D → F is the critical path with a total
time of 2.17+4+3.17+2+2=13.342.17 + 4 + 3.17 + 2 + 2 =
13.342.17+4+3.17+2+2=13.34 weeks.
Using a PERT chart, project managers can make more informed decisions about
resource allocation, timelines, and identifying tasks that need additional focus to
avoid delays.
1.
Calculate Expected Times (TE) (already provided in the table).
2. Draw the Network Diagram:
○ Start with Task A.
○ Tasks B and E depend on A.
○ Task C depends on B.
○ Task D depends on C, and Task F depends on both D and E.
3. Calculate Earliest Start (ES) and Earliest Finish (EF):
○ Task A: ES = 0; EF = 2.17
○ Task B: ES = 2.17; EF = 2.17 + 4 = 6.17
○ Task C: ES = 6.17; EF = 6.17 + 3.17 = 9.34
○ Task D: ES = 9.34; EF = 9.34 + 2 = 11.34
○ Task E: ES = 2.17; EF = 2.17 + 3 = 5.17
○ Task F: ES = max(EF of D, EF of E) = 11.34; EF = 11.34 + 2 = 13.34
4. Calculate the Critical Path:
○ The critical path is the longest path from start to finish, with no slack.
○ From the calculations, Path A → B → C → D → F has the longest
duration:
2.17+4+3.17+2+2=13.342.17 + 4 + 3.17 + 2 + 2 = 13.342.17+4+3.17+2+2=13.34
weeks.
5. Conclusion:
○ The critical path is A → B → C → D → F, and the total time to complete
the project along this path is 13.34 weeks.
○ Tasks on this path have zero float, meaning any delay in these tasks
will delay the entire project.
Summary
In this example, the critical path ensures that project managers focus on the
sequence A → B → C → D → F as it determines the project’s completion time.
Monitoring these tasks closely will help in managing time effectively and keeping
the project on track.