Module 1
Module 1
Software Design
Software design is a mechanism to transform user requirements into some suitable
form, which helps the programmer in software coding and implementation. It deals
with representing the client's requirement, as described in SRS (Software Requirement
Specification) document, into a form, i.e., easily implementable using programming
language.
The software design phase is the first step in SDLC (Software Design Life Cycle),
which moves the concentration from the problem domain to the solution domain. In
software design, we consider the system to be a set of components or modules with
clearly defined behaviors & boundaries.
Page | 2
Software System & Design Unit - I Semester I B. Tech (CSE) 2028
2. Completeness: The design should have all components like data structures,
modules, and external interfaces, etc.
Page | 3
Software System & Design Unit - I Semester I B. Tech (CSE) 2028
Problem Partitioning
For small problem, we can handle the entire problem at once but for the significant
problem, divide the problems and conquer the problem it means to divide the
problem into smaller pieces so that each piece can be captured separately. For software
design, the goal is to divide the problem into manageable pieces.
These pieces cannot be entirely independent of each other as they together form the
system. They have to cooperate and communicate to solve the problem. This
communication adds complexity.
Abstraction
Page | 4
Software System & Design Unit - I Semester I B. Tech (CSE) 2028
1. Functional Abstraction
2. Data Abstraction
Functional Abstraction
i. A module is specified by the method it performs.
ii. 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 to the division of software into separate modules which are
differently named and addressed and are integrated later on 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.
o Each module is a well-defined system that can be used with other applications.
Page | 5
Software System & Design Unit - I Semester I B. Tech (CSE) 2028
o More linkage required, run-time may be longer, more source lines must be
written, and more documentation has to be done
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
Page | 6
Software System & Design Unit - I Semester I B. Tech (CSE) 2028
other parts of the software, inadvertent errors introduced during modifications are
less likely to propagate to different locations within the software.
1. Top-down Approach
2. Bottom-up Approach
1. Top-down Approach: This approach starts with the identification of the main
components and then decomposing them into their more detailed sub-
components.
We know that a system is composed of more than one sub-systems and it contains
a number of components. Further, these sub-systems and components may have
their one set of sub-system and components and creates hierarchical structure in
the system.
Top-down design takes the whole software system as one entity and then
decomposes it to achieve more than one sub-system or component based on some
characteristics. Each sub- system or component is then treated as a system and
decomposed further. This process keeps on running until the lowest level of
system in the top-down hierarchy is achieved. Top-down design starts with a
generalized model of system and keeps on defining the more specific part of it.
When all components are composed the whole system comes into existence. Top-
down design is more suitable when the software solution needs to be designed
from scratch and specific details are unknown.
Page | 7
Software System & Design Unit - I Semester I B. Tech (CSE) 2028
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.
The bottom up design model starts with most specific and basic components. It
proceeds with composing higher level of components by using basic or lower level
components. It keeps creating higher level components until the desired system is not
evolved as one single component. With each higher level, the amount of abstraction is
increased. Bottom-up strategy is more suitable when a system needs to be created
from some existing system, where the basic primitives can be used in the newer
system.
Both, top-down and bottom-up approaches are not practical individually. Instead, a
good combination of both is used.
There are multiple variants of software design. Few of them are discussed as
follows::
Page | 8
Software System & Design Unit - I Semester I B. Tech (CSE) 2028
Structured Design
Structured design is a conceptualization of problem into several well-organized
elements of solution. It is basically concerned with the solution design. Benefit of
structured design is, it gives better understanding of how the problem is being solved.
Structured design also makes it simpler for designer to concentrate on the problem
more accurately.
Structured design is mostly based on ‘divide and conquer’ strategy where a problem
is broken into several small problems and each small problem is individually solved
until the whole problem is solved.
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. A good structured design has high
cohesion and low coupling arrangements.
Page | 9
Software System & Design Unit - I Semester I B. Tech (CSE) 2028
A good design is the one that has low coupling. Coupling is measured by the number
of relations between the modules. That is, the coupling increases as the number of calls
between modules increase or the amount of shared data is large. Thus, it can be said
that a design with high coupling will have more errors.
• Content coupling - When a module can directly access or modify or refer to the
content of another module, it is called content level coupling.
• Common coupling- When multiple modules have read and write access to
some global data, it is called common or global coupling.
• Stamp coupling- When multiple modules share common data structure and
work on different part of it, it is called stamp coupling.
• Data coupling- Data coupling is when two modules interact with each other by
means of passing data (as parameter). If a module passes data structure as parameter,
then the receiving module should use all its components.
Module Cohesion
In computer programming, cohesion defines to the degree to which the elements of a
module belong together. Thus, cohesion measures the strength of relationships
between pieces of functionality within a given module. For example, in highly
cohesive systems, functionality is strongly related.
Page | 10
Software System & Design Unit - I Semester I B. Tech (CSE) 2028
• Logical cohesion - When logically categorized elements are put together into a
module, it is called logical cohesion.
• Temporal Cohesion - When elements of module are organized such that they
are processed at a similar point in time, it is called temporal cohesion.
Page | 11
Software System & Design Unit - I Semester I B. Tech (CSE) 2028
Coupling Cohesion
Coupling shows the relationships Cohesion shows the relationship within the
between modules. module.
While creating, you should aim for While creating you should aim for high
low coupling, i.e., dependency among cohesion, i.e., a cohesive component/ module
modules should be less. focuses on a single function (i.e., single-
mindedness) with little interaction with other
modules of the system.
This design mechanism divides the whole system into smaller functions, which
provides means of abstraction by concealing the information and their operation.
These functional modules can share information among themselves by means of
information passing and using information available globally.
Page | 12
Software System & Design Unit - I Semester I B. Tech (CSE) 2028
Design Process
• The whole system is seen as how data flows in the system by means of data
flow diagram.
• DFD depicts how functions change the data and state of entire system.
• The entire system is logically broken down into smaller units known as
functions on the basis of their operation in the system.
Data-flow diagrams are a useful and intuitive way of describing a system. They are
generally understandable without specialized training, notably if control information
is excluded. They show end-to-end processing. That is the flow of processing from
when data enters the system to where it leaves the system can be traced.
Page | 13
Software System & Design Unit - I Semester I B. Tech (CSE) 2028
Data-flow design is an integral part of several design methods, and most CASE tools
support data-flow diagram creation. Different ways may use different icons to
represent data-flow diagram entities, but their meanings are similar.
Page | 14
Software System & Design Unit - I Semester I B. Tech (CSE) 2028
The report generator produces a report which describes all of the named entities in a
data-flow diagram. The user inputs the name of the design represented by the
diagram. The report generator then finds all the names used in the data-flow diagram.
It looks up a data dictionary and retrieves information about each name. This is then
collated into a report which is output by the system.
Data Dictionaries
A data dictionary lists all data elements appearing in the DFD model of a system. The
data items listed contain all data flows and the contents of all data stores looking on
the DFDs in the DFD model of a system.
A data dictionary lists the objective of all data items and the definition of all composite
data elements in terms of their component data items. For example, a data dictionary
entry may contain that the data. grossPay consists of the
parts regularPay and overtimePay.
For the smallest units of data elements, the data dictionary lists their name and their
type.
o A Data dictionary provides a standard language for all relevant information for
use by engineers working in a project. A consistent vocabulary for data items
is essential since, in large projects, different engineers of the project tend to use
different terms to refer to the same data, which unnecessarily causes confusion.
o The data dictionary provides the analyst with a means to determine the
definition of various data structures in terms of their component elements.
Structured Charts
It partitions a system into block boxes. A Black box system that functionality is
known to the user without the knowledge of internal design.
Page | 15
Software System & Design Unit - I Semester I B. Tech (CSE) 2028
Page | 16
Software System & Design Unit - I Semester I B. Tech (CSE) 2028
Pseudo-code
Pseudo-code notations can be used in both the preliminary and detailed design
phases. Using pseudo-code, the designer describes system characteristics using short,
concise, English Language phases that are structured by keywords such as If-Then-
Else, While-Do, and End.
Page | 17
Software System & Design Unit - I Semester I B. Tech (CSE) 2028
1. Objects: All entities involved in the solution design are known as objects. For
example, person, banks, company, and users are considered as objects. Every
entity has some attributes associated with it and has some methods to perform
on the attributes.
Page | 18
Software System & Design Unit - I Semester I B. Tech (CSE) 2028
In other words, a life cycle model maps the various activities performed on a software
product from its inception to retirement. Different life cycle models may plan the
necessary development activities to phases in different ways. Thus, no element which
life cycle model is followed, the essential activities are contained in all life cycle models
though the action may be carried out in distinct orders in different life cycle models.
During any life cycle stage, more than one activity may also be carried out.
Need of SDLC
The development team must determine a suitable life cycle model for a particular plan
and then observe to it.
Without using an exact life cycle model, the development of a software product would
not be in a systematic and disciplined manner. When a team is developing a software
product, there must be a clear understanding among team representative about when
and what to do. Otherwise, it would point to chaos and project failure. This problem
can be defined by using an example. Suppose a software development issue is divided
into various parts and the parts are assigned to the team members. From then on,
suppose the team representative is allowed the freedom to develop the roles assigned
to them in whatever way they like. It is possible that one representative might start
writing the code for his part, another might choose to prepare the test documents first,
and some other engineer might begin with the design phase of the roles assigned to
him. This would be one of the perfect methods for project failure.
A software life cycle model describes entry and exit criteria for each phase. A phase
can begin only if its stage-entry criteria have been fulfilled. So without a software life
cycle model, the entry and exit criteria for a stage cannot be recognized. Without
software life cycle models, it becomes tough for software project managers to monitor
the progress of the project.
SDLC Cycle
SDLC Cycle represents the process of developing software. SDLC framework includes
the following steps:
Page | 19
Software System & Design Unit - I Semester I B. Tech (CSE) 2028
Business analyst and Project organizer set up a meeting with the client to gather all
the data like what the customer wants to build, who will be the end user, what is the
objective of the product. Before creating a product, a core understanding or
knowledge of the product is very necessary.
Once the required function is done, an analysis is complete with auditing the
feasibility of the growth of a product. In case of any ambiguity, a signal is set up for
further discussion.
Page | 20
Software System & Design Unit - I Semester I B. Tech (CSE) 2028
Page | 21
Software System & Design Unit - I Semester I B. Tech (CSE) 2028
Many life cycle models have been proposed so far. Each of them has some advantages
as well as some disadvantages. A few important and commonly used life cycle models
are as follows:
Page | 22
Software System & Design Unit - I Semester I B. Tech (CSE) 2028
Feasibility study - The main aim of feasibility study is to determine whether it would
be financially and technically feasible to develop the product.
• After they have an overall understanding of the problem they investigate the
different solutions that are possible. Then they examine each of the solutions in terms
of what kind of resources required, what would be the cost of development and what
would be the development time for each solution.
• Based on this analysis they pick the best solution and determine whether the
solution is feasible financially and technically. They check whether the customer
budget would meet the cost of the product and whether they have sufficient technical
expertise in the area of development.
Requirements analysis and specification: - The aim of the requirements analysis and
specification phase is to understand the exact requirements of the customer and to
document them properly. This phase consists of two distinct activities, namely
• Requirements specification
The goal of the requirements gathering activity is to collect all relevant information
from the customer regarding the product to be developed. This is done to clearly
understand the customer requirements so that incompleteness and inconsistencies are
removed.
The requirements analysis activity is begun by collecting all relevant data regarding
the product to be developed from the users of the product and from the customer
through interviews and discussions. For example, to perform the requirements
analysis of a business accounting software required by an organization, the analyst
might interview all the accountants of the organization to ascertain their requirements.
The data collected from such a group of users usually contain several contradictions
and ambiguities, since each user typically has only a partial and incomplete view of
Page | 23
Software System & Design Unit - I Semester I B. Tech (CSE) 2028
Design: - The goal of the design phase is to transform the requirements specified in
the SRS document into a structure that is suitable for implementation in some
programming language. In technical terms, during the design phase the software
architecture is derived from the SRS document. Two distinctly different approaches
are available: the traditional design approach and the object-oriented design
approach.
• Object-oriented design approach -In this technique, various objects that occur
in the problem domain and the solution domain are first identified, and the different
relationships that exist among these objects are identified. The object structure is
further refined to obtain the detailed design.
Coding and unit testing:-The purpose of the coding phase (sometimes called the
implementation phase) of software development is to translate the software design
into source code. Each component of the design is implemented as a program module.
The end-product of this phase is a set of program modules that have been individually
tested. During this phase, each module is unit tested to determine the correct working
of all the individual modules. It involves testing each module in isolation as this is the
most efficient way to debug the errors identified at this stage.
Page | 24
Software System & Design Unit - I Semester I B. Tech (CSE) 2028
developed system conforms to its requirements laid out in the SRS document. System
testing usually consists of three different kinds of testing activities:
System testing is normally carried out in a planned manner according to the system
test plan document. The system test plan identifies all testing-related activities that
must be performed, specifies the schedule of testing, and allocates resources. It also
lists all the test cases and the expected outputs for each test case.
• Correcting errors that were not discovered during the product development
phase. This is called corrective maintenance.
• Porting the software to work in a new environment. For example, porting may
be required to get the software to work on a new computer platform or with a new
operating system. This is called adaptive maintenance.
Page | 25
Software System & Design Unit - I Semester I B. Tech (CSE) 2028
in any practical software development work, it is not possible to strictly follow the
classical waterfall model.
2. ITERATIVE WATERFALL MODEL
To overcome the major shortcomings of the classical waterfall model, we come up
with the iterative waterfall model.
Here, we provide feedback paths for error correction as & when detected later in a
phase. Though errors are inevitable, but it is desirable to detect them in the same
phase in which they occur. If so, this can reduce the effort to correct the bug.
The advantage of this model is that there is a working model of the system at a very
early stage of development which makes it easier to find functional or design flaws.
Finding issues at an early stage of development enables to take corrective measures in
a limited budget.
The disadvantage with this SDLC model is that it is applicable only to large and bulky
software development projects. This is because it is hard to break a small software
system into further small serviceable increments/modules.
3. PRTOTYPING MODEL
Page | 26
Software System & Design Unit - I Semester I B. Tech (CSE) 2028
Prototype
A prototype is a toy implementation of the system. A prototype usually exhibits
limited functional capabilities, low reliability, and inefficient performance compared
to the actual software. A prototype is usually built using several shortcuts. The
shortcuts might involve using inefficient, inaccurate, or dummy functions. The
shortcut implementation of a function, for example, may produce the desired results
by using a table look-up instead of performing the actual computations. A prototype
usually turns out to be a very crude version of the actual system.
Need for a prototype in software development
There are several uses of a prototype. An important purpose is to illustrate the input
data formats, messages, reports, and the interactive dialogues to the customer. This is
a valuable mechanism for gaining better understanding of the customer’s needs:
Another reason for developing a prototype is that it is impossible to get the perfect
product in the first attempt. Many researchers and engineers advocate that if you want
to develop a good product you must plan to throw away the first version. The
experience gained in developing the prototype can be used to develop the final
product.
A prototyping model can be used when technical solutions are unclear to the
development team. A developed prototype can help engineers to critically examine
the technical issues associated with the product development. Often, major design
decisions depend on issues like the response time of a hardware controller, or the
efficiency of a sorting algorithm, etc. In such circumstances, a prototype may be the
best or the only way to resolve the technical issues.
Page | 27
Software System & Design Unit - I Semester I B. Tech (CSE) 2028
• Also used in object oriented software development because the system can be
easily portioned into units in terms of objects.
Advantages:
• Reduce the error because the core modules get tested thoroughly.
Disadvantages:
Page | 28
Software System & Design Unit - I Semester I B. Tech (CSE) 2028
Page | 29
Software System & Design Unit - I Semester I B. Tech (CSE) 2028
• Steps are taken to reduce the risks. For example, if there is a risk that the
requirements are inappropriate, a prototype system may be developed.
Third Quadrant (Development and Validation)
• Develop and validate the next level of the product after resolving the identified
risks.
Fourth Quadrant (Review and Planning)
• Review the results achieved so far with the customer and plan the next iteration
around the spiral.
Page | 30
Software System & Design Unit - I Semester I B. Tech (CSE) 2028
• Progressively more complete version of the software gets built with each
iteration around the spiral.
Circumstances to use spiral model
The spiral model is called a meta model since it encompasses all other life cycle
models. Risk handling is inherently built into this model. The spiral model is suitable
for development of technically challenging software products that are prone to several
kinds of risks. However, this model is much more complex than the other models –
this is probably a factor deterring its use in ordinary projects.
Comparison of different life-cycle models
The classical waterfall model can be considered as the basic model and all other life
cycle models as embellishments of this model. However, the classical waterfall model
cannot be used in practical development projects, since this model supports no
mechanism to handle the errors committed during any of the phases.
This problem is overcome in the iterative waterfall model. The iterative waterfall
model is probably the most widely used software development model evolved so far.
This model is simple to understand and use. However, this model is suitable only for
well-understood problems; it is not suitable for very large projects and for projects
that are subject to many risks.
The prototyping model is suitable for projects for which either the user requirements
or the underlying technical aspects are not well understood. This model is especially
popular for development of the user-interface part of the projects.
The evolutionary approach is suitable for large problems which can be decomposed
into a set of modules for incremental development and delivery. This model is also
widely used for object- oriented development projects. Of course, this model can only
be used if the incremental delivery of the system is acceptable to the customer.
The spiral model is called a meta model since it encompasses all other life cycle
models. Risk handling is inherently built into this model. The spiral model is suitable
for development of technically challenging software products that are prone to several
kinds of risks. However, this model is much more complex than the other models –
this is probably a factor deterring its use in ordinary projects.
The different software life cycle models can be compared from the viewpoint of the
customer. Initially, customer confidence in the development team is usually high
irrespective of the development model followed. During the lengthy development
process, customer confidence normally drops off, as no working product is
immediately visible. Developers answer customer queries using technical slang, and
delays are announced. This gives rise to customer resentment. On the other hand, an
evolutionary approach lets the customer experiment with a working product much
earlier than the monolithic approaches. Another important advantage of the
incremental model is that it reduces the customer’s trauma of getting used to an
Page | 31