Unit 3 (KDS-063)
Unit 3 (KDS-063)
(KDS 063)
Lecture Notes
By
Ms. Pallavi Shukla
U.C.E.R.
SOFTWARE DESIGN –
Software design is the practice of taking a specification of externally observable behavior and adding
details needed for actual computer system implementation , including human interaction, task
management , and data management details.
Software design is a kind of problem solving. Thinking about design as problem solving has many
advantages.
First it suggests that information may be partitioned between the problem and the solution.
A second advantage of thinking about design as problem solving is the perspective it gives on the design
activity.
A third advantage of thinking about design as problem solving is that it suggests the use of time
honoured general problem solving techniques in design.
3. Brainstorming Technique
4. Abstraction Technique – In this case some details of thing are ignored in favor of others.
Abstraction is an important problem solving technique for the following three reasons:
First ignoring non essential aspects of a problem simplifies it and makes the problem easier to
solve.
Software design problems and solutions are often complex, and many aspects of software systems must
be modelled.
These models represent aspects of software systems that do not change during execution.
These models represent software components , their characteristics and unvarying relationships between
software components.
Examples – object and class diagrams, use case diagrams, data structure pictures, implementation
diagrams.
Dynamic Model -
Examples – interaction diagrams, state charts, DFDs, decision trees and tables, mini specs.
The software design process can be decomposed mainly into the following three levels of design:
a) Interface Design
b) Architecture Design
c) Detailed Design
Interface Design -
Interface design is the specification of the interaction between a system its environment.
This phase proceeds at a high level of abstraction with respect to inner workings of the system.
Attention is focused on the dialogues between target system and the users, devices, and other systems
with which interacts.
• Precise description of events in the environment , or messages from agents , to which the
system must respond.
• Precise description of the events or messages that the system must produce.
• Specification of the data, and the formats of the data, coming into and going out of the system.
• User Outputs
• Valid sequences
ARCHITECTURAL DESIGN –
It is the specification of the major components of a system, their responsibilities , properties , interfaces
and the relationships and interactions between them.
• Component interfaces.
DETAILED DESIGN-
It is the specification of the internal elements of all major system components, their structure properties,
relationships, processing and other their algorithms and data structures.
• Unit interfaces
• Unit packaging and implementation , including issues of scope and visibility of program
elements.
Change Change in one part of system doesn’t always One conceptual change requires
require a change in another part of the system. changes to many parts of the
system.
Logic Every piece of logic has one and one home Logic has to be duplicated.
Extension System can be extended with changes in only System cannot be extended so
one place easily.
MODULE –
A system id modular if it is composed of well defined, conceptually simple and independent units
interacting through well defined interfaces.
Advantages of Modularity –
• Modular systems are easier to understand and explain because their parts make sense and can
stand on their own.
• They are easier to document because each part can be documented as an independent unit.
• Programming individual modules is easier because the programmer can focus on just one
small, simple problem rather than a large complex problem.
• Well composed modules are more reusable because they are more likely to comprise part of a
solutions to many problems.
MODULE COUPLING –
The extent to which modules are independent is called Coupling. It is also called Inter Module
Coupling.
When there is little interaction between two modules, the modules are described as loosely coupled,
2. Data Coupling
3. Stamp Coupling
4. Control Coupling
5. Common Coupling
6. Content Coupling
No Direct Coupling – The modules are independent of each other and so are not really components of
a single system.
Data Coupling – It occurs when module passes non global variable to another module.
Stamp Coupling –
It occurs when module passes non global data structure or entire structure to another module.
Control Coupling –
Sending module must know a great deal about the inner workings of the receiving module.
Common Coupling -
It occurs when modules refer to the same global data area or data structure.
Modules that use the same area have quite high level of interdependence.
Content Coupling -
It occurs when one module directly refer to the inner workings od another module.
MODULE COHESION –
Cohesion is the measure of strength of the association of elements within a module. The extent to which
all instructions in a module relate to a single function is called cohesion.
• Cohesion is highest in modules that have a single, clear, logically independent responsibility or
role.
• One practical and long standing practice for achieving cohesion is to form modules that
implement data types.
1) Functional Cohesion –
2) Sequential Cohesion –
The instruction inside a modules are related to each other through the input data.
The first instruction acts on the data that are passed into the module , the second instruction use
the output of the first instruction as its input and so on.
3) Communicational Cohesion -
The activities are related to each other by the data that the modules uses.
Each instruction acts on the same input data or is concerned with the same output data.
4) Procedural Cohesion –
The instruction in a module are related to each other through flow of control.
Sequence is important
The instruction are more related to other modules than they are to each other
5) Temporal Cohesion –
one function
6) Logical Cohesion -
7) Coincidental Cohesion –
The instructions have no relationship to each other at all, they just coincidental fall in the same
module.
• Designs must specify systems that can be constructed on time and within budget
• Designs that specify systems that are easy to change are better.
• Bottom Up Design
Top design is an informal design strategy for breaking problems into smaller problems
A software project is decomposed into subprojects , an this procedure is repeated until the
subtasks have become so simple that an algorithm can be formulated as a solution
Advantages –
- Strong focus on specific requirements helps to make a design responsive to its requirement.
Disadvantages –
In this, the approach is to start “at the bottom” with problems that you already know how
to solve. From there you can work upwards towards a solution to the overall problem.
Advantages –
- Can be used to hide the low level details of implementation and be merged with a top
design technique.
Disadvantages –
- Its focus is not on specific requirements and thus its results may not fit a given need.
- High quality bottom up solutions prove very hard to construct and thus most
frameworks are to some substantial degree undersigned.
FLOWCHARTS – They are tools used to describe or show the logical sequences and steps
that occur in process or decision making situation. The art of developing flowcharts is called
Flowcharting.
User interface can take on many forms but always accomplishes two fundamental tasks:
• Communicating information from machine to the user
• Communicating information from the user to the machine.
MEASUREMENTS –
It is the process by which numbers or symbols are assigned to attributes of entities in
the real world in such a way as to describe them according to clearly defined rules.
Direct Measurement – Direct measurement of an attribute of an entity involved no other
attribute or entity.
It is assessment of something existing.
Indirect Measurement - It means calculation involving other attributes or entities by using
some mathematical model.
MODEL -
It is an abstraction of reality , allowing us to strip away detail and view an entity or concept from a
particular perspective,
PREDICTION SYSTEM –
It consists of mathematical model together with a set of prediction procedures for determining
unknown parameters & interpreting results.
PRODUCTS – They are artifacts , deliverables or documents that result from a process activity.
SOFTWARE METRICES –
It is an attribute (a quality, property or characteristics of an object) of the software
development environment attributes if software objects.
It is a term used to refer to measures of software items.
Software items might be –
i) Software product or partial product
ii) Software process such as coding or specifying an event such as a product failure.
iii) A person involved in software production or use such as a designer or project
managers.
iv) An organisation such as a data processing department or a software house.
• Product Metrices
• Process Metrices
• People Metrices
PRODUCT METRICES –
• Product are those used to build artifacts (SRS, System design, documents) of a
software system.
• Product metrices quantify useful attributes of the software products, including those
for internal consumption.
• These metrices help in assessment if the product is good enough through reports on
attributes like usability, reliability , maintainability & portability.
PROCESS METRICES -
• It quantify useful attributes of the software development process & its environment.
• The goal of process metrices is to do the right job on first time through the process.
PEOPLE METRICES –
• It quantify useful attributes of those generating the products using the available
processes , methods & tools.
• Goal is to keep staff happy, motivated & focused on the task at hand.
1. Size Metrices
a. Lines of code
b. Token Metrices
c. Function Metrices
d. Bang Metrices
3. Composite Flow
6. Quality Metrices
a. Defect Metrices
b. Reliability Metrices
c. Maintainability Metrices
Advantages of LOC –
• Simple to measure
Drawbacks of LOC –
• It is defined on code.
• It characterise only one specific view of size, namely length , it takes
no account of functionally or complexity.
• Bad s/w design may cause excessive line of code
• It is language dependent
• Users cannot easily understand it.
TOKEN METRICES –
It is calculated by counting tokens in the code of a system, program or program unit.
A token is a simple entity that makes up a program.
Ex- if , for , usr_name
BANG METRICES –
Bang as a function metric, indicative of the size of the system , in effect it measures the total
functionality of the software system delivered to the user.
Bang can be calculated from certain algorithm and data primitives available from certain
form a set of formal specifications for the software,
FUNCTION POINTS-
Function Points are basic idea from which productivity metrices could be compared –
FP data is used two ways –
In order to find adjusted FP, UFP is multiplied by technical complexity factor (TCF) which
can be calculated
TCF = 0.65 + (sum of factors) /100
There are 14 technical complexity factors. Each complexity factor is rated on the basis of its
degree of influence, from no influence to very influential.
1. Data Communication
2. Distributed Data Processing
3. Performance Criteria
4. Heavily Utilized Hardware
5. High transaction rates
6. Online Data Entry
7. Online updating
8. End user Efficiency
9. Complex complexity
10. Reusability
11. Ease of Installation
12. Ease of Operation
13. Portability
14. Maintainability
FP = UFP X TCF
Drawbacks of FP -
1. Subjective Counting
2. Hard to automate and difficult to compute
3. Ignores quality of output
4. Oriented to traditional data processing applications
DI = 36 (Degree of Influence)
Function Points
FP=UFP*(0.65+0.01*DI)= 55*(0.65+0.01*36)= 56.01
FP=56.01
Vocabulary ⴄ = ⴄ1 + ⴄ2
Length of Program (N) = N1 + N2
Estimated Program Length N in terms of tokens is given by –
Ň = ⴄ1 log2 ⴄ1 + ⴄ2 log 2 ⴄ2
Volume (V) = Number of bits required to encode the program being
measured
V = N log 2 (ⴄ)
= N log 2 (ⴄ1 + ⴄ2)
Effort (E) – Required to implement the program as
int sum, i ;
sum = 0;
for( i = 1 ; i < = 20; i++)
sum = sum + i;
printf(sum);
Compute Halsted software Science Metrics –
Operators Operands
int = 1 sum = 5
; = 6 i=5
==3 0=1
() = 2 1=1
<= = 1 20 = 1
++ = 1
For = 1
+=1
printf = 1
,=1
Number of distinct operators (ⴄ1) = 10
Number of distinct operands (ⴄ2) = 5
Total number of operators Occurrences (N1) = 18
Total number of operands Occurrences (N2) = 13
Vocabulary ⴄ = ⴄ1 + ⴄ2
= 10 + 5 =15
Ň = ⴄ1 log2 ⴄ1 + ⴄ2 log 2 ⴄ2
= 10 log 2 10 + 5 log 2 5
= 10 (3.32) + 5 (2.32)
= 44.8