USE CASE: IMPROVED AVERAGE
Scope: Calculation of average of list of integers
Primary actor: person who calculates an average
Stakeholders and interests:
-
Person who calculates an average:
1.
Accurate
and fast calculation
2.
Exception
handling with a meaningful message
3.
Application
should ignore any lines in the input file that are other than a single integer
Preconditions:
A text file containing integer values;
One command line parameter is expected;
The user should be able start an application
from console;
J2SE installed on user’s PC.
Main scenario
Input
Events from User
|
System Events and Responses
|
Start
application with file name as a parameter
|
Read
values from a file
|
|
Check
string value
|
|
Calculate
sum of values
|
|
Calculate
the quantity of values
|
|
Calculate
an average value
|
|
Display a
result
|
Extensions
A. User runs an application without
parameter.
Generate message how to use
application. Quit application.
B. Input file contains more than one
integer or garbage in a line
Skip the line without a message and continue calculation
C. Any other error.
Submit meaningful message matching a kind of error