Software Design and Software Reliability
Software Design and Software Reliability
Software Design
Coupling and Cohesion
Module Coupling
In software engineering, the coupling is the degree of interdependence between software modules. Two
modules that are tightly coupled are strongly dependent on each other. However, two modules that are
loosely coupled are not dependent on each other. Uncoupled modules have no interdependence at all
within them.
Coupling is also the indication of the relationships between modules. It is concept of Inter-module.
Coupling has also many types but usually low coupling is good for software.
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.
In this case, modules are subordinates to different modules. Therefore, no direct coupling.
2. Data Coupling: When data of one module is passed to another module, this is called data coupling.
If the dependency between the modules is based on the fact that they communicate by passing only data,
then the modules are said to be data coupled.
3. Stamp Coupling:. In stamp coupling, the complete data structure is passed from one module to
another module. Therefore, it involves tramp data. It may be necessary due to efficiency factors- this
choice made by the insightful designer, not a lazy programmer. For example, passing structure variable in
C or object in C++ language to a module.
4. Control Coupling: Control Coupling exists among two modules if data from one module is used to direct the
structure of instruction execution in another.
5. External Coupling: External Coupling arises when two modules share an externally imposed data
format, communication protocols, or device interface. This is related to communication to external tools
and devices.
6. Common Coupling: Two modules are common coupled if they share information through some
global data items.
Module Cohesion
Cohesion:
Cohesion is the indication of the relationship within module. It is concept of intra-module. Cohesion has
many types but usually highly cohesion is good for software.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.
Cohesion is an ordinal type of measurement and is generally described as "high cohesion" or "low
cohesion."
1. Functional Cohesion: Functional Cohesion is said to exist if the different elements of a module,
cooperate to achieve a single function.
2. Sequential Cohesion: A module is said to possess sequential cohesion if the element of a module
form the components of the sequence, where the output from one component of the sequence is
input to the next.
3. Communicational Cohesion: A module is said to have communicational cohesion, if all tasks of
the module refer to or update the same data structure, e.g., the set of functions defined on an array
or a stack.
4. Procedural Cohesion: A module is said to be procedural cohesion if the set of purpose of the
module are all parts of a procedure in which particular sequence of steps has to be carried out for
achieving a goal, e.g., the algorithm for decoding a message.
Now we will see the difference between Cohesion and Coupling. the differences between cohesion and
coupling are given below:
Cohesion Coupling
Cohesion is the concept of intra module. Coupling is the concept of inter module.
Cohesion represents the relationship within Coupling represents the relationships between
module. modules.
Increasing in cohesion is good for software. Increasing in coupling is avoided for software.
Cohesion represents the functional strength of Coupling represents the independence among
modules. modules.
In cohesion, module focuses on the single In coupling, modules are connected to the other
thing. modules.
Design Notations
Design Notations are primarily meant to be used during the process of design and are used to represent
design or design decisions. For a function-oriented design, the design can be represented graphically or
mathematically by the following:
Data-flow design is concerned with designing a series of functional transformations that convert system
inputs into the required outputs. The design is described as data-flow diagrams. These diagrams show
how data flows through a system and how the output is derived from the input through a series of
functional transformations.
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.
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.
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.
A data dictionary plays a significant role in any software development process because of the following
reasons:
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.
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.
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.
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.
2. Classes: A class is a generalized description of an object. An object is an instance of a class. A class
defines all the attributes, which an object can have and methods, which represents the functionality of the
object.
3. Messages: Objects communicate by message passing. Messages consist of the integrity of the target
object, the name of the requested operation, and any other action needed to perform the function. Messages
are often implemented as procedure or function calls.
4. Abstraction In object-oriented design, complexity is handled using abstraction. Abstraction is the removal
of the irrelevant and the amplification of the essentials.
5. Encapsulation: Encapsulation is also called an information hiding concept. The data and operations are
linked to a single unit. Encapsulation not only bundles essential information of an object together but also
restricts access to the data and methods from the outside world.
6. Inheritance: OOD allows similar classes to stack up in a hierarchical manner where the lower or sub-
classes can import, implement, and re-use allowed variables and functions from their immediate
Text-Based User Interface: This method relies primarily on the keyboard. A typical example of this is UNIX.
Advantages
Disadvantages
Graphical User Interface (GUI): GUI relies much more heavily on the mouse. A typical example of this type of
interface is any versions of the Windows operating systems.
GUI Characteristics
Characteristics Descriptions
Windows Multiple windows allow different information to be displayed simultaneously on the user's screen.
Icons different types of information. On some systems, icons represent files. On other icons
Icons
describes processes.
Menus Commands are selected from a menu rather than typed in a command language.
A pointing device such as a mouse is used for selecting choices from a menu or indicating items
Pointing
of interests in a window.
Graphics Graphics elements can be mixed with text or the same display.
Advantages
UI Design Principles
Structure: Design should organize the user interface purposefully, in the meaningful and usual based on precise,
consistent models that are apparent and recognizable to users, putting related things together and separating
unrelated things, differentiating dissimilar things and making similar things resemble one another. The structure
principle is concerned with overall user interface architecture.
Simplicity: The design should make the simple, common task easy, communicating clearly and directly in the
user's language, and providing good shortcuts that are meaningfully related to longer procedures.
Visibility: The design should make all required options and materials for a given function visible without
distracting the user with extraneous or redundant data.
Feedback: The design should keep users informed of actions or interpretation, changes of state or condition, and
bugs or exceptions that are relevant and of interest to the user through clear, concise, and unambiguous language
familiar to users.
Tolerance: The design should be flexible and tolerant, decreasing the cost of errors and misuse by allowing
undoing and redoing while also preventing bugs wherever possible by tolerating varied inputs and sequences and
by interpreting all reasonable actions.
Software reliability is also defined as the probability that a software system fulfils its assigned task in a
given environment for a predefined number of input cases, assuming that the hardware and the input are
free of error.
Software Reliability is an essential connect of software quality, composed with functionality, usability,
performance, serviceability, capability, installability, maintainability, and documentation. Software
Reliability is hard to achieve because the complexity of software turn to be high. While any system with a
high degree of complexity, containing software, will be hard to reach a certain level of reliability, system
developers tend to push complexity into the software layer, with the speedy growth of system size and
ease of doing so by upgrading the software.
For example, large next-generation aircraft will have over 1 million source lines of software on-board;
next-generation air traffic control systems will contain between one and two million lines; the upcoming
International Space Station will have over two million lines on-board and over 10 million lines of ground
support software; several significant life-critical defense systems will have over 5 million source lines of
software. While the complexity of software is inversely associated with software reliability, it is directly
related to other vital factors in software quality, especially functionality, capability, etc.
Software failures may be due to bugs, ambiguities, oversights or misinterpretation of the specification
that the software is supposed to satisfy, carelessness or incompetence in writing code, inadequate testing,
incorrect or unexpected usage of the software or other unforeseen problems.
If someone makes an error or mistake in using the software, this may lead directly to a problem – the
software is used incorrectly and so does not behave as we expected. However, people also design and
build the software and they can make mistakes during the design and build. These mistakes mean that
there are flaws in the software itself. These are called defects or sometimes bugs or faults.
Bug: A Bug is the result of a coding Error or Fault in the program which causes the program to
behave in an unintended or unanticipated manner. It is an evidence of fault in the program. Bugs arise
from mistakes and errors, made by people, in either a program’s source code or its design.
Defector Fault: A Defect is a deviation from the Requirements. A Software Defect is a condition in a
software product which does not meet a software requirement (as stated in the requirement
specifications) or end-user expectations. In other words, a defect is an error in coding or logic that
causes a program to malfunction or to produce incorrect/unexpected result.
Failure: Failure is a deviation of the software from its intended purpose. It is the inability of a system or
a component to perform its required functions within specified performance requirements. Failure occurs
when fault executes.
Software reliability models have appeared as people try to understand the features of how and why
software fails, and attempt to quantify software reliability.
Over 200 models have been established since the early 1970s, but how to quantify software reliability
remains mostly unsolved.
There is no individual model that can be used in all situations. No model is complete or even
representative.
Assumptions
Factors
A mathematical function that includes the reliability with the elements. The mathematical function is
generally higher-order exponential or logarithmic.
The failure behavior is a nonhomogeneous Poisson process, which means the associated probability
distribution is a Poisson
It is equivalent to the M-O logarithmic Poisson execution time model, with different mean value
function.
In the basic execution model, the mean failures experienced μ is expressed in terms of the execution time
(τ) as
Where
-λ0: stands for the initial failure intensity at the start of the execution.
-v0: stands for the total number of failures occurring over an infinite time period; it corresponds to the
expected number of failures to be observed eventually.
It is based on the above formula. The failure intensity λ is expressed in terms of μ as:
λ0: Initial
v0: Number of failures experienced, if a program is executed for an infinite time period.
τ: Execution time.
Based on the above expressions, given some failure intensity objective, one can compute the expected
number of failures ∆λ and the additional execution time ∆τ required to reach that objective.
∆μ: Expected number of additional failures to be experienced to reach failure intensity objectives.
Example: Assume that a program will experience 200 failures in infinite time. It has now experienced
100. The initial failure intensity was 20 hr. Determine the current failure intensity.
Solution:
4. Additional failures (∆μ) required to reach the failure intensity objectives of 5 hr.