Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computing: An Object-Oriented Approach Arab Open University – Lebanon M206 Chapter 32 1 Week 2.

Similar presentations


Presentation on theme: "Computing: An Object-Oriented Approach Arab Open University – Lebanon M206 Chapter 32 1 Week 2."— Presentation transcript:

1 Computing: An Object-Oriented Approach Arab Open University – Lebanon M206 Chapter 32 1 Week 2

2 Computing: An Object-Oriented Approach Arab Open University – Lebanon M206 Chapter 32 2 What you should do this week Read Chapter 32 (There is no LB for this chapter) Reminder: TMA04 cutoff date is 5 March 2007

3 Computing: An Object-Oriented Approach Arab Open University – Lebanon M206 Chapter 32 3 Chapter 32: Requirements Analysis Objectives:  Describe the kinds of information found in a statement of requirements (SR).  Understand why it is difficult to produce a negotiated SR for a software system.  Describe some desirable features of a behavioral specification.  Examine a SR and suggest questions to elicit further information in order to produce a negotiated statement of requirements (NSR).

4 Computing: An Object-Oriented Approach Arab Open University – Lebanon M206 Chapter 32 4 Introduction The client and software developer have to work together to get to a situation where each party fully understands what is required of the software. This chapter introduces you to the process known as requirements analysis where a precise specification of the software is written. This specification is known as the negotiated statement of requirements (NSR) and represents an agreement between the client and the software developer about what the software will do.

5 Computing: An Object-Oriented Approach Arab Open University – Lebanon M206 Chapter 32 5 1-Specifying software: Statements of requirements The starting point of any software project is a document prepared by the client for a proposed software system to describe the application area (real-world context within which the system is required to operate and what the client requires of the system). It is written in a natural language (e.g. English). It can be few pages in length or can consist of several volumes. It is usually couched in terms of the client ’ s business rather than in computing terms. Is it easy to specify software precisely?

6 Computing: An Object-Oriented Approach Arab Open University – Lebanon M206 Chapter 32 6 There are two types of information in any SR: Behavioural requirement: What the client wants the system to do. When the UPDATE command is executed, the system will prompt the user for the name of the flight to be updated and the new flight plan. The user will then enter a series of pairs of digits … Constraint: The limitations on the system. The flight plan database should be updated within two seconds of the command being completed. (When analyzing the statement of requirements, the developer has to identify the behavior requirements and constraints) 1-Specifying software: Statements of requirements

7 Computing: An Object-Oriented Approach Arab Open University – Lebanon M206 Chapter 32 7 1-Specifying software: Analysing the SR Given a statement of requirements, the developer has to carry out the process of requirements analysis. Requirements analysis consists of analysing the statement of requirements and extracting and clarifying the important parts; that is, the behaviour and the constraints. To be able to do that, interaction with the client is necessary. Why is it so difficult?

8 Computing: An Object-Oriented Approach Arab Open University – Lebanon M206 Chapter 32 8 1-Specifying software: Analysing the SR First, it involves 2 parties. One of them expert in computing the other is an expert in the application area (Usually, there is a cultural gap between Client and developer) Second, the statement of requirements has certain properties : 1-Behavioural requirements and constraints are intermingled. (page 5, Exercise 2) 2-The statement of requirements contains ambiguities. Ambiguities arise from the use of natural language! Ex: Whenever the system detects that the operator has made an input error a dialogue box will appear, containing a textual warning regarding the type of error. It will be displayed in red.(refer to text or dialog?)

9 Computing: An Object-Oriented Approach Arab Open University – Lebanon M206 Chapter 32 9 1-Specifying software: Analysing the SR 3-The statement of requirements contains platitudes. Ex:The system should have a user-friendly interface. What does it mean user-friendly interface? 4-The constraints include design and implementation directives. A design directive is a statement limiting the choices of the developer in designing the software. Ex: The salary details of staff should be held in a dictionary structure whose key is the staff number. An implementation directive constraints the choices of the developer in implementing the software. Ex: The software should be written in a OO language.

10 Computing: An Object-Oriented Approach Arab Open University – Lebanon M206 Chapter 32 10 1-Specifying software: Analysing the SR 5-There are omissions in the statement of requirements. While describing large systems, the client usually leaves out details. Ex: What should happen if the user enters invalid data? 6-Behaviour is described at different levels of detail. Ex1: The system should keep track of all orders for products which the warehouses keep in stock. A very high abstraction; no details at all! Ex2: The OUTORDER command is to display the stock numbers of all those products that have been recognised as having unacceptably low stock quantities. The second example is comparatively detailed.

