Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 CMPT 275 Software Engineering Requirements Analysis activity (use case diagrams, Class activity) Janice Regan, 2008-2014.

Similar presentations


Presentation on theme: "1 CMPT 275 Software Engineering Requirements Analysis activity (use case diagrams, Class activity) Janice Regan, 2008-2014."— Presentation transcript:

1 1 CMPT 275 Software Engineering Requirements Analysis activity (use case diagrams, Class activity) Janice Regan, 2008-2014

2 2 Validation & Verification  Validation  Are we building the right product?  To facilitate validation we number our functional requirements and propagate these numbers throughout our models and source code, validating that all functional requirements are parts of the system.  Verification:  Are we building the product right?

3 Janice Regan, 2008-2014 3 Class exercise  Read the requirements for the "Matrix Math Demonstrator" (hand out)  Work in your project groups  You will have 2-3 minutes to identify the actors in the "Matrix Math Demonstrator“ (MMD)  Then we will work through, requirement by requirement, to identify the list of use cases needed to implement the "Matrix Math Demonstrator“, and the relationships between those use cases

4 Janice Regan, 2008-2014 4 Class exercise  Read the requirements for the "Matrix Math Demonstrator" (hand out)  Work in your project groups  You will have 2-3 minutes to identify the actors in the "Matrix Math Demonstrator“ (MMD)  Then we will work through, requirement by requirement, to identify the list of use cases needed to implement the "Matrix Math Demonstrator“, and the relationships between those use cases

5 Janice Regan, 2008-2014 5 Use cases for MMD  Primary actors for the system:  User  Secondary actors for the system:  Matrix Database?  But the Matrix database is a custom application and is part of the MMD. It is not an external system with which the system interacts, so it is not an actor at all. (Requirement 12)

6 Requirement 1 The “Matrix Math demonstrator” must have a graphical user interface (GUI) with 2 main windows.  The problem window occupies the leftmost 2/3 of the GUI  The solution window occupies the rightmost 1/3 of the GUI  Buttons to perform matrix operations will appear at the to of the GUI  A status bar to contain error messages will appear at the bottom of the GUI Janice Regan, 2008-2014 6

7 7 Use cases for MMD  Consider Requirement 1, who are the initiating actors, what use case or cases do we need?  Requirement 1 specifies layout of the GUI not function of the system. It is a non-functional requirement (how something is done not what is done) and thus does not generate any use cases.

8 Requirement 2 The “Matrix Math demonstrator” creates matrices of dimension M rows by N columns.  Elements of created matrices are random floating point numbers between 1.0 and 10.0.  M and N must be <= 20  To create a symmetric matrix the user enters the number of rows (and columns) M and then presses to “SYM” GUI button  To create a matrix that is not symmetric the user inputs the number of rows, M, as the first operand presses the ”BY” operator button and then enters the number of columns, N, as the second operand. Janice Regan, 2008-2014 8

9 9 Use Cases for MMD  Identify each action the user expects from the system. What actions are needed to satisfy requirement 2  Create matrices  What use cases do we need?  Identify use cases  CreateMatrix  CreateSymmetricMatrix

10 Janice Regan, 2008-2014 10 Use Cases for MMD  Do any of our actors initiate these use cases?  Not directly.  Read ahead to requirement 7  Both these use cases are initiated when the user presses the “Results” button.  Pressing the “Results” button should initiate a separate use case

11 Janice Regan, 2008-2014 11 Use Cases for MMD  Analyze the use cases and determine if any common actions are repeated within multiple use cases.  For requirement 2 both use cases require that we generate random numbers  Identify one new use case  GenerateRandomNumbers

12 Janice Regan, 2008-2014 12 Use Cases for MMD  Analyze the use cases and determine if any actions within a use case are done only in some unusual situations.  Error conditions?  Return to these later, as they are discussed in later requirements  Any Others?  none

13 Janice Regan, 2008-2014 13 Use case diagram: 1 CreateMatrix CreateSymmetricMatri x GenerateRandomNumbers user > #2

