KCA302 SE Unit3 Notes
KCA302 SE Unit3 Notes
KCA302 SE Unit3 Notes
The following items are designed and documented during the design phase:
Different modules required.
Control relationships among modules.
Interface among different modules.
Data structure among the different modules.
Algorithms required to implement among the individual modules.
1. Stands for It stands for High-Level Design. It stands for Low-Level Design.
3. Purpose The HLD states the concise LLD states the particular efficient logic
functionality of each component. of the component.
4. Also, known as HLD is also called a System or LLD is also called details or micro-
macro-level design. level design.
5. Developed by Solution Architect prepares the Designer and developer prepare the
High-Level Design. Low-Level Design.
8. Conversion The HLD changes the client or The LLD changes the high-level
business requirement into a high- solution to a comprehensive solution.
level solution.
9. Probable output The high-level design is necessary to A low-level design is required for
understand the flow across several creating the configurations and
system objects. troubleshooting inputs.
10. Input Criteria The input measure in high-level The input measure in low-level design
design is SRS (Software is the reviewed HLD (High- Level
Requirement Specification). Design).
11. Output Criteria The output measures in the HLD are The output bases in the low-level
functional design, database design, design are the unit test plan and
and review record. program specification.
Modularization
Modularization is a technique to divide a software system into multiple discrete and
independent modules, which are expected to be capable of carrying out task(s)
independently. These modules may work as basic constructs for the entire software.
Designers tend to design modules such that they can be executed and/or compiled separately
and independently.
Modular design unintentionally follows the rules of ‘divide and conquer’ problem-solving
strategy this is because there are many other benefits attached with the modular design of a
software.
Advantage of modularization:
Smaller components are easier to maintain
Program can be divided based on functional aspects
Desired level of abstraction can be brought in the program
Components with high cohesion can be re-used again
Concurrent execution can be made possible
Desired from security aspect
Flowcharts are written with program flow from the top of a page to the bottom. Each
command is placed in a box of the appropriate shape, and arrows are used to direct program
flow. The following shapes are often used in flowcharts:
Pseudocode is a method of describing computer algorithms using a combination of natural
language and programming language. It is essentially an intermittent step towards the
development of the actual code. It allows the programmer to formulate their thoughts on the
organization and sequence of a computer algorithm without the need for actually following
the exact coding syntax. 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. Although pseudocode is frequently used there are no set of
rules for its exact implementation. In general, here are some rules that are frequently
followed when writing pseudocode:
The usual symobols are used for arithmetic operations (+, -, *, / , **).
Symbolic names are used to indicate the quantities being processed.
Indentation should be used to indicate branches and loops of instruction.
Example- For a given value, Limit, what is the smallest positive integer Number for which
the sum is greater than Limit. Where ‘Sum = 1 + 2 + ... + Number’ and What is the value for
this Sum?
Pseudocode:
Input: An integer Limit
Ouput: Two integers: Number and Sum
1. Enter Limit
2. Set Number = 0.
3. Set Sum = 0.
4. Repeat the following:
a. If Sum > Limit, terminate the repitition, otherwise.
b. Increment Number by one.
c. Add Number to Sum and set equal to Sum.
5. Print Number and Sum.
FlowChart:
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.
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.
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.
Design Strategies
Design strategy is a systematic and intentional approach to creating solutions that meet
specific objectives.
Advantages:
Breaking problems into parts help us to identify what needs to be done.
At each step of refinement, new parts will become less complex and therefore easier
to solve.
Parts of the solution may turn out to be reusable.
Breaking problems into parts allows more than one person to solve the problem.
S.
No. TOP DOWN APPROACH BOTTOM UP APPROACH
In this top function of system might In this sometimes we can not build a
7.
be hard to identify. program from the piece we have started.
Pros-
Easier isolation of interface errors Pros-
It benefits in the case error occurs Easy to create test conditions
9. towards the top of the program. Test results are easy to observe
Defects in design get detected It is suited if defects occur at the bottom
early and can be corrected as an of the program.
early working module of the
S.
No. TOP DOWN APPROACH BOTTOM UP APPROACH
program is available.
Cons-
Cons-
There is no representation of the working
Difficulty in observing the output
model once several modules have been
of test case.
constructed.
Stub writing is quite crucial as it
There is no existence of the program as an
leads to setting of output
10. entity without the addition of the last
parameters.
module.
When stubs are located far from
From a partially integrated system, test
the top level module, choosing test
engineers cannot observe system-level
cases and designing stubs become
functions. It can be possible only with the
more challenging.
installation of the top-level test driver.
Software Metrics:
A metric is a measurement of the level at which any attribute belongs to a system product
or process. Software metrics is a quantifiable or countable assessment of the attributes of a
software product. There are 4 functions related to software metrics:
1. Planning
2. Organizing
3. Controlling
4. Improving
Software measurement is a diverse collection of these activities that range from models
predicting software project costs at a specific stage to measures of program structure.
Features:
Variations such as “source lines of code”, are used to set out a codebase.
LOC is frequently used in some kinds of arguments.
They are used in assessing a project’s performance or efficiency.
LOC method of measurement does not apply to projects that deal with visual (GUI-
based) programming. As already explained, Graphical User Interfaces (GUIs) use
forms basically. LOC metric is not applicable here.
Productivity is defined as KLOC / EFFORT, where effort is measured in person-
months.
Advantages:
Most used metric in cost estimation.
Its alternates have many problems as compared to this metric.
It is very easy in estimating the efforts.
Disadvantages:
Very difficult to estimate the LOC of the final program from the problem
specification.
It correlates poorly with quality and efficiency of code.
It doesn’t consider complexity.
It is language dependent.
It takes no account of functionality.
Bad software design may cause an excessive lines of code.
Research has shown a rough correlation between LOC and the overall cost and length of
developing a project/ product in Software Development, and between LOC and the
number of defects. This means the lower your LOC measurement is, the better off you
probably are in the development of your product.
Example
void selSort(int x[], int n) {
//Below function sorts an array in ascending order
int i, j, min, temp;
for (i = 0; i < n - 1; i++) {
min = i;
for (j = i + 1; j < n; j++)
if (x[j] < x[min])
min = j;
temp = x[i];
x[i] = x[min];
x[min] = temp;
}
}
So, now If LOC is simply a count of the number of lines then the above function shown
contains 13 lines of code (LOC). But when comments and blank lines are ignored, the
function shown above contains 12 lines of code (LOC).
Halstead’s software metrics can be used to estimate the size, complexity, and effort
required to develop and maintain a software program. However, they have some
limitations, such as the assumption that all operators and operands are equally important,
and the assumption that the same set of metrics can be used for different programming
languages and development environments.
Overall, Halstead’s software metrics can be a useful tool for software developers and
project managers to estimate the effort required to develop and maintain software
programs.
Example – List out the operators and operands and also calculate the values of software
science measures like
int sort (int x[ ], int n)
{
int i, j, save, im1;
/*This function sorts array x in ascending order */
If (n< 2) return 1;
for (i=2; i< =n; i++)
{
im1=i-1;
for (j=1; j< =im1; j++)
if (x[i] < x[j])
{
Save = x[i];
x[i] = x[j];
x[j] = save;
}
}
return 0;
}
Explanation
Operators Occurrences Operands Occurrences
int 4 sort 1
() 5 X 7
, 4 N 3
[] 7 I 8
if 2 J 7
< 2 save 3
; 11 im1 3
for 2 2 2
= 6 1 3
– 1 0 1
<= 2 – –
++ 2 – –
return 2 – –
{} 3 – –
Objectives of FPA
The basic and primary purpose of the functional point analysis is to measure and provide the
software application functional size to the client, customer, and the stakeholder on their
request. Further, it is used to measure the software project development along with its
maintenance, consistently throughout the project irrespective of the tools and the
technologies.
2. FP characterizes the complexity of the software system and hence can be used to depict
the project time and the manpower requirement.
3. The effort required to develop the project depends on what the software does.
4. FP is programming language independent.
5. FP method is used for data processing systems, business systems like information
systems.
6. The five parameters mentioned above are also known as information domain
characteristics.
7. All the parameters mentioned above are assigned some weights that have been
experimentally determined and are shown in Table
The functional complexities are multiplied with the corresponding weights against each
function, and the values are added up to determine the UFP (Unadjusted Function Point) of
the subsystem.
Here that weighing factor will be simple, average, or complex for a measurement parameter
type.
The Function Point (FP) is thus calculated with the following formula.
FP = Count-total * [0.65 + 0.01 * ∑(fi)] = Count-total * CAF
Also note that ∑(fi) ranges from 0 to 70, i.e., 0 <= ∑(fi) <=70
and CAF ranges from 0.65 to 1.35 because
a. When ∑(fi) = 0 then CAF = 0.65
b. When ∑(fi) = 70 then CAF = 0.65 + (0.01 * 70) = 0.65 + 0.7 = 1.35
8. LOCs of an application can be estimated from FPs. That is, they are
interconvertible. This process is known as backfiring. For example, 1 FP is equal to
about 100 lines of COBOL code.
9. FP metrics is used mostly for measuring the size of Management Information System
(MIS) software.
10. But the function points obtained above are unadjusted function points (UFPs). These
(UFPs) of a subsystem are further adjusted by considering some more General System
Characteristics (GSCs). It is a set of 14 GSCs that need to be considered. The procedure
for adjusting UFPs is as follows:
Degree of Influence (DI) for each of these 14 GSCs is assessed on a scale of 0 to 5.
(b) If a particular GSC has no influence, then its weight is taken as 0 and if it has a
strong influence then its weight is 5.
The score of all 14 GSCs is totaled to determine Total Degree of Influence (TDI).
Then Value Adjustment Factor (VAF) is computed from TDI by using the
formula: VAF = (TDI * 0.01) + 0.65
Remember that the value of VAF lies within 0.65 to 1.35 because
a. When TDI = 0, VAF = 0.65
b. When TDI = 70, VAF = 1.35
c. VAF is then multiplied with the UFP to get the final FP count: FP = VAF * UFP
Example: Compute the function point, productivity, documentation, cost per function for
the following data:
1. Number of user inputs = 24
2. Number of user outputs = 46
3. Number of inquiries = 8
4. Number of files = 4
5. Number of external interfaces = 2
6. Effort = 36.9 p-m
7. Technical documents = 265 pages
8. User documents = 122 pages
9. Cost = $7744/ month
Solution:
Measurement Parameter Count Weighing
factor
In case, when exit point is directly connected back to the entry point. Here, the graph is
strongly connected, and cyclometric complexity is defined as
M=E–N+P
where E = the number of edges in the control flow graph
N = the number of nodes in the control flow graph
P = the number of connected components
In the case of a single method, P is equal to 1. So, for a single subroutine, the formula can
be defined as
M=E–N+2
where E = the number of edges in the control flow graph
N = the number of nodes in the control flow graph
P = the number of connected components
The cyclomatic complexity calculated for the above code will be from the control flow
graph. The graph shows seven shapes (nodes), and seven lines (edges), hence cyclomatic
complexity is 7-7+2 = 2.
Example:
if A = 10 then
if B > C
A=B
else A = C
endif
endif
print A, B, C
Advantage of CFG:
There are many advantages of a control flow graph. It can easily encapsulate the
information per each basic block. It can easily locate inaccessible codes of a program and
syntactic structures such as loops are easy to find in a control flow graph.
Master Software Testing and Automation in an efficient and time-bound manner by
mentors with real-time industry experience.