11 Computing: An Object-Oriented Approach Arab Open University – Lebanon M206 Chapter 32 11 1-Specifying software: The NSR The NSR Should express in unambiguous way, what the system will do (behaviour) and what limitations on the system developer are (different kinds of constraints). The NSR is the key document which all subsequent activities depend. The NSR will gradually emerge and be clarified through a process of feedback and iteration. A simplistic NSR is produced initially, from which a prototype system is developed. The requirement analysis and NSR are independent from OO concepts.

12 Computing: An Object-Oriented Approach Arab Open University – Lebanon M206 Chapter 32 12 1-Specifying software: The NSR The NSR will contain other details from behaviour & constraints:  A description of the criteria for acceptability of the software.  A description of any training required to be provided.  A description of any support/maintenance from the developer From now on we will concentrate mainly on the specification Of behaviour (behavioural specification). This doesn ’ t mean that the constraints are not important (in real-time applications, such avionics, they are critical).

13 Computing: An Object-Oriented Approach Arab Open University – Lebanon M206 Chapter 32 13 1-Specifying software: The NSR The Behavioural specification should be: unambiguous. in a form that enables the developer to reason about the properties of the system it describes. free of extraneous (irrelevant) details. partitioned. understandable by the client. (check the examples given in pages 9, 10 & 11)

14 Computing: An Object-Oriented Approach Arab Open University – Lebanon M206 Chapter 32 14 2-Eliciting information The main way of eliciting information (to prepare the NSR) is to ask questions. The most fundamental question asked by the software developer is ‘ Why do you want this software system? Questioning of a client normally takes place in a number of stages: First, broad questions. The answers are studied then more detailed questions are reformulated and so on. Is it possible to categorize those questions?

15 Computing: An Object-Oriented Approach Arab Open University – Lebanon M206 Chapter 32 15 2.1-Categories of questions Scoping questions: These are questions that attempt to delineate what facilities should be in a system and what facilities should not be included. Questions about input data: Files, barcode reader, devices. Questions about output data: Screen, printer, files … Questions about behaviour: These questions will range from very broad questions to very detailed ones. Ex: The hotel system should process guest details. What does ‘ process ’ mean?

16 Computing: An Object-Oriented Approach Arab Open University – Lebanon M206 Chapter 32 16 2.2-Overlapping categories of questions In real life, a question will often involve a combination of concerns involving detailed system functions, input data, output data and scoping. In posing questions, you should not be too worried that a question does not fit neatly into one of the 4 categories mentioned earlier. Questions are usually overlapped.

17 Computing: An Object-Oriented Approach Arab Open University – Lebanon M206 Chapter 32 17 Summary RequirementsAnalysis NSR Categories of questions ScopeInput DataOutput DataBehavior

18 Computing: An Object-Oriented Approach Arab Open University – Lebanon M206 Chapter 32 18 3.1- SR: The Hospital Admission and Treatment system (HAT) This part of the system is concerned with the admission, treatment and discharge of patients. When a patient is admitted to the hospital, he or she is placed in the care of a team of doctors. Each team is headed by a consultant doctor who is responsible for the patients assigned to that team. A record has to be kept of the doctors in a team who have actually treated the patient while in hospital. The system should be able to: record the admission of a patient to the hospital; give a list of the doctors who have treated a patient; give a list of the patients that a team cares for together with the ward that each patient is in, process the discharge of a patient from the hospital.

19 Computing: An Object-Oriented Approach Arab Open University – Lebanon M206 Chapter 32 19 3.2-Asking questions Analyst: What information do you need to record about patients when they are admitted to the hospital? Admin: Well, their name and address. Oh, and their age. No, not their age, their date of birth. Analyst: Don ’ t you record what ’ s supposed to be wrong with them? Admin: No, the consultant looks after that side of things. All we need to do is to note who the consultant is. Analyst: What consultant is this? Admin: Each patient is under the responsibility of a particular consultant. We are told which one when the patient is admitted. Analyst: So how do you identify which consultant it is? Do they have some kind of identification numbers? Admin: No. We just use their team code.

