smqa unit ii

45
MEASURING INTERNAL PRODUCT ATTRIBUTES CHAPTER 2

Upload: manoj-patil

Post on 07-May-2015

400 views

Category:

Education


3 download

TRANSCRIPT

Page 1: Smqa unit ii

MEASURING INTERNAL PRODUCT ATTRIBUTES

CHAPTER 2

Page 2: Smqa unit ii

2.1 Aspects of Software Size

Effort Productivity Cost

Software size can be outlined using three attributes: Length Functionality Complexity

Mr. M. E. Patil S.S.B.T COET, Bambhori

Page 3: Smqa unit ii

2.2 Length Code Traditional code measures Dealing with non-textual or external code

Specification and designs

2.3 Functionality Function Points

Measurement Parameters Count Weight Factor

Simple Ave Complex

Total

Number of Inputs * 3 4 6Number of User Outputs * 4 5 7Number of User Inquiries * 3 4 6Number of Files * 7 10 15Number of External Interfaces * 5 7 10Count-Total

Mr. M. E. Patil S.S.B.T COET, Bambhori

Page 4: Smqa unit ii

FP = count-total * )](*01.065.0[ iFSUM

iF are complexity adjustment values founded on theanswers to the questions in the table below.Fi

1 Does the system require reliable back up and recovery?

2 Are data communication required

3 Are there distributed processing functions?

4 Is performance critical

5 Will the system run in an existing, heavily utilized operating system

6 Does the system require on-line entry?

7 Does the on-line data entry require the input transaction to be built over multiple screen oroperations?

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 the 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 by the user?

TotalMr. M. E. Patil

S.S.B.T COET, Bambhori

Page 5: Smqa unit ii

months-personFP ty Productivi

FPquality Quality

FP£ Cost

FPiondocumentat of pages ion Documentat

Mr. M. E. Patil S.S.B.T COET, Bambhori

Page 6: Smqa unit ii

COCOMO 2.0

• Alternatives to lines of code as a size input for a revised COCOMO, Boehm chose function points for use when the system is totally specified.

• They required a size measure for earlier in the development stage, when feasibility is being considered and prototypes produced.

• They choose object points for this early size measure in COCOMO 2.0.

Mr. M. E. Patil S.S.B.T COET, Bambhori

Page 7: Smqa unit ii

• To calculate object points, an initial size measure is produced by counting the number of screens, reports and third-generation language elements that are to be included in the application.

• Each object is classified as simple, medium or difficult in a manner close to function points (See table below).

Mr. M. E. Patil S.S.B.T COET, Bambhori

Page 8: Smqa unit ii

For ScreensNumber and source of data tablesNumber of viewscontained

Total < 4(<2 server,< 2 clients)

Total <8(2-3 servers,3-5 client)

Total 8+(>3 server,>5 client)

<3 Simple Simple Medium3-7 Simple Medium Difficult8+ Medium Difficult Difficult

For ReportsNumber and source of data tablesNumber ofsections contained

Total < 4(<2 server,< 2 clients)

Total <8(2-3 servers,3-5 client)

Total 8+(>3 server,>5 client)

<3 Simple Simple Medium3-7 Simple Medium Difficult8+ Medium Difficult Difficult

Table Object point complexity levels. COCOMO 2.0

Mr. M. E. Patil S.S.B.T COET, Bambhori

Page 9: Smqa unit ii

Table Complexity weights for object points.

Object type Simple Medium Difficult

Screen 1 2 3

Report 2 5 8

3GL component - - 10

The reuse is taken in account.

New object points = (object points) x (100 – r)/100

Where r is the % of reused components

Mr. M. E. Patil S.S.B.T COET, Bambhori

Page 10: Smqa unit ii

DeMarco’s Approach

• DeMarco produced a functionality measure founded on his structured analysis and design notation.

• These bang metrics included two measures: – one for “function strong” systems, and – another for “data strong” systems.Bang may be defined formally and its computation

can be automated within CASE tools that support the mehtodology

Mr. M. E. Patil S.S.B.T COET, Bambhori

Page 11: Smqa unit ii

Function Strong

• The function bang measure is founded on the number of functional primitives (the number of lowest level bubbles) in a data-flow diagram.

• The basic function-primitive count is weighted based on the kind of functional primitive and the number of data tokens used in the primitive.

Mr. M. E. Patil S.S.B.T COET, Bambhori

Page 12: Smqa unit ii

Data Strong

• The data bang measure is founded on the number of entities in the entity-relationship model.

• The basic entity count is weighted according to the number of associations involving each entity.

• These can be easily adapted for structured analysis technique.

Mr. M. E. Patil S.S.B.T COET, Bambhori

Page 13: Smqa unit ii

Complexity

• Complexity of problem:- Amount of resources required for an optimal solution.

• Complexity of solution:- Resources needed for implementation of a particular solution.– Time complexity :- resource is computer time– Space complexity:- resource is computer memory

Mr. M. E. Patil S.S.B.T COET, Bambhori

Page 14: Smqa unit ii

• Measuring algorithmic efficiency:-– Efficiency of a searching or sorting algorithm can

be measured as the function f(n) representing the number of primitive operations required for an input list of size n.

Mr. M. E. Patil S.S.B.T COET, Bambhori

Page 15: Smqa unit ii

Big-O notations

• A precise mathematical formalism is called as Big-O notation.

• It allows us to define an order relation on functions.

• This permits us to define relation to characterize efficiency.

• We derive it of a function f(n) by finding the dominating term of f(n) an then ignoring constant multiples.

Mr. M. E. Patil S.S.B.T COET, Bambhori

Page 16: Smqa unit ii

• F(n) = 3 n2 + 2n +26• The dominating term of f(n) is 3n2• Ignore the constant 3 it will become n2• Thus we can say that big-o n2 can be written

as @(n2)

Mr. M. E. Patil S.S.B.T COET, Bambhori

Page 17: Smqa unit ii

Structure

• Types of structural measures

– Control flow structure– Data-flow structure– Data structure

Mr. M. E. Patil S.S.B.T COET, Bambhori

Page 18: Smqa unit ii

Control flow

• It address the sequence in which instructions are executed in a program.

• This aspect of structure reflects the iterative and looping nature of program

• Simple size counts an instruction just once, control flow makes more visible the fact that an instruction maybe executed many times as the program is actually rns.

Mr. M. E. Patil S.S.B.T COET, Bambhori

Page 19: Smqa unit ii

Data flow

• It follows the trail of data item as it is created or handled by the program.

• It trace the behavior of the data as it interacts with the program.

Mr. M. E. Patil S.S.B.T COET, Bambhori

Page 20: Smqa unit ii

Data Structure

• It is the organization of the data itself, independent of program.

• The structure of data tells us about the difficulty involved in writing programs to handle the data.

Mr. M. E. Patil S.S.B.T COET, Bambhori

Page 21: Smqa unit ii

Control-Flow Structure

• The control flow measures are usually modeled with directed graph.

• Each node (or point) corresponds to a program statement

• Each arc (or directed edge) indicates the flow of control from one statement to another.

• We call these directed graphs control flow graphs or flow graphs.

Mr. M. E. Patil S.S.B.T COET, Bambhori

Page 22: Smqa unit ii

2.7 Control-Flow Structure Flow graphs-

10

20

30

40

50

6080

90

120

110

10 INPUT P

20 Div = 2

30 Lim=INT(SQR(P))

40 Flag = P/Div- INT(P/Div)

50 If Flag = 0 OR Div = Lim THEN 80

60 Div = Div +170 GO TO 4080 IF Flag <> 0 OR P>4 THEN 11090 Print Div100 GO TO 120110 Print P

120 End

Mr. M. E. Patil S.S.B.T COET, Bambhori

Page 23: Smqa unit ii

Flow graph model of structure

• Graph consists of set of points (or nodes) and line segments (or edges).

• In a directed graph , each edge is assigned a direction , indicated by a arrowhead on the edge . This directed edge is called an arc.

• Arc is an ordered pair , <x , y> where x and y (nodes) are the starting and ending point of the arc.

Mr. M. E. Patil S.S.B.T COET, Bambhori

Page 24: Smqa unit ii

• In-degree:- of the node is the number of arcs arriving at the node

• Out-degree:- of the node is the number of arcs that leave the node.

• A path is the sequence of consecutive (directed ) edges, some of which may be traversed more than once during sequence.

• Simple path is the one in which there are no repeated edges.

Mr. M. E. Patil S.S.B.T COET, Bambhori

Page 25: Smqa unit ii

• A Flowgraph is a directed graph in which two nodes, the start node and the stop nodes, obeys the properties:-– Stop node has out degree zero– And every node lies on the some path from the

start node to the stop node

Mr. M. E. Patil S.S.B.T COET, Bambhori

Page 26: Smqa unit ii

Mr. M. E. Patil S.S.B.T COET, Bambhori

Page 27: Smqa unit ii

Sequencing and Nesting

• There are only two operation available with which we can build a new flow graph form the old.

Mr. M. E. Patil S.S.B.T COET, Bambhori

Page 28: Smqa unit ii

Mr. M. E. Patil S.S.B.T COET, Bambhori

Page 29: Smqa unit ii

Mr. M. E. Patil S.S.B.T COET, Bambhori

Page 30: Smqa unit ii

Mr. M. E. Patil S.S.B.T COET, Bambhori

Page 31: Smqa unit ii

Models of modularity and information flow

2.8 Modularity and Information Flow Attributes

Main

Read_Scores Average

Calc_Av Print_Av

Scores

Average

Average

ScoresScores

eof

Mr. M. E. Patil S.S.B.T COET, Bambhori

Page 32: Smqa unit ii

A

B C

D E

Module A calls B, C

Module B calls D

Module C calls D, E

Global Modularity

riablemodules/va Moceduresmodules/prM

2

1

==

Module call-graph

Mr. M. E. Patil S.S.B.T COET, Bambhori

Page 33: Smqa unit ii

Morphology

Size 12 nodes, 15 edgesDepth 3Width 6Edge-to-node ratio 1.25

Mr. M. E. Patil S.S.B.T COET, Bambhori

Page 34: Smqa unit ii

Coupling No coupling relation Data coupling relation Stamp coupling relation Control coupling relationCommon coupling relation Content coupling relation

Cohesion Functional Sequential Communicational Procedural Temporal Logical Coincidental

modules ofnumber totalcohesion functional having modules ofnumber

ratio Cohesion =

Mr. M. E. Patil S.S.B.T COET, Bambhori

Page 35: Smqa unit ii

Information Flow

a

b c d e

Fan-out for the figure is 4.

w x y

z

Fan-in is 3 for z.

Mr. M. E. Patil S.S.B.T COET, Bambhori

Page 36: Smqa unit ii

( )2out_fan×in_fan×length

WC

DRCWFD

GDR RD PWFWS

DOC

Henry and Kafura’s Metrics

Mr. M. E. Patil S.S.B.T COET, Bambhori

Page 37: Smqa unit ii

Module Fan-in Fan-out [(fan-in)(fan-out)]

Length Complexity

WC 2 2 16 30 480FD 2 2 16 11 176CW 3 3 81 40 1080DR 1 0 0 23 0GDN 0 1 0 14 0RD 2 1 4 28 112FWS 1 1 1 46 46PW 1 1 1 29 29

Shepperd’s Metric

24 )out_fan×in_fan(=IF mmm

mIF4IF4=Sum( )

Mr. M. E. Patil S.S.B.T COET, Bambhori

Page 38: Smqa unit ii

Moses, Farrow and Smith Metric

Information flow Advantages• Measures total level of information flow between the modules of a system.• Evaluates potential design changes.• Allows the identification of design problems such as modules with a large amount of fan-in and fan-out.• Can be produced in the design stage • Takes into account data-driven programs.• Address issues such as complexity and cohesion.• Suitable for identifying software that exhibits maintenance problems and may be error prone and unreliable.• Appropriate for identifying lack of cohesion, stress points and missing levels of design abstraction.• Provides motivation for their use in the prediction of cohesion.

Information flow disadvantages• All the flows have equal weighting.• If there is no external interactions can give misleading values.• Underestimates local and global information flows

Mr. M. E. Patil S.S.B.T COET, Bambhori

Page 39: Smqa unit ii

Object-Oriented Metrics

Metric 1: weighted methods per class (WMC)Metric 2: depth of inheritance tree (DIT)Metric 3: number of children (NOC)Metric 4: coupling between object classes (CBO)Metric 5: response of the class (RFC)Metric 6: lack of cohesion metric (LCOM)

2.9 Data Structures

2.10 Difficulties with General “Complexity” Measures2.11 Measuring External Product Attribute

Mr. M. E. Patil S.S.B.T COET, Bambhori

Page 40: Smqa unit ii

Metrics

As is utility

General Utility

Maintainability

Portability

Reliability

Human Engineering

Testability

Understandability

Efficiency

Modifiability

Device Independence

Completeness

Self descriptiveness

Communicativeness

Conciseness

Device efficiency

Structuredness

Legibility

Accessibility

Consistency

Accuracy

Augmentability

Primary uses Intermediate

ConstructionPrimitive Constructs

Modeling Software Quality

Mr. M. E. Patil S.S.B.T COET, Bambhori

Page 41: Smqa unit ii

Early model

The ISO 9126 standard quality modelFunctionalityReliabilityEfficiencyUsabilityMaintainabilityPortability

Mr. M. E. Patil S.S.B.T COET, Bambhori

Page 42: Smqa unit ii

Products

Measured value

Stated or implied needs

ISO 9126 & other technical info

Managerial requirements

Requirement definition

Quality Requirement definition Metric

selectionRating level definition

Assessment criteria definition

Preparation

Software development

Measurement

Rating

Assessment

Related value

Result (accepted or unaccepted)

Mr. M. E. Patil S.S.B.T COET, Bambhori

Page 43: Smqa unit ii

Measuring Aspects of Quality

ERET

-1=yPortabilit

ET – resources needed to move the system to the target environmentER – measure of the resources needed to produce the system for the resident environment.

Defects-based quality measures

sizeproduct defects known ofnumber

densitydefect =

UsabilityUsability of a software product is the extent to which the product is convenient and practical to use.

Entry level Learnability Handling ability

Mr. M. E. Patil S.S.B.T COET, Bambhori

Page 44: Smqa unit ii

%=100

quality * quantity esseffectiven task

time taskesseffectiven

esseffectiven temporal =

%= 100time task

time veunproducti - time task period productive

Reusability

ReliabilityProbability of failure on demandRate of Fault OccurrenceMean time to failureAvailability

Mr. M. E. Patil S.S.B.T COET, Bambhori

Page 45: Smqa unit ii

Maintainability

Understandability

Mr. M. E. Patil S.S.B.T COET, Bambhori