21.08.2013 Views

Software Engineering for Students A Programming Approach

Software Engineering for Students A Programming Approach

Software Engineering for Students A Programming Approach

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

358 Chapter 29 ■ <strong>Software</strong> metrics and quality assurance<br />

■ how much will this software cost?<br />

■ how much ef<strong>for</strong>t will be needed to alter this software to meet changed needs.<br />

In this chapter we review various ways of applying metrics to software. The purposes<br />

of metrics in software engineering include:<br />

■ predicting qualities of software that is about to be developed<br />

■ making judgments on the quality of a piece of software that has been developed<br />

■ monitoring and improving the software development process<br />

■ comparing and assessing different development approaches.<br />

In this chapter we first review metrics, then look at the application of quality assurance.<br />

29.2 ● Basic metrics<br />

The simplest measure of software is its size. Two possible metrics are the size in bytes<br />

and the size in number of statements. The size in statements is often termed LOCs<br />

(lines of code), sometimes SLOCs (source lines of code). The size in bytes obviously<br />

affects the main memory and disk space requirements and affects per<strong>for</strong>mance. The size<br />

measured in statements relates to development ef<strong>for</strong>t and maintenance costs. But a<br />

longer program does not necessarily take longer to develop than a shorter program,<br />

because the complexity of the software also has an effect. A metric such as LOCs takes<br />

no account of complexity. (We shall see shortly how complexity can be measured.)<br />

There are different ways of interpreting even a simple metric like LOCs, since it is<br />

possible to exclude, or include, comments, data declaration statements, and so on.<br />

Arguably, blank lines are not included in the count.<br />

The second major metric is person months, a measure of developer ef<strong>for</strong>t. Since<br />

people’s time is the major factor in software development, person months usually<br />

determine cost. If an organization measures the development time <strong>for</strong> components,<br />

the in<strong>for</strong>mation can be used to predict the time of future developments. It can also be<br />

used to gauge the effectiveness of new techniques that are used.<br />

The third basic metric is the number of bugs. As a component is being developed, a<br />

log can be kept of the bugs that are found. In week 1 there might be 27, in week 2<br />

there might be 13, and so on. As we shall see later, this helps predict how many bugs<br />

remain at the end of the development. These figures can also be used to assess how good<br />

new techniques are.<br />

Collecting and documenting quality in<strong>for</strong>mation can be seen as threatening to developers<br />

but a supportive culture can help.<br />

29.3 ● Complexity metrics<br />

In the early days of programming, main memory was small and processors were slow.<br />

It was considered normal to try hard to make programs efficient. One effect of this was

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!