14 Janice Regan, 2008-2014 14 Use Cases for MMD  Identify each action the user expects from the system to satisfy requirements 3-5

15 Requirement 3 The “Matrix Math demonstrator” adds or subtracts any two matrices with the same dimensions.  The add operator is represented by the “+” GUI button  The subtract operator is represented by the “- ” GUI button Janice Regan, 2008-2014 15

16 Requirements 4 and 5 4 The “Matrix Math demonstrator” multiplies any M by N matrix by any N by L matrix  The multiply operator is represented by the “X” GUI button 5 The “Matrix Math demonstrator” calculates the transpose of any matrix  The transpose operator is.represented by the “TRANSPOSE” GUI button. Janice Regan, 2008-2014 16

17 Janice Regan, 2008-2014 17 Use Cases for MMD  Identify each action the user expects from the system to satisfy requirements 3-5  Need to add, subtract, multiply pairs of matrices and transpose single matrices  Define four new use cases  Add2Matrices (#3)  Subtract2Matrices (#3)  Multiply2Matrices (#4)  TransposeMatrix. (#5)  Are any of these use cases is initiated directly by the primary actor ? NO

18 Janice Regan, 2008-2014 18 Use case diagram: 2 CreateMatrix CreateSymmetricMatri x GenerateRandomNumbers Add2Matrices Subtract2Matrice s TransposeMatrix user Multiply2Matrice s > #2 #5 #3 #4 #3

19 Janice Regan, 2008-2014 19 Use Cases for MMD  Identify each action the user expects from the system to satisfy requirement 6  The operand(s) and operator(s) must be entered into the system in the following order:  For binary operators: operand, operator, operand (e.g. operand1 + operand2 ) or  For unary operators: operand, operator (e.g. operand1 TRANSPOSE).

20 Janice Regan, 2008-2014 20 Use Cases for MMD  Identify each action the user expects from the system to satisfy requirement 6  For requirement 6 we need to input operators and operands.  Define two new use cases  InputOperator  InputOperand.  Are these use cases are initiated by the user (primary actor) ?  YES

21 Janice Regan, 2008-2014 21 Use Cases for MMD  Identify each action the user expects from the system to satisfy requirement 7  To obtain the result, for any problem entered as outlined in 2-6, the user must press on the “RESULT” button on the GUI.

22 Janice Regan, 2008-2014 22 Use Cases for MMD  Identify each action the user expects from the system to satisfy requirement 7  Initiate and execute the calculation that has been requested (by pressing result)  Define new use case  DoCalculation.  Is this use cases is initiated by the user (primary actor)?  YES

23 Janice Regan, 2008-2014 23 Use Cases for MMD  Identify each action the user expects from the system to satisfy requirement 8 The operand(s) and operator(s), must be displayed in the “problem window” of the GUI, the result must be displayed in the “solution window” of the GUI.  Display occurs when the “RESULT” GUI button is pressed.

24 Janice Regan, 2008-2014 24 Use Cases for MMD  Identify each action the user expects from the system to satisfy requirement 8  Display operators and matrices (operands)  Any single number can be represented as a 1x1 matrix to display single number operands.  Define two new use cases  DisplayMatrix  DisplayOperator.  Are these use cases are not initiated by the user (primary actor)? NO

25 Janice Regan, 2008-2014 25 Use case diagram: 2 CreateMatrix CreateSymmetricMatri x GenerateRandomNumbers Add2Matrices Subtract2Matrice s TransposeMatrix user Multiply2Matrice s InputOperator InputOperand #6 > #2 #5 #3 #4 #3 #7 BeginCalculation DisplayMatrix DisplayOperator #8

26 Janice Regan, 2008-2014 26 Use Cases for MMD  Analyze the use cases and determine if any common actions are repeated within multiple use cases.  Use cases for requirements 2-5 all require  display of the resulting matrix (answer) to the "results window" of the GUI  display of operands to the "problem window“  display operators to the "problem window"

27 Janice Regan, 2008-2014 27 Use Cases for MMD  Does the user directly request display of the operators, operands and results?  NO  Calculating the results, by executing the DoCalculation use case, triggers these displays.  DisplayMatrix and DisplayOperator are common to Add2Matrices, Subtract2Matrices, Multiply2Matrices, TransposeMatrix, CreateMatrix and CreateSymmetricMatrix (all of which are initiated by pressing "RESULT" and initiating the Do Calculation use case).

28 Janice Regan, 2008-2014 28 Use case diagram: 3 CreateMatrix CreateSymmetricMatri x GenerateRandom Numbers Add2Matrices Subtract2Matrice s TransposeMatrix DisplayMatrix DisplayOperator user Multiply2Matrice s #2 InputOperator InputOperand #7 DoCalculation #6 > #2 > #8 > #2

29 Janice Regan, 2008-2014 29 Use Cases for MMD  Analyze the use cases and determine if any actions within a use case are done only in some situations.  Use case DoCalculation, actually initiates and performs several kinds of calculation.  Each of the calculations is a special case that is only performed in some situations.  The use cases Add2Matrices, Subtract2Matrices, Multiply2Matrices, TransposeMatrix, CreateMatrix and CreateSymmetricMatrix can therefore be considered as extensions of the DoCalculation Use Case

30 Janice Regan, 2008-2014 30 Use case diagram: 3 CreateMatrix CreateSymmetricMatri x GenerateRandom Numbers Add2Matrices Subtract2Matrice s TransposeMatrix DisplayMatrix DisplayOperator user Multiply2Matrice s #2 #5 #3 #4 InputOperator InputOperand #7 DoCalculation #6 > #3 > > #2 > #8 > #2

31 Janice Regan, 2008-2014 31 Use Cases for MMD  Identify each function the user expects from the system. Consider requirements 9-12

32 Requirement 9  A matrix, once created or obtained as a result of a matrix operation, can be stored in the matrix database for later use as an operand.  To store a matrix in the matrix database use the “SAVE RESULT” operator button on the GUI.  When the matrix has been successfully saved to the database the message “SAVED” should appear in the status bar.  To remove a saved matrix from the database select the matrix (see requirement 10) then press the “REMOVE” GUI button.  When the matrix has been successfully removed from the database the message “REMOVED” should appear in the status bar. Janice Regan, 2008-2014 32

33 Requirement 10  If the user does not remember the name of the matrix operand, the user can access a list of all matrices in the matrix database.  Pressing the ”SELECT” GUI button will cause a list of all existing matrices, their dimensions and types to be displayed in the solution window. The desired matrix can then be selected from the list by clicking on the desired matrix  The list of matrices should not vanish until the “RESULT” GUI button is pressed.  The “SELECT” GUI button should not affect the problem window. Janice Regan, 2008-2014 33

34 Requirements 11-12  If the user wishes to start a new calculation pressing the “CLEAR” GUI button will clear all presently entered information from the system and all displayed information from the GUI, it will prepare the Matrix Math demonstrator for its next series of calculations.  The matrix database is a custom solution that is part of the “Matrix Math Demonstrator”. No database interface is required. Janice Regan, 2008-2014 34

35 Janice Regan, 2008-2014 35 Use Cases for MMD  Identify each function the user expects from the system. Consider requirements 9-12  For requirement 9 we will need to save matrices to, and remove matrices from the matrix database.  Define two new use cases SaveMatrix, RemoveMatrix. Each of these use cases is initiated by the primary actor (the user).  Requirement 10 specifies that the user should be able to select from a list of the matrices in the matrix database  Define an additional use case SelectMatrix. This use case is initiated by the primary actor (the user)

36 Janice Regan, 2008-2014 36 Use Cases for MMD  Identify each function the user expects from the system. Continue considering requirements 9-12  For requirement 11 we will need to clear the display and in preparation for a new system.  Define a new use case ClearDisplay. This use cases is initiated by the primary actor (the user).  Requirement 12 indicates that the matrix database is part of the system. This requirement does not specify a function of the system (non-functional).

37 Janice Regan, 2008-2014 37 Use case diagram: 6 CreateMatrix CreateSymmetricMatri x GenerateRandom Numbers Add2Matrices Subtract2Matrice s TransposeMatrix DisplayMatrix DisplayOperator user Multiply2Matrice s #2 #5 #3 #4 InputOperator InputOperand #7 DoCalculation SaveMatrix RemoveMatrix SelectMatrix #6 #9 #10 > #3 > ClearDisplay #11 > > #2 > #8 > #2

38 Janice Regan, 2008-2014 38 Use Cases for MMD  Analyze the use cases and determine if any common actions are repeated within multiple use cases.  Saving, Accessing, and Removing matrices from the database requires accessing of the database  Create a use case AccessDatabase to take care of this common action  Saving and Removing matrices requires a status be displayed on completion  Create a use case DisplayStatus to take care of this common action

39 Janice Regan, 2008-2014 39 Use case diagram: 7 CreateMatrix CreateSymmetricMatri x GenerateRandom Numbers Add2Matrices Subtract2Matrice s TransposeMatrix DisplayMatrix DisplayOperator user Multiply2Matrice s #2 #5 #3 #4 InputOperator InputOperand #7 DoCalculation SaveMatrix RemoveMatrix SelectMatrix #6 #9 #10 > #3 > ClearDisplay #11 Access Database > > #2 > #8 > #2 DisplayStatus

40 Janice Regan, 2008-2014 40 Use Cases for MMD  Identify each function the user expects from the system. Consider requirements 13-15 13If the matrix operands have inconsistent or incorrect dimensions when the “RESULT” GUI button is pressed the “Matrix Math demonstrator” must display the message “ERROR – problem with matrix dimensions” in the status bar at the bottom of the GUI

41 Requirement 14  If the matrix cannot be created due to lack of memory when the “RESULT” or “SYM” GUI button is pressed the “Matrix Math demonstrator” must display the message “ERROR – insufficient memory” in the status bar at the bottom of the GUI. Janice Regan, 2008-2014 41

42 Requirement 15  If errors of any other kinds occur, the software system must display the message "ERROR occurred but no clue why!" in a status bar at the bottom of the GUI. (Note that you may have a reason for the error specified in one of your exception flow of events sections and still generate this error if the reason for failure is not given in requirements 13 or 14) Janice Regan, 2008-2014 42

43 Janice Regan, 2008-2014 43 Use Cases for MMD  Identify each function the user expects from the system. Consider requirements 13-15  For requirement 13-15 we will deal with some exceptional conditions in use cases 2-5. The exceptional conditions deal with error conditions within these use cases  Define a use case Display Error. This use case is not initiated by the primary actor but by the ocurrence of an error in use case DoCalculation.

44 Janice Regan, 2008-2014 44 Use Cases for MMD  Analyze the use cases and determine if any actions are done within multiple use cases.  Each matrix calculation or creation will produce a result matrix unless an error occurs in the calculation or creation of the matrix.  Errors are discussed in requirements 13 to 15  In extraordinary circumstances an error of any of the types mentioned in requirements 13-15 may occur in any of the use cases for requirements 2-5, CreateMatrix, CreateSymmetricMatrix, Add2Matrices, Subtract2Matrices, Multiply2Matrices, Transpose Matrix.

45 Janice Regan, 2008-2014 45 Use case diagram: 8 CreateMatrix CreateSymmetricMatri x GenerateRandom Numbers Add2Matrices Subtract2Matrice s TransposeMatrix DisplayMatrix DisplayOperator user Multiply2Matrice s #2 #5 #3 #4 InputOperator InputOperand #7 DoCalculation SaveMatrix RemoveMatrix SelectMatrix #6 #9 #10 > #3 > ClearDisplay #11 DisplayError Access Database > > #2 > #8 > #13 #14 #15 > #2 DisplayStatus


Download ppt "1 CMPT 275 Software Engineering Requirements Analysis activity (use case diagrams, Class activity) Janice Regan, 2008-2014."

Similar presentations


Ads by Google