20 Computing: An Object-Oriented Approach Arab Open University – Lebanon M206 Chapter 32 20 3.2- Asking questions Analyst: So you make a note of the consultant responsible for the patient by recording their team code? Admin: That ’ s it. Analyst: Does this mean that all the consultants on a team are responsible for the patient? Admin: No, you don ’ t understand. There is only one consultant on each team. The consultant is the leader of the team. I thought I ’ d made that clear in my requirements. Analyst: Well, yes, it did say that each team was headed by a consultant. I just hadn't realized that there weren't any other consultants on the team. Now then, let ’ s see. You say you record the team code. What exactly is a team code? Admin: It ’ s just a name we use for the team. For example we have an A&E Crash team, a Paediatrics A team, an Orthopaedics B team …

21 Computing: An Object-Oriented Approach Arab Open University – Lebanon M206 Chapter 32 21 3.2- Asking questions Analyst: Right, when a patient is admitted you need to note their name, address and date of birth and the team code. Is that all? Admin: Well of course, we need to know what ward the patient is on. Analyst: Why is that? Admin: Otherwise we wouldn ’ t be able to keep track of them. I mean we might have two patients with the same name and get them mixed up. So we use the ward name and the patient name to identify them. Analyst: but what if you get 2 patients in the ward with the same name? Admin: That hardly ever happens, but when it does we just add a figure ‘ 2 ’ at the end of the name of the second patient, so that way they don ’ t have the same name. Analyst: So when a patient is admitted you record the ward name as well the patient name?.....

22 Computing: An Object-Oriented Approach Arab Open University – Lebanon M206 Chapter 32 22 3.3- The Negotiated Statement of Requirements for HAT system After asking questions a Negotiated SR is produced: In the hospital, there are a number of wards, each of which may be empty or have on it one or more patients. Each ward has a unique name. The hospital has an Administration department that is responsible for recording information about the hospital ’ s wards and the patients that are on each ward. The doctors in the hospital are organised into teams, each of which has a unique team code (such as orthopaedics A, or paediatrics). Each team is headed by a consultant doctor who is the only consultant doctor in the team; the rest of the team are all junior doctors, at least one of which must be at grade 1. Each doctor is in exactly one team. The Administration department keeps a record of these teams and the doctors allocated to each team.

23 Computing: An Object-Oriented Approach Arab Open University – Lebanon M206 Chapter 32 23 3.3- The Negotiated Statement of Requirements for HAT system Each patient is under the care of a single team of doctors. The consultant who heads that team is responsible for the patient. A patient may be treated by any number of doctors but they must all be in the team that cares for the patient. A doctor can treat any number of patients. The Hospital Admission and Treatment system will provide support for the administration of the hospital by: recording information about the hospital ’ s wards, including each ward ’ s name; recording information about the hospital ’ s doctors, including each doctor ’ s name, address and, for junior doctors, grade, and the way in which they are organised into teams; recording information about each patient: from their admission to a ward to their discharge from the hospital, including their name, address and date of birth and the ward the patient is on.

24 Computing: An Object-Oriented Approach Arab Open University – Lebanon M206 Chapter 32 24 3.3- The Negotiated Statement of Requirements for HAT system Patients are identified by the name of the ward they are on together with the patient's name. Similarly, doctors are identified by the team code and the doctor ’ s name. The system has to be able to do the following: In response to an enquiry about the doctors who have treated a patient, the system should display the following information: The team code of the team caring for the patient; The name of the consultant doctor responsible for the patient; A list of the names of the doctors who have treated the patient; In response to an enquiry about the patients that a team cares for, the system should display the following information: The names and dates of birth of the patients that are currently in the hospital and that the team cares foe, together with the names of the wards that they are on.

25 Computing: An Object-Oriented Approach Arab Open University – Lebanon M206 Chapter 32 25 3.3- The Negotiated Statement of Requirements for HAT system When a patient is admitted the system is given the following information, which it should record: The new patients name, address and date of birth; The name of the ward to which the patient has been admitted; The team code of the team that is to care for the patient. When a patient is treated by a doctor the system is given the name of the patient, the name of the ward the patient is on, the name of the doctor and the code of the team the doctor is in. The system should record that the doctor has treated the patient. When a patient is discharged the system is given the name of the patient and of the ward the patient is on. The system should remove all information relating to that patient.

26 Computing: An Object-Oriented Approach Arab Open University – Lebanon M206 Chapter 32 26 4.1- SR: The Open Computing Supplies system (OCS) The Open Computing Supplies (OCS) company owns several shops selling computing equipment and wishes to expand its business by offering customers the opportunity to order products (computers, printers, monitors, etc.) via the Internet. The main purpose of the system is to allow registered customers to view information about the products that are for sale and choose any that they wish to order. A customer can add an item of a product to her order, unless it is out of stock. When the order is complete the customer confirms the order, and the system informs the warehouse of the details of the order so that delivery can be arranged. To function as required the system will also need to allow staff to register customers, add new products, keep the details about products the company sells up-to-date and view details of orders placed by customers.

