You are on page 1of 7

ASSIGNMENT OF SOFTWARE ENGINERING

Name: Prithika Gupta

Roll: 17IT8029

Date: 26th March, 2020

SDLC

1. For each of the following documents, indicate in which phase(s) of the software life cycle it is
produced: final user manual, architectural design, SQA plan, module specification, source
code, statement of work, test plan, preliminary user annual, detailed design, cost estimate,
project plan, test report, documentation.

Ans->

final user manual->Implementation phase

architectural design-> Design phase

SQA plan->Project planning phase

module specification-> Design phase

source code-> Implementation phase

statement of work-> Feasibility phase

test plan->Requirement phase

preliminary user annual->Requirement phase

detailed design-> Design phase

cost estimate-> Project planning phase

project plan-> Project planning phase

test report->Testing phase

documentation->Implementation phase

2. Order the following tasks in terms of the waterfall model: acceptance testing, project planning,
unit testing, requirements review, cost estimating, high level design, market analysis, low-level
design, systems testing, design review, implementation, requirement specification.

Ans->
Market analysis->project planning->cost estimating->requirement specification ->requirements
review->high-level design-> low-level design->design review->implementation->unit testing-
>systems testing-> Acceptance testing.

3. How does a phased life cycle model assist software management?

A phased life cycle model provides a framework that emphasizes planning and control to try
to achieve predictability over project costs and schedules. The phased life cycle improves the
visibility of the project. The project can be managed by using the phases as milestones.
More detailed phases will allow closer monitoring of progress.

SOFTWARE METRICS

1. What is McCabe’s cyclomatic number?

Ans-> McCabe’s cyclomatic number indicates the complexity of program. It is a quantitative


measure of the number of linearly independent paths through a program's source code.

2. In Halstead’s metrices, what is the significance of: (i) operators and operands (ii) potential
operands, (iii) Length (iv) Estimated length (v) Volume (vi) Potential volume (vii) Implementation
Level?

Ans->

i)Operators and operands: Operands are tokens that has a value. Variables & constants are
operands. Everything else is an operator.

Ii)Potential operands: Potential operands consist of minimal set of values needed to implement any
algorithm.
It includes values read in; parameters passed in & global values accessed within the algorithm.

(iii) Length: The length of the program in tokens is equal to the total count of operators N1 & the
total count of operands N2

(iv) Estimated length: This gives an estimate of the size of the program based on number of
operators & operands

• Est N = 1 log2 1 + 2 log2 2

(v) Volume : V =N* log2( 1 + 2)


It is the number of bits it would take to encode the program being measured

(vi)Potential volume: It is the minimal size of a solution to a problem solved in any language
Halstead assumes there would be only two operators in this implementation, the name of the
function & the grouping operator

(vii) Implementation Level: The ratio of the minimal (potential) volume to the actual volume relates
how close the current implementation is to minimal implementation as measured by the potential
volume. It is expressed as:

• L = V*/V

3. How is effort and time calculated in Halstead method?

Expression for effort: Effort required to implement an algorithm is given as E = V/L and the unit is
emd where V is the volume and L is the level.

Expression for time: The time needed to implement the algorithm is given by

T = E/S (secs) where E is effort and S is Stroud number (S = 5-20 emd/sec).

4. Why is the number of decisions +1 an important method for calculating McCabe’s cyclomatic no.?

Ans->Number of decisions is an important method for calculating McCabe’s cyclomatic no because it


would be very time consuming to have the to construct control flow graph for large programs. The
higher the count, the more is the complexity.

5. Why is monotonicity an important characteristic of a size or effort metric such as Halstead’s effort
metric?

Ans-> Monocity is an important characteristic of a size or effort matric because adding more code
can cause the value of the effort metric to decrease, then the metric’s behaviour is not
understandable. It may also mean that the metric is manipulated.

6. Why is complexity not readily measurable?

