Software Engineering for Students A Programming Approach

Software Engineering for Students A Programming Approach Software Engineering for Students A Programming Approach

web.firat.edu.tr
from web.firat.edu.tr More from this publisher
21.08.2013 Views

4.2 The concept of a requirement 37 Establishing the requirements for a software system is the first step in trying to ensure that a system does what its prospective users want. This endeavor continues throughout the software development and is called validation. The requirements specification has a second vital role. It is the yardstick for assessing whether the software works correctly – that it is free from bugs. The job of striving to ensure that software is free from errors is a time-consuming and difficult process that takes place throughout development. It is called verification. Errors in specification can contribute hugely to testing and maintenance costs. The cost of fixing an error during testing can be 200 times the cost of fixing it during specification. It is estimated that something like 50% of bugs arise from poor specification. The remedy of course is to detect (or prevent) bugs early, that is, during specification. It is easy to write poor requirements specifications for software; it is difficult to write good specifications. In this chapter we will examine guidelines for writing specifications. Remember that specifications are not usually written once and then frozen. More typically, requirements change during the software development as the users’ requirements are clarified and modified. 4.2 ● The concept of a requirement The task of analyzing and defining the requirements for a system is not new or peculiar to software. For generations, engineers have been carrying out these activities. For example, the following is part of the requirements specification for a railway locomotive: On a dry track, the locomotive must be able to start a train of up to 100 tonnes on an incline of up to 30% with an acceleration of at least 30 km/h/h. This statement serves to emphasize that a requirement tells us what the user (in this case the railway company) wants. It says nothing about how the locomotive should be built. Thus, it does not state whether the locomotive is diesel, coal or nuclear powered. It says nothing about the shape or the wheel arrangements. One of the great controversies in computing is whether it is desirable (or even possible) to specify what a system should do without considering how the system will do it. This is the relationship between specification and implementation. We will now look at both sides of this argument. On the one hand, there are several reasons why the requirements specification should avoid implementation issues. The prime reason is that the user cannot reasonably be expected to understand the technical issues of implementation and cannot therefore be expected to agree such elements of the specification. To emphasize the point, how many users of a word processor really understand how software works? A second reason for minimizing implementation considerations is to avoid unduly constraining the implementation. It is best if the developer has a free reign to use whatever tools and techniques he or she chooses – so long as the requirements are met.

38 Chapter 4 ■ Requirements engineering On the other hand, some people argue that it is impossible to divorce specification and implementation. Indeed, in several major approaches to specification they are intermixed. In such a method, the first task is to understand and to document the workings of an existing system. (This might be a manual or a computer-based system, or some combination.) This investigation serves as the prelude to the development of a new computer system. Thus the implementation of one system (the old) acts as a major ingredient in the specification for the new system. For example, suppose we wished to develop a computer system for a library that currently does not use computers. One approach would be to investigate and document all the current manual procedures for buying books, cataloging, shelving, loaning, etc. Having accomplished this task, the next step is to decide which areas of activity are to be computerized (for example, the loans system). Finally, the specification of the new system is derived from the design (implementation) of the old system. This approach to development seems very appealing and logical. However, it does mean that implementation and specification are intertwined. There are several, additional and powerful reasons why the analyst must think about implementation during specification. First, they must check that a requirement is technically possible. For example, is it possible to achieve a response time of 0.1 second? Second, it is vital to consider implementation in order to estimate the cost and delivery date of the software. In order to estimate figures for performance and cost it will almost certainly be necessary to carry out some outline development at least as far as architectural design. So, an ideal specification stipulates what, not how. But this is not always practical. 4.3 ● The qualities of a specification We have seen that, ideally, a specification should confine itself to what is needed. We now present a list of desirable qualities for a specification. A good specification should exhibit the following characteristics: ■ implementation free – what is needed, not how this is achieved ■ complete – there is nothing missing ■ consistent – no individual requirement contradicts any other ■ unambiguous – each requirement has a single interpretation ■ concise – each requirement is stated once only, without duplication ■ minimal – there are no unnecessary ingredients ■ understandable – by both the clients and the developers ■ achievable – the requirement is technically feasible ■ testable – it can be demonstrated that the requirements have been met. This list of desirable features can be used as a checklist when a specification is drawn up. Additionally it can be used as a checklist to examine and improve an existing specification.

4.2 The concept of a requirement 37<br />

Establishing the requirements <strong>for</strong> a software system is the first step in trying to<br />

ensure that a system does what its prospective users want. This endeavor continues<br />

throughout the software development and is called validation.<br />

The requirements specification has a second vital role. It is the yardstick <strong>for</strong> assessing<br />

whether the software works correctly – that it is free from bugs. The job of striving<br />

to ensure that software is free from errors is a time-consuming and difficult process that<br />

takes place throughout development. It is called verification.<br />

Errors in specification can contribute hugely to testing and maintenance costs.<br />

The cost of fixing an error during testing can be 200 times the cost of fixing it during<br />

specification. It is estimated that something like 50% of bugs arise from poor<br />

specification. The remedy of course is to detect (or prevent) bugs early, that is, during<br />

specification.<br />

It is easy to write poor requirements specifications <strong>for</strong> software; it is difficult to write<br />

good specifications. In this chapter we will examine guidelines <strong>for</strong> writing specifications.<br />

Remember that specifications are not usually written once and then frozen. More<br />

typically, requirements change during the software development as the users’ requirements<br />

are clarified and modified.<br />

4.2 ● The concept of a requirement<br />

The task of analyzing and defining the requirements <strong>for</strong> a system is not new or peculiar to<br />

software. For generations, engineers have been carrying out these activities. For example,<br />

the following is part of the requirements specification <strong>for</strong> a railway locomotive:<br />

On a dry track, the locomotive must be able to start a train of up to 100 tonnes on an<br />

incline of up to 30% with an acceleration of at least 30 km/h/h.<br />

This statement serves to emphasize that a requirement tells us what the user (in this case<br />

the railway company) wants. It says nothing about how the locomotive should be built.<br />

Thus, it does not state whether the locomotive is diesel, coal or nuclear powered. It says<br />

nothing about the shape or the wheel arrangements.<br />

One of the great controversies in computing is whether it is desirable (or even possible)<br />

to specify what a system should do without considering how the system will do it. This is<br />

the relationship between specification and implementation. We will now look at both sides<br />

of this argument.<br />

On the one hand, there are several reasons why the requirements specification<br />

should avoid implementation issues. The prime reason is that the user cannot reasonably<br />

be expected to understand the technical issues of implementation and cannot<br />

there<strong>for</strong>e be expected to agree such elements of the specification. To emphasize the<br />

point, how many users of a word processor really understand how software works? A<br />

second reason <strong>for</strong> minimizing implementation considerations is to avoid unduly constraining<br />

the implementation. It is best if the developer has a free reign to use whatever<br />

tools and techniques he or she chooses – so long as the requirements are met.

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

Saved successfully!

Ooh no, something went wrong!