27 Computing: An Object-Oriented Approach Arab Open University – Lebanon M206 Chapter 32 27 4.2- Asking questions Why do you want a software system? How can you be sure that customers are who they claim to be; is there any security? Can a customer create more than one order simultaneously? What information is kept about each product? What happens if an item is out of stock? How do customers order more than one item of a product? Is there an upper limit to the amount customers can order? How is the warehouse told what to deliver?....... (Page 18, Exercise 6)

28 Computing: An Object-Oriented Approach Arab Open University – Lebanon M206 Chapter 32 28 4.3- The Negotiated Statement of Requirements for OCS system The Open Computing Supplies (OCS) company owns several shops selling computing equipment and wishes to expand its business by offering customers the opportunity to order products (computers, printers, monitors, etc.) via the Internet. A system is required to enable registered online customers to: view information about the products available; construct an order; place their order; and terminate their visit without ordering. The system will also enable company staff to: register a new customer; record a new product; record an increase in the stock level of a product; change the price; and view details of orders placed by a customer. The system will hold information about the computing equipment stocked by the company. The following details of each product will be recorded: a description of the product (each product has a unique description); the price of the product; and the stock level of the product.

29 Computing: An Object-Oriented Approach Arab Open University – Lebanon M206 Chapter 32 29 4.3- The Negotiated Statement of Requirements for OCS system The system will hold the following information about customers: their customer numbers (unique to each individual); password; name & address. Commencing a visit: A customer initiates a visit to the OCS system by identifying and authenticating herself to the system by providing her customer number and password. A customer is allowed only one visit at any one time. Once identified and authenticated, an order (initially empty) is created for that customer. She can then view all of the product descriptions, and is able to add items to her order for subsequent delivery to her address. Viewing prices and constructing an order: When the customer selects a product description, the price of the product is displayed. The customer may then indicate that she wishes to add an item of that product to her order. An item may not be added if the stock level for the corresponding product is zero. The system responds by creating an order item as part of the customer ’ s order and decreasing the stock level. If the customer requires more that one item of a product she add them one by one. The system continually displays the total cost and for each individual order item the description and the purchase price.

30 Computing: An Object-Oriented Approach Arab Open University – Lebanon M206 Chapter 32 30 4.3- The Negotiated Statement of Requirements for OCS system Placing an order: She may do this at any time if there is at least one item in her order. Placing an order results in the production of an invoice, addressed to the customer, detailing the contents of her order. This printed invoice is passed to the warehouse, where the physical items are selected and packed to be dispatched, along with the invoice, to the customer. Placing a order terminates a visit. It is not possible to add further items to an order once it has been placed. Terminating a visit without ordering: the customer can at any time terminates her visit without placing an order. In this case all details of her order are removed from the system and stocks levels are adjusted. Registering a new customer: A member of company staff may enter for the system to record: customer number, password, name & address. Recording a new product: A member of company staff may enter for the system to record: description, price and stock level.

31 Computing: An Object-Oriented Approach Arab Open University – Lebanon M206 Chapter 32 31 4.3- The Negotiated Statement of Requirements for OCS system Increasing stock and changing product price: A member of company staff may view the descriptions of all products. On selecting a product description, the current stock level and price are displayed. The staff member may then enter a number corresponding to the additional quantity of stock of that product and indicate that he wishes to increase the stock. Or he may enter a number corresponding to the new price of that product and indicate that he wishes to alter the price. In both cases, the new information is displayed. Viewing placed order details: A member of company staff may view the customer numbers of all customers. On selecting a customer number, the following are displayed in respect of each order placed by that customer: the date on which the order was placed, the total cost of the order and for each individual order item comprising the order, the description of the corresponding product and the purchase price of the item.

32 Computing: An Object-Oriented Approach Arab Open University – Lebanon M206 Chapter 32 32 Few notes on TMA04 Question 1 Explanation of the problem. A dictionary that contains sets, difference between add: & union:??? Try to give hints on ii) Question 2 Explanation of the problem. 2 variables references same object, state, identity, copy, encapsulation??? Question 3 Explanation of the problem. Array, orderedCollection, sortedCollection???


Download ppt "Computing: An Object-Oriented Approach Arab Open University – Lebanon M206 Chapter 32 1 Week 2."

Similar presentations


Ads by Google