Software Eng - Module 3
Software Eng - Module 3
Software Eng - Module 3
Objectives
After studying this unit, you should be able to:
z Understand the effort estimates
z Discuss the concept cost estimates
z Understanding LOC
z Examining Function point and extended function point
z Describe COCOMO-81
z Explain COCOMO-II
z Identify the purpose of Risk Management
4.1 Introduction
Risk in itself is not bad; risk is essential to progress, and failure is often a key part of
learning. But we must learn to balance the possible negative consequences of risk
against the potential benefits of its associated opportunity. – Van Scoy, 1992.
This lesson divided into two parts, in the first part, we will learn COCOMO-81 and
COCOMO-II and in the other part we will learn all about the Risk Management.
Developer Opinion
Developer opinion is otherwise known as guessing. If you are an experienced
developer, you can likely make good estimates due to familiarity with the type of
software being developed.
Estimating Effort
There are two basic models for estimating software development effort (or cost): holistic
and activity-based. The single biggest cost driver in either model is the estimated
project size.
Holistic models are useful for organizations that are new to software development,
or that do not have baseline data available from previous projects to determine labour
rates for the various development activities.
Estimates produced with activity-based models are more likely to be accurate, as
they are based on the software development rates common to each organization.
Unfortunately, you require related data from previous projects to apply these
techniques.
In order to develop metrics that can be assimilated with similar metrics from other
projects, we choose lines of code as our normalization value. From the rudimentary
Notes data contained in the table, a set of simple size-oriented metrics can be developed for
each project:
z Errors per KLOC (thousand lines of code).
z Defects per KLOC.
z $ per LOC.
z Page of documentation per KLOC.
In addition, other interesting metrics can be computed:
z Errors per person-month.
z LOC per person-month.
z $ per page of documentation.
Size-oriented metrics are not universally accepted as the best way to measure the
process of software development. Most of the controversy swirls around the use of lines
of code as a key measure.
Proponents of the LOC measure claim that LOC is an "artifact" of all software
development projects that can be easily counted, that many existing software estimation
models use LOC or KLOC as a key input, and that a large body of literature and data
predicated on LOC already exists.
Opponents argue that LOC measures are programming language dependent, that
they penalize well-designed but shorter programs, that they cannot easily accommodate
nonprocedural languages, and that their use in estimation requires a level of detail that
may be difficult to achieve (i.e., the planner must estimate the LOC to be produced long
before analysis and design have been completed).
Function Point
Function-oriented software metrics use a measure of the functionality delivered by the
application as a normalization value. Since ‘functionality’ cannot be measured directly, it
must be derived indirectly using other direct measures. Function-oriented metrics were
first proposed by Albrecht, who suggested a measure called the function point. Function
points are derived using an empirical relationship based on countable (direct) measures
of software's information domain and assessments of software complexity.
Function points are computed by completing the table shown in Figure 4.2. Five
information domain characteristics are determined and counts are provided in the
appropriate table location. Information domain values are defined in the following
manner:
Amity Directorate of Distance and Online Education
Software Project Planning 71
z Number of user inputs: Each user input that provides distinct application-oriented
data to the software is counted. Inputs should be distinguished from inquiries, which
are counted separately. Notes
z Number of user outputs: Each user output that provides application-oriented
information to the user is counted. In this context output refers to reports, screens,
error messages, etc. Individual data items within a report are not counted
separately.
z Number of user inquiries: An inquiry is defined as an on-line input that results in
the generation of some immediate software response in the form of an on-line
output. Each distinct inquiry is counted.
z Number of files: Each logical master file (i.e., a logical grouping of data that may
be one part of a large database or a separate file) is counted.
z Number of external interfaces: All machine readable interfaces (e.g., data files on
storage media) that are used to transmit information to another system are counted.
Once these data have been collected, a complexity value is associated with each
count. Organizations that use function point methods develop criteria for determining
whether a particular entry is simple, average, or complex. Nonetheless, the
determination of complexity is somewhat subjective.
To compute function points (FP), the following relationship is used:
FP = Count total × [0.65 + 0.01 × ∑(Fi)
where count total is the sum of all FP entries obtained from Figure 4.2.
The Fi (i = 1 to 14) are "complexity adjustment values" based on responses to the
following questions:
1. Does the system require reliable backup and recovery?
2. Are data communications required?
3. Are there distributed processing functions?
4. Is performance critical?
5. Will the system run in an existing, heavily utilized operational environment?
6. Does the system require on-line data entry?
7. Does the on-line data entry require the input transaction to be built over multiple
screens or operations?
8. Are the master files updated on-line?
9. Are the inputs, outputs, files, or inquiries complex?
10. Is the internal processing complex?
11. Is the code designed to be reusable?
12. Are conversion and installation included in the design?
13. Is the system designed for multiple installations in different organizations?
14. Is the application designed to facilitate change and ease of use by the user?
Each of these questions is answered using a scale that ranges from 0 (not
important or applicable) to 5 (absolutely essential). The constant values in Equation and
the weighting factors that are applied to information domain counts are determined
empirically.
Once function points have been calculated, they are used in a manner analogous to
LOC as a way to normalize measures for software productivity, quality, and other
attributes:
1. Errors per FP.
2. Defects per FP.
3. $ per FP.
4. Pages of documentation per FP.
Notes
5. FP per person-month.
Notes
Historical data indicates that the organizational average productivity for systems of
this type is 630 LOC/per-month and the cost per LOC is $13.
Thus, the LOC estimate for this project is
z 33983 / 620 = 55 person months
z 33983 * 13 = $441700
Example: FP
Table 4.2: Example of FP
Factor Value
Backup and recovery 4
Data communications 2
Distributed processing 0
Performance critical 4
Existing operating environment 3
On-line data entry 4
Input transactions over multiple screens 5
Master file updated on-line 3
Information domain values complex 5
Internal processing complex 5
Code designed for reuse 4
Conversion/installation in design 3
Multiple installations 5
Application designed for change 5
Estimated number of FP is Count total * (0.65 + 0.01 * Σ Fi ) = 372
Historical data indicates that the organizational average productivity for systems of
this type is 6.5 FP/per-month and the cost per FP is $1230.
Thus, the FP estimate for this project is
z 372 / 6.5 = 58 person months
z 372 * 1230 = $45700
Amity Directorate of Distance and Online Education
74 Software Engineering
Ensure that the assumptions and input data used to develop the estimates are
correct.
Notes Ensure that the estimate is reasonable and accurate for the given input data.
Confirm and record the official estimates for the project.
Once the inspection is complete and all defects have been removed, project
manager, quality assurance group, and top-level management sign the estimate.
Inspection and approval activities can be formal or informal as required but should
be reviewed independently by the people involved in cost estimation.
(h) Track Estimates: Tracking estimate over a period of time is essential, as it helps in
comparing the current estimate to previous estimates, resolving any discrepancies
with previous estimates, comparing planned cost estimates and actual estimates.
This helps in keeping track of the changes in a software project over a period of
time. Tracking also allows the development of a historical database of estimates,
which can be used to adjust various cost models or to compare past estimates to
future estimates.
(i) Process Measurement and Improvement: Metrics should be collected (in each
step) to improve the cost estimation process. For this, two types of process metrics
are used namely, process effective metrics and process cost metrics. The benefit of
collecting these metrics is to specify a reciprocal relation that exists between the
accuracy of the estimates and the cost of developing the estimates.
Process effective metrics: Keeps track of the effects of cost estimating process.
The objective is to identify elements of the estimation process, which enhance
the estimation process. These metrics also identify those elements which are of
little or no use to the planning and tracking processes of a project. The
elements that do not enhance the accuracy of estimates should be isolated and
eliminated.
Process cost metrics: Provides information about implementation and
performance cost incurred in the estimation process. The objective is to quantify
and identify different ways to increase the cost effectiveness of the process. In
these metrics, activities that cost-effectively enhance the project planning and
tracking process remain intact, while activities that have negligible affect on the
project are eliminated.
Complex
Embedded Large Greater Tight hardware/customer
interfaces
Here are the coefficients related to development modes for intermediate model:
Development Mode a b c d
Organic 3.2 1.05 2.5 0.38
Semi-detached 3.0 1.12 2.5 0.35
Embedded 2.8 1.20 2.5 0.32
Basic mode uses only size in estimation. Intermediate mode also uses 15 cost
drivers as well as size.
In intermediate mode development effort equation becomes:
MM=aKDSIbC
C (effort adjustment factor) is calculated simply multiplying the values of cost
drivers. So the intermediate model is more accurate than the basic model.
The steps in producing an estimate using the intermediate model COCOMO'81 are:
1. Identify the mode (organic, semidetacted, embedded) of development for the new
product.
2. Estimate the size of the project in KDSI to derive a nominal effort prediction.
3. Adjust 15 cost drivers to reflect your project.
Notes
4. Calculate the predicted project effort using first equation and the effort adjustment
factor (C)
5. Calculate the project duration using second equation.
Example: Estimate using the intermediate COCOMO'81
Mode is organic
Size = 200KDSI
Cost drivers:
Low reliability = .88
High product complexity = 1.15
Low application experience = 1.13
High programming language experience = .95
Other cost drivers assumed to be nominal = 1.00
C = .88 * 1.15 * 1.13 * .95 = 1.086
Effort = 3.2 * ( 2001.05 ) * 1.086 = 906 MM
Development time = 2.5 * 9060.38
Advantages of COCOMO'81
z COCOMO is transparent, you can see how it works unlike other models such as
SLIM.
z Drivers are particularly helpful to the estimator to understand the impact of different
factors that affect project costs.
Drawbacks of COCOMO'81
z It is hard to accurately estimate KDSI early on in the project, when most effort
estimates are required.
z KDSI, actually, is not a size measure it is a length measure.
z Extremely vulnerable to mis-classification of the development mode
z Success depends largely on tuning the model to the needs of the organization,
using historical data which is not always available.
COCOMO-II
Researchs on COCOMO II is started in late 90s because COCOMO'81 is not enough to
apply to newer software development practices. You can find latest information about
COCOMO'II from COCOMO II Home Page.
These changes and others began to make applying the original COCOMO® model
problematic. The solution to the problem was to reinvent the model for the 1990s. After
several years and the combined efforts of USC-CSSE, ISR at UC Irvine, and the
COCOMO® II Project Affiliate Organizations, the result is COCOMO® II, a revised cost
estimation model reflecting the changes in professional software development practice
that have come about since the 1970s. This new, improved COCOMO® is now ready to
assist professional software cost estimators for many years to come.
COCOMO'II differs from COCOMO'81 with such differences:
z COCOMO'81 requires software size in KSLOC as an input, but COCOMO'II
provides different effort estimating models based on the stage of development of
the project.
π
⎜ ⎟ b
ASLOC⎝ 100 ⎠ ⎡ ⎛ BRAK ⎞ ⎤
Effort = + a ⎢size ⎜1 + ⎟ EMi
ATPROD ⎣ ⎝ 100 ⎠ ⎥⎦
1
b = 1.01 +
100
∑ SFj
⎛ 100 − AT ⎞
Size = KSLOC + KASLOC ⎜ AAM
⎝ 100 ⎟⎠
Where,
a = 2.5, SFj = scale factor,
Emi = effort multiplier
BRAK = Percentage code discarted due to requirement volatility
ASLOC = size of adapted components
AT = percents of components adapted
ATPROD = Automatic Translation Productivity
AAM = Adaptation Adjustment Multiplier
COCOMO'II adjusts for the effects of reengineering in its effort estimate.
When a project includes automatic translation, following list must be estimated:
z Automatic translation productivity (ATPROD), estimated from previous development
efforts
z The size, in thousands of Source Lines of Code, of untranslated code (KSLOC) and
of code to be translated (KASLOC) under this project.
z The percentage of components being developed from reengineered software
(ADAPT)
z The percentage of components that are being automatically translated (AT).
The effort equation is adjusted by 15 cost driver attributes in COCOMO'81, but
COCOMO'II defines seven cost drivers (EM) for the Early Design estimate:
z Personnel capability
B1/3 ⋅ Size
= Effort1/3 ⋅ Time 4/3
Productivity
where,
z Size is the product size (whatever size estimate is used by your organization is
Notes appropriate). Putnam uses ESLOC (Effective Source Lines of Code) throughout his
books.
z B is a scaling factor and is a function of the project size.
z Productivity is the Process Productivity, the ability of a particular software
organization to produce software of a given size at a particular defect rate.
z Effort is the total effort applied to the project in person-years.
z Time is the total schedule of the project in years.
In practical use, when making an estimate for a software task the software equation
is solved for effort:
3
⎡ Size ⎤
Effort = ⎢ 4/3 ⎥
⋅B
⎣ Productivity ⋅ Time ⎦
An estimated software size at project completion and organizational process
productivity is used. Plotting effort as a function of time yields the Time-Effort Curve.
The points along the curve represent the estimated total effort to complete the project at
some time. One of the distinguishing features of the Putnam model is that total effort
decreases as the time to complete the project is extended. This is normally represented
in other parametric models with a schedule relaxation parameter.
This estimating method is fairly sensitive to uncertainty in both size and process
productivity. Putnam advocates obtaining process productivity by calibration:
Size
Process Productivity = 1/3
⎡ Effort ⎤
⎢⎣ B ⎥⎦ ⋅ Time 4/3
Categories of Risks
1. Schedule Risk
2. Operational risk
3. Technical risk
Risk management is the identification, assessment, and prioritization of risks
followed by coordinated and economical application of resources to minimize, monitor,
and control the probability and/or impact of unfortunate events.
Risk Management Process, describes the steps you need to take to identify,
monitor and control risk. Within the Risk Process, a risk is defined as any future event
that may prevent you to meet your team goals. A Risk Process allows you to identify
each risk, quantify the impact and take action now to prevent it from occurring and
reduce the impact should it eventuate.
This Risk Process helps you:
z Identify critical and non-critical risks
z Document each risk in depth by completing Risk Forms
z Log all risks and notify management of their severity
z Take action to reduce the likelihood of risks occurring
z Reduce the impact on your business, should risk eventuate
Risk Planning Risk Planning is developing and documenting organized,
comprehensive, and interactive strategies and methods for identifying risks. It is also
used for performing risk assessments to establish risk handling priorities, developing
risk handling plans, monitoring the status of risk handling actions, determining and
obtaining the resources to implement the risk management strategies. Risk planning is
used in the development and implementation of required training and communicating
risk information up and down the project stakeholder organization.
Risk monitoring and control is the process of identifying and analyzing new risk,
keeping track of these new risks and forming contingency plans incase they arise. It
ensures that the resources that the company puts aside for a project is operating
properly. Risk monitoring and control is important to a project because it helps ensure
that the project stays on track.
4.8 Summary
An accurate estimate of software size is an essential element in the calculation of
estimated project costs and schedules. The fact that these estimates are required very
early on in the project (often while a contract bid is being prepared) makes size
estimation a formidable task. In general, you present size estimates as lines of code
(KSLOC or SLOC) or as function points. There are constants that you can apply to
Amity Directorate of Distance and Online Education
84 Software Engineering
convert function points to lines of code for specific languages, but not vice versa. If
possible, choose and adhere to one unit of measurement, since conversion simply
Notes introduces a new margin of error into the final estimate. Developer opinion is otherwise
known as guessing. If you are an experienced developer, you can likely make good
estimates due to familiarity with the type of software being developed. The cost of
medium and large software projects is determined by the cost of developing the
software, plus the cost of equipment and supplies. The latter is generally a constant for
most projects. There are two basic models for estimating software development effort
(or cost): holistic and activity-based. The single biggest cost driver in either model is the
estimated project size.
Size-oriented software metrics are derived by normalizing quality and/or
productivity measures by considering the size of the software that has been produced.
Function-oriented software metrics use a measure of the functionality delivered by the
application as a normalization value. Since ‘functionality’ cannot be measured directly, it
must be derived indirectly using other direct measures. The first step in estimation is to
predict the size of the project. Typically, this will be done using either LOC (the direct
approach) or FP (the indirect approach). Then we use historical data (on similar types of
projects) about the relationship between LOC or FP and time or effort to predict the
estimate of time or effort for this project. The function point measure was originally
designed to be applied to business information systems applications.
To accommodate these applications, the data dimension (the information domain
values discussed previously) was emphasized to the exclusion of the functional and
behavioral (control) dimensions. The feature point measure accommodates applications
in which algorithmic complexity is high. Real-time, process control and embedded
software applications tend to have high algorithmic complexity and are therefore
amenable to the feature point. It measure the size from a different dimension. This
measurement is based on the number and complexity of the following objects: screens,
reports and 3GL components. Basic COCOMO'81 model is a single-valued, static
model that computes software development effort as a function of program size
expressed in estimated lines of code (LOC). Intermediate COCOMO'81 model
computes software development effort as a function of program size and a set of "cost
drivers" that include subjective assessments of product, hardware, personnel, and
project attributes. Detailed COCOMO'81 model incorporates all characteristics of the
intermediate version with an assessment of the cost driver’s impact on each step of the
software engineering process. COCOMO'81 provides point estimates of effort and
schedule, but COCOMO'II provides likely ranges of estimates that represent one
standard deviation around the most likely estimate. COCOMO'II adjusts for software
reuse and reengineering where automated tools are used for translation of existing
software, but COCOMO'81 made little accommodation for these factors COCOMO'II
accounts for requirements volatility in its estimates.
10. Which model is used to compute the effort required to integrate reusable
components or program code that is automatically generated by design or program
Notes translation tools?
(a) An application-composition model
(b) A post-architecture model
(c) A reuse model
(d) An early design model
Objectives
After studying this unit, you should be able to:
z Features of a software design and objectives
z Design principles
z Design concepts-abstraction, refinement, modularity, control hierarchy,
information hiding, etc.
z Various design strategies
z Function oriented design
z Object oriented design
z User interface design.
Refinement
Stepwise refinement is a top-down strategy wherein a program is developed by
continually refining the procedural details at each level. This hierarchy is obtained by
decomposing a statement of function step-by-step until the programming language
statements are obtained.
At each step one or more instructions are decomposed into more detailed
instructions until all the instructions have been expressed in terms of programming
language. Parallel to the instructions, data is also refined along with program and
specifications. Each refinement involves design decisions.
Refinement is nothing but elaboration. A statement of function is defined at a high
level of abstraction which mentions the functions conceptually without specifying the
internal working or structure. With continuous refinement designer provides more detail
at each step continuously.
Modularity
Modularity refers to 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 large
number of reference variables, control paths, global variables, etc. The desirable
properties of a modular system are:
1. Each module is a well defined system that can be used with other applications.
2. Each module has a single specific purpose.
3. Modules can be separately compiled and stored in a library.
4. Modules can use other modules.
5. Modules should be easier to use than to build.
6. Modules are simpler from outside than inside.
Modularity thus enhances the clarity of design which in turn eases coding, testing,
debugging, documenting and maintenance of the software product.
It might seem to you that on dividing a problem into sub problems indefinitely, the
effort required to develop it becomes negligibly small. However, the fact is that on
dividing the program into numerous small modules, the effort associated with the
integration of these modules grows. Thus, there is a number N of modules that result in
the minimum development cost. However, there is no defined way to predict the value
Notes of this N.
In order to define a proper size of the modules, we need to define an effective
design method to develop a modular system. Following are some of the criteria defined
by Meyer for the same:
1. Modular decomposability: The overall complexity of the program will get reduced
if the design provides a systematic mechanism to decompose the problem into sub-
problems and will also lead to an efficient modular design.
2. Modular composability: If a design method involves using the existing design
components while creating a new system it will lead to a solution that does not re-
invent the wheel.
3. Modular understandability: If a module can be understood as a separate
standalone unit without referring to other modules it will be easier to build and edit.
4. Modular continuity: If a change made in one module does not require changing all
the modules involved in the system, the impact of change-induced side effects gets
minimized.
5. Modular protection: If an unusual event occurs affecting a module and it does not
affect other modules, the impact of error-induced side effects will be minimized.
Software Architecture
Software architecture refers to the overall structure of the software and the way in which
this structure provides conceptual integrity for a system. Architecture is the hierarchical
structure of the program components, the way these components interact and the
structure of data that is being used in these components.
Software architecture design must possess the following properties:
1. Structural properties: This design specifies the components of a system and the
manner in which these components are included and interact in the system.
2. Extra-functional properties: The design must include the requirements for
performance, capacity, security, reliability, adaptability, etc.
3. Families of related systems: The design must include those components that can
be re-used while designing similar kinds of systems.
An architectural design can be represented in one of the following ways:
1. Structural model: It represents the architecture as a collection of components.
2. Framework model: It increases the design abstraction level by identifying the
similar kinds of design frameworks contained in similar applications.
3. Dynamic model: It answers the behavioral aspect of the architecture, specifying
the structural or system configuration changes as a result of changes in the external
environment.
4. Process model: It focuses on the designing of business or technical processes that
must be included in the system.
5. Functional model: It represents the functional hierarchy of the system.
Control Hierarchy
Control hierarchy, or program structure, represents the program components’
organization and the hierarchy of control. Different notations are used to represent the
control hierarchy, the most common of these being a tree-like diagram. Depth of a tree
describes the number of levels of control and width refers to the span of control.
Fan-out is the measure of the number of modules that are directly controlled by a
module. Fan-in indicates the number of modules that directly control a particular
module. A module being controlled is called a subordinate and the controlling module is
called a superordinate.
Amity Directorate of Distance and Online Education
Software Design 93
The control hierarchy defines two other characteristics of the software architecture.
Visibility indicates the set of program components that will be invoked or used directly
by a component. Connectivity refers to the set of components that are invoked or used Notes
directly by a program component.
Structural Partitioning
The hierarchical style of the system allows partitioning of the program structure, both
vertically and horizontally. Horizontal partitioning defines a separate branch for each
major program function. Control modules are used to coordinate between the modules
for communication and execution. Horizontal partitioning produces three things as a
result: input, data transformation and output. Partitioning has the following advantages:
1. Software becomes easier to test.
2. Software is easier to maintain.
3. Low side-effects propagation.
4. Software becomes easy to extend.
Disadvantage of the horizontal partitioning is that it causes a lot of data to be
transferred among the various modules which further complicates the control flow.
Vertical partitioning, also called factoring, separates the control and the flow in a
top-down manner. Top level modules perform only control functions while the
low-level modules perform the actual processing, input and output tasks. Thus, a
change made in the control model has higher chances of being propagated to the
subordinate modules. However, the changes in the lower level modules are not likely to
be propagated to the higher level modules. Thus, the vertically partitioned programs are
easily maintainable.
Information Hiding
Notes In order to design best set of modules out of a single software solution, the concept of
information hiding is useful. The principle of information hiding suggests that modules
should be characterized by design decision that hides each one from the other. In other
words, modules should be designed in such a way that the information in one module is
not accessible to other modules that do not require these modules.
Hiding ensures that effective modularity is achieved by defining a set of
independent modules that communicate with one another only the information that is
needed for proper software functioning. Abstraction defines the procedural entities for
the software while hiding defines the access constraints to procedural details and local
data present in the modules.
Structure Charts
A structure chart is a diagram consisting of rectangular boxes representing modules
and connecting arrows. Structure charts encourage top-down structured design and
modularity. Top-down structured design deals with the size and complexity of an
application by breaking it up into a hierarchy of modules that result in an application that
is easier to implement and maintain.
Top-down design allows the systems analyst to judge the overall organizational
objectives and how they can be met in an overall system. Then, the analyst moves to
dividing that system into subsystems and their requirements. The modular programming
concept is useful for the top-down approach: once the top-down approach is taken, the
whole system is broken into logical, manageable-sized modules, or subprograms.
Modular design is the decomposition of a program or application into modules. A
module is a group of executable instructions (code) with a single point of entry and a
single point of exit. A module could be a subroutine, subprogram, or main program. It
also could be a smaller unit of measure such as a paragraph in a COBOL program.
Data passed between structure chart modules has either Data Coupling where only
the data required by the module is passed or Stamp Coupling where more data than
necessary is passed between modules.
mean product
calculate_avera Calculate_produc
t
5.6.3 Pseudocode
Pseudocode notation can be used both at the preliminary stage as well as the
advanced stage. It can be used at any abstraction level. In a Pseudocode, a designer
describes system characteristics using short English language phrases with the help of
keywords like while, if..the..else, End, etc. Keywords and indentation describe the flow
of control while the English phrases describe the processing action that is being taken.
Using the top-down strategy, each English phrase is expanded into a more detailed
Pseudocode till the point it reaches the level of implementation.
z Objects: An object is an entity which has a state and a defined set of operations
which operate on that state. The state is represented as a collection of attributes.
Notes The operations on these objects are performed when requested from some other
object. Objects communicate by passing messages to each other which initiate
operations on objects.
z Messages: Objects communicate through messages. A message comprises of the
identity of the target object, the name of the operation and any operator needed to
perform this operation. In a distributed system, messages are in the form of text
which is exchanged among the objects. Messages are implemented as procedures
or function calls.
z Abstraction: Abstraction is the elimination of the irrelevant information and the
amplification of the essentials. It is discussed in detail in lesson 5.
z Class: It is a set of objects that share a common structure and behavior. They act
as blueprint for objects. E.g. a circle class has attributes: center and radius. It has
two operations: area and circumference.
z Inheritance: The property of extending the features of one class to another class is
called inheritance. The low level classes are called subclasses or derived classes
and the high level class is called the super or base class. The derived class inherits
state and behavior from the super class. E.g. A shape class is a super class for two
derived classes: circle and triangle.
z Polymorphism: When we abstract only the interface of an operation and leave the
implementation to subclasses, it is called polymorphic operation and the process is
called polymorphism.
Figure 5.5: Spiral Model Indicating the User Interface Design Process
The spiral indicates that each of these tasks will occur more than once with each
pass around the spiral representing additional elaboration of requirements and the
resulting design. In most cases, the implementation involves prototyping.
The initial analysis focuses on the user profiles which will interact with the system.
Different user categories are defined based on their skills, understanding, etc. The
requirements are elicited as per these categories i.e. the software engineer tries to
interpret the system perception from each of the class’ view.
Once general requirements have been designed, a more detailed task analysis is
carried out. The analysis of the user environment focuses on the physical work
environment. This information gathered during analysis phase is used to create an
analysis model for the interface. Using this model as the basis the design
activity begins.
The goal of interface design is to define a set of interface objects and actions that
allow a user to perform all define tasks in such a manner to meet all the usability goals.
The implementation activity begins with the creation of a prototype that allows user
scenarios to be evaluated.
Validation focuses on (i) the ability of the interface to implement every user task
correctly, to accommodate all task variations and to achieve all general user
requirements; (ii) the degree of ease of using and learning the interface and (iii) the
acceptance of the interface as a useful tool in the user’s work.
Amity Directorate of Distance and Online Education
100 Software Engineering
Because the activities occur iteratively it is not necessary to mention all the details
in the first pass. Subsequent passes elaborate the task detail, design information and
Notes the operations of the interface.
A good design is the one that has low coupling. Coupling is measured by the
number of interconnections between the modules. I.e. 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. Different types of
coupling are content, common, external, control, stamp and data. The level of coupling
in each of these types is given in Figure 5.7.
Data coupling
Stamp coupling
Control coupling
External coupling
Common coupling
Content coupling
Cohesion
1. Data coupling: When X and Y communicates by passing parameters to one another
and not unnecessary data. Thus, if a procedure needs a part of a data structure, it
should be passed just that and not the complete thing.
2. Stamp Coupling: Although X and Y make use of the same data type but perform
different operations on them.
3. Control Coupling (activating): X transfers control to Y through procedure calls.
4. Common Coupling: Both X and Y use some shared data e.g. global variables. This
is the most undesirable, because if we wish to change the shared data, all the
procedures accessing this shared data will need to be modified.
5. Content Coupling: When X modifies Y either by branching in the middle of Y or by
changing the local data values or instructions of Y.
Cohesion is the measure of the degree of functional dependence of modules. A
strongly cohesive module implements functionality that interacts little with the other
modules. Thus, in order to achieve higher interaction amongst modules a higher
cohesion is desired. Different types of cohesion are listed in Figure 5.8.
Functional cohesion
Sequential cohesion
Communication cohesion
Procedural cohesion
Temporal cohesion
Logical cohesion
Coincidental cohesion
The direction of the arrow in Figure 5.8 indicates the worst degree of cohesion to
the best degree of cohesion. The worst degree of cohesion, coincidental, exists in the
modules that are not related to each other in any way. So, all the functions, processes
and data exist in the same module.
Logical is the next higher level where several logically related functions or data are
placed in the same module.
At times a module initializes a system or a set of variables. Such a module performs
several functions in sequence, but these functions are related only by the timing
involved. Such cohesion is said to be temporal.
When the functions are grouped in a module to ensure that they are performed in a
particular order, the module is said to be procedurally cohesive. Alternatively, some
functions that use the same data set and produce the same output are combined in one
module. This is known as communicational cohesion.
If the output of one part of a module acts as an input to the next part, the module is
said to have sequential cohesion. Because the module is in the process of construction,
it is possible that it does not contain all the processes of a function. The most ideal of all
module cohesion techniques is functional cohesion. Here, every processing element is
important to the function and all the important functions are contained in the same
module. A functionally cohesive function performs only one kind of function and only
that kind of function.
Notes
Given a procedure carrying out operations A and B, we can identify various forms of
cohesion between A and B:
1. Functional Cohesion: A and B are part of one function and hence, are contained
in the same procedure.
2. Sequential Cohesion: A produces an output that is used as input to B. Thus they
can be a part of the same procedure.
3. Communicational Cohesion: A and B take the same input or generate the same
output. They can be parts of different procedures.
4. Procedural Cohesion: A and B are structured in the similar manner. Thus, it is not
advisable to put them both in the same procedure.
5. Temporal Cohesion: Both A and B are performed at moreover the same time.
Thus, they cannot necessarily be put in the same procedure because they may or
may not be performed at once.
6. Logical Cohesion: A and B perform logically similar operations.
7. Coincidental Cohesion: A and B are not conceptually related but share the same
code.
The main reason why the DFD technique is so popular is probably because of the
fact that DFD is a very simple formalism – it is simple to understand and use. Starting
with a set of highlevel functions that a system performs, a DFD model hierarchically
represents various subfunctions. In fact, any hierarchical model is simple to understand.
The human mind is such that it can easily understand any hierarchical model of a
system – because in a hierarchical model, starting with a very simple and abstract
model of a system, different details of the system are slowly introduced through different
hierarchies. The data flow diagramming technique also follows a very simple set of
intuitive concepts and rules. DFD is an elegant modeling technique that turns out to be
Amity Directorate of Distance and Online Education
Software Design 103
useful not only to represent the results of structured analysis of a software problem but
also for several other applications such as showing the flow of documents or items in an
organization. Notes
5.10.2 Data Dictionary
A data dictionary lists all data items appearing in the DFD model of a system. The data
items listed include all data flows and the contents of all data stores appearing on the
DFDs in the DFD model of a system. A data dictionary lists the purpose of all data items
and the definition of all composite data items in terms of their component data items.
For example, a data dictionary entry may represent that the data grossPay consists of
the components regularPay and overtimePay.
grossPay = regularPay + overtimePay
For the smallest units of data items, the data dictionary lists their name and their
type. A data dictionary plays a very important role in any software development process
because of the following reasons:
z A data dictionary provides a standard terminology for all relevant data for use by
engineers working in a project. A consistent vocabulary for data items is very
important, since in large projects different engineers of the project have a tendency
to use different terms to refer to the same data, which unnecessarily causes
confusion.
z The data dictionary provides the analyst with a means to determine the definition of
different data structures in terms of their component elements.
5.10.3. DFD
Levels and Model The DFD model of a system typically consists of several DFDs, viz.,
level 0 DFD, level 1 DFD, level 2 DFDs, etc. A single data dictionary should capture all
the data appearing in all the DFDs constituting the DFD model of a system.
Balancing DFDs
The data that flow into or out of a bubble must match the data flow at the next level of
DFD. This is known as balancing a DFD. The concept of balancing a DFD has been
illustrated in fig. 5.10.. In the level 1 of the DFD, data items d1 and d3 flow out of the
bubble 0.1 and the data item d2 flows into the bubble P1. In the next level, bubble 0.1 is
decomposed. The decomposition is balanced, as d1 and d3 flow out of the level 2
diagram and d2 flows in.
Context Diagram
Notes The context diagram is the most abstract data flow representation of a system. It
represents the entire system as a single bubble. This bubble is labeled according to the
main function of the system. The various external entities with which the system
interacts and the data flow occurring between the system and the external entities are
also represented. The data input to the system and the data output from the system are
represented as incoming and outgoing arrows. These data flow arrows should be
annotated with the corresponding data names.
Transform Analysis
Transform analysis identifies the primary functional components (modules) and the high
level inputs and outputs for these components. The first step in transform analysis is to
divide the DFD into 3 types of parts:
z Input
z Logical processing
z Output
The input portion of the DFD includes processes that transform input data from
physical (e.g. character from terminal) to logical forms (e.g. internal tables, lists, etc.).
Each input portion is called an afferent branch.
The output portion of a DFD transforms output data from logical to physical form.
Each output portion is called efferent branch. The remaining portion of a DFD is called
central transform.
5.11 Summary
Design is the technical kernel of software engineering. Design produces representation
of software that can be assessed for quality. During the design process continuous
refinement of data structures, architecture, interfaces, etc of software are developed,
documented and reviewed.
Amity Directorate of Distance and Online Education
Software Design 105
A large number of design principles and concepts have developed over the last few
decades. Modularity and abstraction allow the designers to simplify the software and
make it reusable. Information hiding and functional independence provide heuristics for Notes
achieving efficient modularity.
The design process comprises of the activities that reduce the level of abstraction.
Structured programming allows the designer to define algorithms which are less
complex, easier to read, test and maintain. The user interface is the most important
element of a computer-based system because if the interface is not designed properly
the user may not be able to effectively tap the power of the application. The user
interface design starts with the identification of user, task and environment
requirements. It is followed by task analysis to define user tasks and actions. After
identifying the tasks, user scenarios are created and analyzed to define a set of
interface objects and actions. The user interface is a window into the software and
moulds the user’s perception of the system.