Unit-2 UML AND THE UNIFIED PROCESS SYLLABUS: Overview of requirements-Initial understanding of the domain- Business Model-Requirements workflow -Osbert Oglesby case study-MSG Foundation case study revising the requirementsMSG Foundation case study-Continuing the requirements workflow- MSG Foundation case study refining the revised requirements- MSG Foundation case study. 2.1 OVERVIEW OF REQUIREMENTS First, gain an understanding of the application domain (domain, for short) o (The specific business environment in which the information system is to operate) Second, build a business model o Use UML to describe the client’s business processes Third, use the business model to determine the client’s requirements Then iterate (“repeat”) the above steps FLOWCHART OF THE REQUIREMENTS WORKFLOW 1 DEFINITIONS Discovering the client’s requirements o Requirements elicitation (or requirements capture) o Methods include interviews and surveys Refining and extending the initial requirements o Requirements analysis 2.2 INITIAL UNDERSTANDING OF THE DOMAIN Every member of the development team must become fully familiar application domain o Correct terminology is essential We must build a glossary o That is, a list of technical words used in the domain, and their meaning Initial Understanding: Osbert Oglesby Case Study Osbert Oglesby, Art Dealer, needs an information system to assist him in buying and selling paintings Obtaining domain knowledge is the first step Osbert is interviewed to obtain the relevant information GLOSSARY: OSBERT OGLESBY CASE STUDY 2.3 BUSINESS MODEL A business model is a description of the business processes of an organization The business model gives an understanding of the client’s business as a whole o This knowledge is essential for advising the client regarding computerization The systems analyst needs to obtain a detailed understanding of the various business processes o Different techniques are used, primarily interviewing 2 2.3.1 INTERVIEWING The requirements team meet with the client and users to extract all relevant information There are two types of questions o Close-ended questions requires a specific answer o Open-ended questions are asked to encourage the person being interviewed to speak out There are two types of interviews o In a structured interview, specific preplanned questions are asked, frequently close-ended o In an unstructured interview, questions are posed in response to the answers received, frequently open-ended Interviewing is not easy o An interview that is too unstructured will not yield much relevant information o The interviewer must be fully familiar with the application domain o The interviewer must remain open-minded at all times After the interview, the interviewer must prepare a written report o It is strongly advisable to give a copy of the report to the person who was interviewed 2.3.2 OTHER INFORMATION GATHERING TECHNIQUES Interviewing is the primary technique A questionnaire is useful when the opinions of hundreds of individuals need to be determined Examination of business forms shows how the client currently does business Direct observation of the employees while they perform their duties can be useful o Videotape cameras are modern version of this technique o But, it can take a long time to analyze the tapes o Employees may view the cameras as an unwarranted invasion of privacy 2.3.3 USE CASES A use case models an interaction between the information system itself and the users of that information system (actors) Example: A use case shows the interaction between o The information system and o The environment in which the information system operates 3 Each use case models one type of interaction o There can be just a few use cases for an information system, or there can be hundreds The rectangle in the use case represents the information system itself An actor is a member of the world outside the information system It is usually easy to identify an actor o An actor is frequently a user of the information system In general, an actor plays a role with regard to the information system. This role is o As a user; or o As an initiator; or o As someone who plays a critical part in the use case A user of the system can play more than one role Example: A customer of the bank can be o A Borrower or o A Lender Conversely, one actor can be a participant in multiple use cases Example: A Borrower may be an actor in o The Borrow Money use case; o The Pay Interest on Loan use case; and o The Repay Loan Principal use case Also, the actor Borrower may stand for many thousands of bank customers An actor need not be a human being Example: The Cardholder Clothing Company information system has to interact with the credit card company information system o The credit card company information system is an actor from the viewpoint of the Cardholder Clothing Company information system o The Cardholder Clothing Company information system is an actor from the viewpoint of the credit card company information system A potential problem when identifying actors o Overlapping actors Example: Hospital Information System o One use case has actor Nurse o A different use case has actor Medical Staff o Better: Actors: Physician and Nurse Alternatively: o Actor Medical Staff with two specializations: Physician and Nurse 4 2.4 REQUIREMENTS WORKFLOW- OSBERT OGLESBY CASE STUDY 2.4.1 INIT. BUSINESS MODEL Osbert wants an information system, running on his laptop computer, that will o Determine the maximum price he should pay for a painting o Detect new trends in the art market as soon as possible To do this, the information system needs to keep a record of all purchases and all sales Currently, Osbert produces reports of annual sales and purchases by hand o At only a small additional cost, the information system can also print these two reports on demand Osbert wants an information system that can o Compute the highest price he should pay for a painting; and o Detect new art trends Osbert needs an information system that can also o Provide reports on purchases and sales It is vital to determine the client’s needs up front, and not after the information system has been delivered Osbert has three business activities: o He buys paintings o He sells paintings o He produces reports Buy a Painting use case Sell a Painting use case Produce a Report use case 5 For conciseness, all three use cases are combined into a use-case diagram The only person who uses the current (manual) information system is Osbert o Osbert is therefore an actor in all three use cases The customer may initiate the Buy a Painting or the Sell a Painting use case The customer plays a critical part in both use cases by providing data entered into the information system by Osbert o The customer is therefore an actor in both these use cases Next, the use cases have to be annotated Here are the initial use-case descriptions Buy a Painting use case Sell a Painting use case 6 Produce a Report use case 2.4.2 INITIAL REQUIREMENTS The initial requirements are based on the initial business model Then they are refined The requirements are dynamic—there are frequent changes o Maintain a list of likely requirements, together with use cases of requirements approved by the client There are two categories of requirements A functional requirement specifies an action that the information system must be able to perform o Often expressed in terms of inputs and outputs A nonfunctional requirement specifies properties of the information system itself, such as o Platform constraints o Response times o Reliability Functional requirements are handled as part of the requirements and analysis workflows Some nonfunctional requirements have to wait until the design workflow O The detailed information for some nonfunctional requirements is not available until the requirements and analysis workflows have been completed Initial Requirements: Osbert Oglesby Case Study The initial business model (the three use cases) shows how Osbert currently does business Decide which of these use cases are also requirements of the information system to be built o Clearly, all three are requirements Refine the resulting initial requirements o The descriptions of the use cases have to be refined Buy a Painting use case 7 Sell a Painting use case Produce a Report use case All three descriptions are still vague o A consequence of the iterative nature of the Unified Process o For example, the algorithm details are irrelevant at this time Basic principle: Defer all details to as late as possible o This will simplify the inevitable changes of the next iteration More details of each use case are needed now First consider use cases o Buy a Painting, and o Sell a Painting To refine the descriptions, determine what attributes need to be input when a painting is bought and when a painting is sold 2.4.3 ATTRIBUTES: OSBERT OGLESBY CASE STUDY (OR) CONTINUING THE REQUIREMENT WORKFLOW Attributes when buying a painting include: o Title of work, name of artist, date of painting, classification, medium, purchase price, name and address of seller Attributes when selling a painting are: o Date of sale, name of buyer, address of buyer, actual selling price Now the algorithm for computing the maximum purchase price is considered Classify the painting as a o Masterpiece 8 o Masterwork, or o Other painting Maximum Price for a Masterpiece Scan worldwide auction records over the past 25 years for the most similar work by the same artist Use the auction purchase price of the most similar work as the base price The maximum purchase price is found by adding 7.5 percent to the base price, compounded annually, for each year since that auction Compute the maximum purchase price as if the painting were a masterpiece by the same artist If the picture was painted in the 21st century, multiply this figure by 0.25 Otherwise, multiply it by (21 – c) / (22 – c), where c is the century in which the work was painted (12 < c < 21) Measure the dimensions of the canvas The maximum purchase price is then given by the formula F A, where o F is a constant for that artist (fashionability coefficient), and o A is the area of the canvas in square centimeters If there is no fashionability coefficient for that artist, Osbert will not buy the painting Coefficient of Similarity: Osbert Oglesby For a masterpiece or masterwork, the coefficient of similarity between two paintings is computed as follows: o Score 1 for a match on medium, otherwise 0 o Score 1 for a match on subject, otherwise 0 o Add these two numbers, multiply by the area of the smaller painting, and divide by the area of the larger o The resulting number is the coefficient of similarity If the coefficient of similarity between the painting under consideration and all the paintings in the file of auction data is zero, then Osbert will not buy that masterwork or masterpiece Fashionability Coefficients: Osbert Oglesby The information system must include a list of artists and their corresponding F values The value of F can vary from month to month, depending on the current fashionability of an artist Osbert determines the value of F on the basis of his knowledge and experience o He changes the value if prices for work by an artist increase or decrease Auction Data: Osbert Oglesby Case Study The information system must utilize information on auction sales of masterpieces over the past 25 years worldwide Each month Osbert receives a CD with updated worldwide auction prices; these prices are never modified by Osbert 9 Updated Use Cases : Osbert Oglesby Case Study The use-case descriptions must reflect this information The description of the Sell a Painting use case: Reports for the Osbert Oglesby Case Study There are three reports: o Purchases during the past year o Sales during the past year o Detection of new trends Sample reports show Osbert’s needs are as follows (question marks in the first or last name of artist, or in the title or date of the work are to be included in all reports): Report of Purchases during the Past Year A report is needed to display all the paintings purchased during the past year o The average ratio of the purchase price to the suggested maximum price is required at the end of the report 10 Report of Sales during the Past Year A report is needed to display all the paintings sold during the past year o The average ratio of the actual selling price to the target selling price is required at the end of the report Report of Trends during the Past Year A report showing artists whose works Osbert has sold at a price that has exceeded the target selling price in every instance during the past year o To appear in this report, at least two of the artist’s works must have been sold by Osbert during that period 11 2.4.4 UPDATED USE-CASE DESCRIPTION: PRODUCE A REPORT The updated description of the Produce a Report use case, incorporating the details are listed below Second Iteration of Use-Case Diagram Incorporate all four use cases Analysis of Req. Workflow: Osbert Oglesby A fault was detected o There was a missing use case o The existing artifacts did not need to be changed Two additional artifacts had to be added o A use case, and o Its description The Unified Process is iterative and incremental o Systems analysts must always be aware that changes and extensions to the current version of the information system may have to made at any time 12 2.5 MSG FOUNDATION CASE STUDY-REVISING THE REQUIREMENTS MARTHA STOCKTON GREENGAGE FOUNDATION MSG provides low cost mortgage loans to young couples Died at 87 & left behind $2billion Trustees commission a pilot project o A software product to determine how much money is available each week to purchase homes Initial Understanding of the Domain A mortgage is a loan in which real estate is used as security Example: House costs $100,000 Buyer pays a 10% deposit and borrows the balance o The principal (or capital) borrowed is $90,000 Loan is to be repaid monthly over 30 years o Interest rate of 7.5% per annum (or 0.625% per month) Each month, the borrower pays $629.30 o Part of this is the interest on the outstanding balance o The rest is used to reduce the principal The monthly payment is therefore often referred to as P & I (principal and interest) Mortgage Payments: First Month In the first month the outstanding balance is $90,000 o Monthly interest at 0.625% on $90,000 is $562.50 o The remainder of the P & I payment of $629.30, namely $66.80, is used to reduce the principal At the end of the first month, after the first payment has been made, only $89,933.20 is owed to the finance company Mortgage Payments: Second Month In the second month the outstanding balance is $89,933.20 o Monthly interest at 0.625% on $89,933.20 is $562.08 o The remainder of the P & I payment of $629.30, namely $67.22, is used to reduce the principal At the end of the second month, after the second payment has been made, only $89,865.98 is owed to the finance company Mortgage Payments: After 15 and 30 yrs After 15 years (180 months) the outstanding balance is $67,881.61 o Monthly interest at 0.625% on $67,881.61 is $424.26 o The remainder of the P & I payment of $629.30, namely $205.04, is used to reduce the principal After 30 years (360 months), the entire loan will have been repaid 13 Insurance Premiums The finance company requires the borrower to insure the house o If the house burns down, the check from the insurance company will then be used to repay the loan The insurance premium is paid once a year by the finance company o The finance company requires the borrower to pay monthly insurance installments o These are deposited in an escrow account (a savings account) The annual premium is then paid from the escrow account Real Estate Taxes Real-estate taxes paid on a home are treated the same way as insurance premiums o Monthly installments are deposited in the escrow account o The annual real-estate tax payment is made from that account Borrowing Limits A mortgage will not be granted unless the total monthly payment (P & I plus insurance plus real-estate taxes) is less than 28% of the borrower’s total income Other Costs The finance company requires a lump sum up front in return for lending the money to the borrower o Typically, the finance company will want 2% of the principal (“2 points”) o For the $90,000 loan, this amounts to $1,800 There are other costs involved in buying a house o Legal costs o Various taxes When the deal is “closed,” the closing costs (legal costs, taxes, and so on) plus the points can easily amount to $7,000 14 Initial Glossary Initial Business Model At the start of each week, MSG estimates how much money will be available that week to fund mortgages Low-income couples can apply at any time An MSG Foundation staff member determines o Whether the couple qualifies for an MSG mortgage, and o Whether MSG has sufficient funds on hand to purchase the home If so, the mortgage is granted o The weekly mortgage repayment is computed according to MSG rules This repayment amount may vary from week to week, depending on the couple’s current income There are three use cases o Estimate Funds Available for Week o Apply for an MSG Mortgage o Compute Weekly Repayment Amount 15 ESTIMATE FUNDS AVAILABLE FOR WEEK USE CASE APPLY FOR AN MSG MORTGAGE USE CASE 16 COMPUTE WEEKLY REPAYMENT AMOUNT USE CASE Who Is an Actor? Why is Applicants an actor in use case Apply for an MSG Mortgage? Applicants do not interact with the software product o Their answers are entered into the software product by an MSG staff member However, o The applicants initiate the use case o The applicants provide the data entered by MSG staff o The real actor is therefore Applicants — the MSG Staff Member is merely an agent of the applicants Applicants is therefore indeed an actor Similarly, Borrowers is an actor in use case Compute Weekly Repayment Amount o Again the use case is initiated by actor Borrowers o Again the information entered by MSG staff is supplied by the borrowers Thus, Borrowers is indeed an actor in the use case MANAGE AN INVESTMENT USE CASE At this stage, no details are known regarding o The buying and selling of investments, or o How investment income becomes available for mortgages However, use case Manage an Investment is an essential part of the initial business model 17 USE-CASE DIAGRAM OF THE INITIAL BUSINESS MODEL 18 INITIAL REQUIREMENTS It is unclear if all four use cases are all requirements of the product to be developed o What, exactly, is “a pilot project”? The best way to proceed is o Draw up the initial requirements on the basis of what the client wants, and then iterate Consider each use case in turn: Estimate Funds Available for Week is obviously part of the initial requirements Apply for an MSG Mortgage does not seem to have anything to do with the pilot project, so it is excluded Compute Weekly Repayment Amount, & Manage an Investment o Both appear to be irrelevant to the pilot project However, the pilot project deals with the “money that is available each week to purchase homes” o Some of that money comes from the weekly repayment of existing mortgages, and from income from investments INITIAL USE-CASE DIAGRAM The next step: Iterate the requirements workflow 19 2.6 MSG - CONTINUING THE REQUIREMENTS WORKFLOW The systems analysts learn that the MSG Foundation grants a 100% mortgage to buy a home under the following conditions: o The couple has been legally married for at least 1 year but not more than 10 years o Both husband and wife are gainfully employed o The price of the home must be below the published median price for homes in that area for the past 12 months o Their income and/or savings are insufficient to afford a standard fixed-rate 30year 90% mortgage o The foundation has sufficient funds to purchase the home If the application is approved, then each week for the next 30 years the couple pays MSG o The total of the principal and interest payment — this never changes over the life of the mortgage; plus o The escrow payment, which is 1/52nd of the sum of the annual real-estate tax and the annual homeowner’s insurance premium If this exceeds 28% of the couple’s gross weekly income, MSG pays the difference as a grant o The couple must provide proof of their current income — the weekly payment may vary from week to week Algorithm to Determine If Funds Are Available 1. At the beginning of the week, the estimated annual income from MSG investments is computed and divided by 52 2. The estimated annual MSG operating expenses are divided by 52 3. The total of the estimated mortgage payments for the week is computed 4. The total of the estimated grants for the week is computed 5. The amount available at the beginning of the week is then (1) – (2) + (3) – (4) 6. If the cost of the home is no more than (5), funds are provided to buy the home 7. At the end of each week, any unspent funds are invested Requirements of the Pilot Project To keep the cost of the pilot project as low as possible, only those data items needed for the weekly funds computation will be included Only three types of data are therefore needed: o Investment data o Operating expenses data o Mortgage data o Investment Data Item number Item name Estimated annual return Date estimated annual return was last updated 20 o Operating Expenses Data Estimated annual operating expenses Date estimated annual operating expenses was last updated o Mortgage Data Account number Last name of mortgagees Original purchase price of home Date mortgage was issued Weekly principal and interest payment Current combined gross weekly income Date combined gross weekly income was last updated Annual real-estate tax Date annual real-estate tax was last updated Annual homeowner’s insurance premium Date annual homeowner’s insurance premium was last updated Reports Required for the Pilot Project Three types of reports are needed: o The results of the funds computation for the week o A listing of all investments (to be printed on request) o A listing of all mortgages (to be printed on request) Revising the Requirements The initial requirements include three use cases: o Estimate Funds Available for Week o Compute Weekly Repayment Amount o Manage an Investment In the light of the additional information received, the initial requirements can be revised Consider each element of the formula to determine how much money is available each week (1) Estimated annual income from investments: o Take all the investments, sum the estimated annual return on each investment, and divide the result by 52 An additional use case, Estimate Investment Income for Week, is needed o (We still need use case Manage an Investment for adding, deleting, and modifying investments) 21 Estimate investment income for week use case Description of use case FIRST ITERATION OF THE REVISED USE-CASE DIAGRAM (2) Estimated annual operating expenses: To determine the estimated annual operating expenses two additional use cases are needed – Use case Update Estimated Annual Operating Expenses models adjustments to the value of the estimated annual operating expenses – Use case Estimate Operating Expenses for Week provides the needed estimate of the operating expenses 22 Update Estimated Annual Operating Expenses Use Case Estimate Operating Expenses for Week Use Case 23 SECOND ITERATION OF REVISED USE-CASE DIAGRAM • The new use cases are shaded 2.7 MSG FOUNDATION CASE STUDY-REFINING THE REVISED REQUIREMENTS Total estimated mortgage payments for the week and Total estimated grant payments for the week: o Use case Compute Weekly Repayment Amount models the computation of both the estimated mortgage payment and the estimated grant payment for each mortgage separately o Summing these separate quantities gives The total estimated mortgage payments for the week, and The total estimated grant payments for the week Now the use cases need to be reorganized o Use case Compute Weekly Repayment Amount also models borrowers updating their weekly income Split Compute Weekly Repayment Amount into two separate use cases o Use case Estimate Payments and Grants for Week, and o Use case Update Borrowers’ Weekly Income 24 Estimate Payments and Grants for Week Use Case Estimate Payments and Grants for Week Use Case Update Borrowers’ Weekly Income Use Case 25 Third Iteration of the Revised Use-Case Diagram Estimate Funds Available for Week Use Case • Use case Estimate Funds Available for Week models the computation that uses the data obtained from three other use cases – Estimate Investment Income for Week – Estimate Operating Expenses for Week – Estimate Payments and Grants for Week 26 Estimate Funds Available for Week Use Case «include» Relationship Correct use case (top); incorrect use case (bottom) 27 The bottom diagram models use cases o Estimate Funds Available for Week, and o Estimate Payments and Grants for Week o as two independent use cases o However, a use case models an interaction between the product itself and users of the product (actors) Use case Estimate Payments and Grants for Week does not interact with an actor and therefore cannot be a use case in its own right o Instead, it is a portion of use case Estimate Funds Available for Week, as reflected in the top diagram The Test Workflow - (Refining the revised requirements) A common side-effect of the iterative and incremental life-cycle model o Details that correctly have been postponed somehow get forgotten Details of use case Manage an Investment have been overlooked, and Use case Manage a Mortgage to model o The addition of a new mortgage o The modification of an existing mortgage, or o The removal of an existing mortgage o has been totally forgotten o (Analogous to use case Manage an Investment) Manage a Mortgage Use Case 28 Fourth Iteration of the Revised Use-Case Diagram There is a further omission o Use case Produce a Report to print the three reports Investments report Mortgages report Results of weekly computation o has also been totally forgotten 29 Produce a Report Use Case 30 Fifth Iteration of the Revised Use-Case Diagram Rechecking the revised requirements uncovers two new problems o A use case has been partially duplicated o Two of the use cases need to be reorganized Partially Duplicated Use Case Use case Manage a Mortgage o One action is to modify a mortgage Use case Update Borrowers’ Weekly Income o Only action is to update the borrowers’ weekly income The borrowers’ weekly income is an attribute of the mortgage o Use case Manage a Mortgage already includes use case Update Borrowers’ Weekly Income 31 Accordingly, use case Update Borrowers’ Weekly Income is superfluous, and must be deleted Sixth Iteration of the Revised Use-Case Diagram This iteration resulted in a decrement, not an increment In fact, deletion occurs often o Whenever we make a mistake Sometimes we can fix an incorrect artifact o More frequently we have to delete an artifact However, when we discover a fault, we do not have to start the whole process from scratch First we try to fix the current iteration If the mistake is too serious for this to work, we backtrack to the previous iteration, and try to find a better way to go forward from there Reorganizing Two Use Cases Determine the funds available for the current week o Use case Estimate Funds Available for Week models performing the calculation o Step 1.3 of use case Produce a Report models printing out the result of the computation There is no point in estimating the funds available unless the results are printed out The descriptions of the use cases 32 o Estimate Funds Available for Week, and o Produce a Report o have to be modified (the use cases do not change) Modified Description — Produce a Report 33 Modified Description — Estimate Funds Available for Week The usual reason for an «include» relationship is where one use case is part of two or more other use cases o Example: U.S. tax forms—avoiding triplication o 34 Seventh Iteration of Revised Use-Case Diagram 35 Revised Description of Use Case 36