(Ans: Complexity is not readily measurable because complexity is not well defined and each one has
different interpretation. There are many aspects of complexity and each person may have a slightly
different interpretation of complexity. It is interaction between person and code that makes it
difficult to define.

7. Calculate McCabe’s complexity on the following source code. Draw a control flow graph.

Read x, y, z;
Type = ‘scalene’;

If (x= =y or x= =z or y = =x) type = ‘isosceles’;

If(x= =y or x= =z) type= ‘equilateral’;

If(x> =y + z or y > =x + z or z>= x + y) type= ‘not a triangle’;

If(x< =0 or y< =0 or z< =0) type = ‘bad inputs’;

Print type;

CONTROL FLOW GRAPH

Complexity: Complexity is given by M=E-N+2 where E is the no of edges, N is the number of nodes

M= 12 – 9 + 2=5
8. Calculate Halstead’s basic measures on the triangle code of earlier problem.

Ans->Calculating Halstead measures:

operators: == 5 times, >= 3 times, <= 3 times, = 5 times, Read 1 time, type 5 times, ‘scalene’ 1
(23,7)time, ‘isosceles’ 1 time, ‘equilateral’ 1 time, ‘not a triangle’ 1 time, ‘bad inputs’ 1 time, if 4
times,(8,5)
() 4 times ; 7 times, print 1 time (12,3)
operands: x 9 times,y 7 times z 6 times ,0 3 times
Basic count
eta1 = 15
eta2 = 4
êta total = 19
eta2* = 3
N1 = 43
N2 = 25
N = 68
Est N = 15 * log2 15 + 4 * log2 4 = 15 * 3.9 + 4 * 2.0 = 58.5+ 8.0 = 66.5
V = 68 * log2 19 = 68 * 4.24 = 288.32
V* = 5 log2 5 = 5 * 3.2 = 11.6
L = 4.8 / 98.8 = 0.04
E=V / L=288.32/.04=7208
T=E / S=E / 5=1441.6

9. Calculate Halstead’s basic measures on factorial code given below:

int fact (int n)

{ if (n= = 0)

{ return 1;

else

{ return n*fact(n-1);

Ans->

operators: int 2 times; ( ) 3 times; { } 3 times; if 1 times; == 1 times; return 2 times; ‘‘;’’ 2 times;
else 1 times; * 1 times; —1 times.

operands: fact 2 times; n 4 times; 0 1 times; 1 2 times;


basic counts
eta1 = 10
eta2 = 4
eta total = 14
eta2* = 1
N1 = 17
N2 = 9
N = 26
Est N = 10 * log2 10 + 4 * log2 4 = 10 * 3.32 + 4 * 2.0 = 33.2+ 8.0 = 41.2
V = 26 * log2 14 = 26 * 3.8 = 98.8
V* = 3 log2 3 = 3 * 1.6 = 4.8
L = 4.8 / 98.8 = 0.048
E=V / L=98.8 / .048=2058.33
S=E / S= 2058.33/ 5= 411.66

DESIGN

1. What is modularity?

• Ans->Modularity is the process of partitioning a system into modules which are separately
solvable & modifiable separately. A module is a logically separable part of a program. It is a
program unit that is discrete & identifiable with respect to compiling & loading. In terms of
common programming language constructs, it can be a macro, a function, a procedure, sub-
routine, a process or a package.

2. Draw a modular structure of compiler. 2. What is difference between functional and data
abstraction. Illustrate with the example of compiler.

Diagram of modular structure of compiler


Difference between functional and data abstraction:
----Functional abstraction provides methods to do some work (what) while hiding details of
how this is done. A method might – Compute a value (hiding the algorithm) – Test some
condition (hiding all the details of exactly what is considered and how. For example, in case
of compiler let us take the parsing function, it takes a grammar, a string input to be parsed
and a stack as input and parses the input string. The user does not know the details of this
function.

----Data abstraction-> Data abstraction refers to providing only essential information about
the data to the outside world, hiding the background details or implementation. Data
abstraction enforces a clear separation between the abstract properties of a data type and
the concrete details of its implementation. For example, in case of compiler, we compile our
file we get the compiled file without knowing the details like tokens, lexemes, syntax
analyser etc.

3. What is difference between SDM & OODM?

SDM-> Software development methodology is a process or series of processes used in software


development. A software development methodology specifies how the activities related to software
development like requirements analysis, design, coding, testing is organized in the entire s/w
development effort. They are the sequence of activities that shall produce a software.

OODM-> OOM is a system development approach encouraging and facilitating re-use of software
components. With this methodology, a computer system can be developed on a component basis
which enables the effective re-use of existing components and facilitates the sharing of its
components by other systems. Through the adoption of OOM, higher productivity, lower
maintenance cost and better quality can be achieved.

You might also like