Procedures, workflows, and activities are all used synonymously and can be modeled using UML activity diagrams.
Model each of the following workflow/process descriptions using UML activity diagrams.
Royce's original waterfall model was a sequence consisting of seven phases:
Requirements specification
Design
Implementation
Integration
Testing
Installation
Maintenance
Represent the Spiral Model of Software Development as an Activity Diagram.
Represent the V Model of Software Development as an activity diagram.
Represent the Hyper Text Transfer Protocol (HTTP) as an activity diagram.
After an initiation phase, a project is planned. Then the project is executed. Periodically, progress is measured. If progress is insufficient, then control returns to the planning phase, if the project is complete, it moves to the termination phase. Otherwise control returns to the execution phase.
Every project can be described by a tree called a work breakdown structure (WBS). The nodes of a WBS represent project activities that must be completed. The leaf nodes represent simple activities (called tasks). The parent nodes represent composite activities. Child nodes represent the sub-actvities of the parent node. A node, N, may have zero or more siblings called its successors. Successor activities can't begin until N is completed.
In the following example we represent the tree-structure in outline form. Comma separated siblings are performed sequentially, pipe (|) separated siblings can be performed in parallel or in any order:
Develop Software System
Capture Requirements,
Design System,
Select Architecture,
Design Components |
Design DataBase |
Design User Interface
Implement System,
Implement Components |
Implement Database |
Implement User Interface
Integrate System,
Test System,
Test Components,
Test System
Deploy Application
Show how WBDs can be translated into activity diagrams by translating the above WBD into a collection of activity diagrams.
A Peugot assembly line begins by assembling the chassis. Next, the interior team bolts the seats to the chassis, then the steering column. At the same time the engine team mounts the engine to the chassis, then tests the engine. If the engine fails the test, it must be remounted. Meanwhile, the chassis for the next car is being assembled. After the engine and interior, are installed, the body is bolted to the chassis. Draw an activity diagram showing this workflow.
Here's a recipe for chocolate chip cookies:
A motion is made. If the motion is not seconded, the motion fails. Otherwise the motion is debated. When the debate ends, there is a vote. If the majority vote for the motion, it succeeds, otherwise it fails. If the motion was a motion to adjourn, and if it succeeds, then the meeting ends, otherwise another motion is made.
A candidate requests access to a secured area. A guard verifies the identity of the candidate. If the candidate's identity can't be verified, then the guard denies access. If the identity is verified, then a database is searched for the candidate's record (an object of type Person). If the search fails, then the guard denies access. If the record is found, it is passed to an inference engine that authorizes the record. If the authorization fails, then the guard denies access. If the authorization succeeds, then the guard allows access.
A candidate applies for a new account or to have an existing account updated. A technician gathers information about the candidate. The technician verifies the information. If the information is incomplete or can't be verified, then the application is rejected. Otherwise the database is searched for the candidate's record. If the record is found, then the technician updates the record and approves the application. If the record is not found, then the technician creates a new record and approves the application.
A bill is introduced in the House of Representatives. The House assigns a number to the bill, prints it, then refers it to the appropriate committee. The committee can kill the bill by ignoring it or they can vote on it. If it passes, the bill goes to back to the House for a vote. If it passes it goes to the Senate for a vote. If it passes, it goes to the President. If the president signs it, it becomes a law.
If the president vetoes the law, it goes back to the House where a 2/3 majority is needed to override the veto. It then goes to the Senate where a 2/3 majority is needed to override the veto.
If the president does nothing, then the bill becomes law after 10 days unless congress is not in session. This is just another way for the president to veto the bill called a pocket veto.
Draw activity diagrams that model the following methods:
double tax(double income) {
if (income < 0) error("invalid
income");
if (income < 1000) return 0;
if (income < 20000) return 0.1 *
income;
if (income < 30000) return 0.2 *
income;
if (income < 50000) return 0.3 *
income;
return 0.5 * income;
}
double add(double[][] matrix) {
double result = 0;
for(int row = 0; row <
matrix.length; row++) {
for(int col = 0; col <
matrix[row].length; col++) {
result = result +
matrix[row][col];
}
}
return result;
]
In a typical felony criminal preceding the defendant (i.e., the person arrested) enters a plea of guilty or not guilty. If the plea is guilty, the judge sentences the defendant and the defendant serves his sentence. If not guilty, a trial date is set and bail is set. During the trial the prosecutor presents evidence, then the defendant (i.e., the defendant's attorney) presents evidence. Next, the jury deliberates and makes a verdict. If the verdict is not guilty, then the judge releases the defendant. If guilty, then the judge sentences the defendant. If the defendant believes the trial was unfair he may appeal the case, otherwise he serves his sentence. If he appeals, the appellate court my overturn the conviction or uphold the conviction. If the conviction is upheld, the defendant serves his sentence, otherwise the appellate court releases the defendant.
The buyer finds a house and makes an offer. The seller may accept the offer or may make a counter offer. If the seller makes a counter offer, the buyer may accept the counter offer or make another counter offer. This repeats until either the buyer or seller rejects the counter offer or accepts the counter offer. After an offer or counter offer has been accepted, the buyer simultaneously applies for a loan and a home inspector inspects the home. If the loan is approved and if the inspections pass, the escrow officer conducts a title search. If the seller actually holds the deed, the escrow officer transfers the deed to the buyer and transfers the buyer's money to the seller.