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.

46 Chapter 4 ■ Requirements engineering<br />

carries out a series of transactions, inserting their card, withdrawing cash, checking their<br />

balance and then transferring money. Is this collection a single use case? No, because it<br />

constitutes a number of useful user functions.<br />

One way to identify distinct use cases is to identify a goal that an actor wishes to<br />

accomplish. Another viewpoint is identifying some outcome of value to the user. The<br />

task of correctly entering a PIN is neither a goal nor a valuable outcome. It is only a<br />

part of some complete and useful function. It is there<strong>for</strong>e not a valid use case in itself.<br />

For a large system, there will be many use cases. In order to control complexity, use<br />

cases are grouped into use case packages. Each package contains a set of related use cases.<br />

For example, a word processor has many commands, but the commands are in groups,<br />

such as filing, editing text, setting styles and printing.<br />

The set of use cases constitutes the functional specification of a system. This in itself<br />

is valuable, but, as we shall see, use cases can also be used to:<br />

■ derive the software structure<br />

■ create test cases<br />

■ help write a user manual<br />

■ predict software cost.<br />

In some approaches to development, such as Agile Methods and the Unified Process<br />

(both discussed later in this book), use cases are the driving <strong>for</strong>ce behind the development<br />

process.<br />

4.8 ● Use case diagrams<br />

We can document use cases, such as those we have met, as a UML use case diagram.<br />

Figure 4.1 shows the use case diagram <strong>for</strong> the ATM. There is a single actor, shown as<br />

a stick figure. The name of the role of the user is shown below. Arrows lead from the<br />

actor to the use cases, shown as ovals with their function named beneath.<br />

You will see that a use case diagram does not contain the detail associated with<br />

a (textual) use case. However, it does give an overall picture of the actors and the<br />

use cases. Thus a use case diagram is an in<strong>for</strong>mal graphical representation of<br />

requirements.<br />

Bank customer<br />

Figure 4.1 Use case diagram <strong>for</strong> the ATM<br />

withdraw cash<br />

check balance

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

Saved successfully!

Ooh no, something went wrong!