Please write your name only in the last page.
Spring 2014 Midterm Exam Sample Solutions
             CS 319 Object-Oriented Software Engineering
                                      Instructor: Uğur Doğrusöz
Reminders
 Time: 120 minutes (2 Hours)                                               Q1    08
 Write your name and sign only in the last page as indicated.              Q2    10
 Show your work and reasoning clearly and write legibly, only within       Q3    17
  the space provided for each question. Do not detach any page(s).          Q4    65
 From the time you receive your exam script, you will have 60 minutes Total 100 pts
  to read all questions and make sure you understand what is expected from you. During this time you
  may ask your instructor any questions should you require any clarification.
Q1 [8 pts]
Describe iterative development approach and contrast it to sequential or “waterfall” lifecycle approach.
 The iterative approach involves early programming and testing of a partial system (not all
 requirements addressed), in repeating cycles. It also assumes development starts before all the
 requirements are defined in detail; feedback is used to clarify and improve the evolving
 specifications.
 We rely on short quick development steps, feedback, and adaptation to clarify the requirements and
 design. To contrast, waterfall values promoted big upfront speculative requirements and design steps
 before programming. Research supports that the iterative methods are associated with higher success
 and productivity rates, and lower defect levels.
Q2 [10 pts]
Consider the following sequence diagram. Write skeletal code (i.e., code that can be derived from this
diagram) for any non-boundary objects/classes involved in the below diagram. Specify only what is
conveyed in the diagram.
CS 319 Midterm, Spring 2014, CS Dept., Bilkent University                                   Page 1 of 8
Please write your name only in the last page.
                                  public class Y {
                                      …
                                      boolean doB(X x) {
                                          Y y2 = new Y();
                                          x.doD(y2);
                                          …
                                          return flag;
                                      }
                                      void doE() {…}
                                  }
Q3 [17 pts]
A mail-order company wants to automate its order processing. The order processing system should be
accessible to customers via the web. Customers can also call the company by phone and interact with the
system via a customer representative. The use-case analysis reveals use-cases such as “Place Order”,
“Check Status”, and “Cancel Order” for a customer and use-cases such as “Return Product” and “Cancel
Order” for a customer representative. Below is an activity diagram for detailing out part of the use
(business logic) of this mail-order company.
(a) Identify any problems with the diagram, and fix them on the diagram.
CS 319 Midterm, Spring 2014, CS Dept., Bilkent University                                 Page 2 of 8
Please write your name only in the last page.
       “Enter” -> “Get” (activities of the system, not user)
       “ID Check” -> “Check ID”
       “Checkout selected” is not an activity, should be removed
       Synchronization bars are not used when there is no concurrent activities
       No start point is specified
(b) Describe in “plain English”, without using any technical/UML terminology (i.e., using language
    understandable by the customer), the information the diagram conveys about the real life system
    being modeled.
    This activity diagram details out the processes and workflow for the use case “Place Order”. First the
    customer is identified either by ID or by name & address. Then as many products as desired with
    specified quantity are selected either by product ID or by browsing the catalogue if available, and
    added to the shopping cart. When selection is finished, shipping info is taken, and upon approval of
    the order, an invoice is created and forwarded to the accounting department while the order
    information is forwarded to the shipping company.
Q4 [65 pts]
Consider the following problem description:
  A private neighborhood health clinic wants to automate management of their operations by implementing an
  interactive web-based software system using the html5 standard, which should make the system run on
  tablets and smart phones as well as desktop and laptop machines. The Clinic Management System (CMS) is to
  be used by both patients and the clinic personnel (doctors, nurses, and administrative staff).
  A patient will be able to make on-line appointments for an examination, cancel an existing appointment,
  inspect lab results, check their outstanding balance and make payments using their credit cards.
  A doctor will be able to record their schedules including the time periods they are busy and periods they have
  time-off. They will also be able to browse their schedules for any appointments for examinations. The doctors
  could also ask to cancel appointments during a specified period, in case they become unavailable for
  unexpected reasons, subject to approval by clinic director, who is also a doctor with management
  responsibilities. A doctor may browse a list of his/her patients, including past patients. Initially only some
  brief information is displayed for each patient but the doctor may ask for details (including picture and
  patient records in chronological order).
  A nurse will be able to request time-off using CMS, subject to approval by the head nurse (head nurse
  herself/himself reports to the clinic director).
  The administrative staff can also help patients, doctors and nurses to perform operations on their behalf, in
  situations where such a user does not have access to the Internet.
  The accounting of the clinic for both customers (balances due) and clinic personnel (their salaries and other
  compensation) are to be managed by an existing software module put in place by the clinic when they first
  started operation.
  User authentication is especially critical for such a system with sensitive information for both patients and
  clinic personnel. In addition, clinic currently has only about a couple of hundred active patients but as time
  goes by, especially after the automated system is in place, the clinic management expects to have at least
  thousands of patients if not more.
  To attract more customers, the clinic management has also decided to put two types (silver and gold) of
  memberships in place with varying privileges. One can become a silver customer if they have used clinic
CS 319 Midterm, Spring 2014, CS Dept., Bilkent University                                         Page 3 of 8
Please write your name only in the last page.
  facilities pretty regularly for at least two years. A customer who has been a silver customer for at least two
  years gets to be a gold customer, assuming they have never failed to make payments past their due dates.
  Both silver and gold customers are provided with more flexible time slots for making appointments. Gold
  customers get additional privileges such as getting an SMS notification when their lab results are ready.
a) [5 pts] List and justify two non-functional requirements for this system.
     Response time (web-based) and scalability (simultaneously used by many)
b) [20 pts] Identify actors and use cases for the system described above and show them on a UML Use
   Case Diagram.
c) [20 pts] Perform a quick application domain analysis to come up with an object model for the above
   system. Express your findings with a UML Class Diagram, making sure to identify any critical
   operations of classes.
CS 319 Midterm, Spring 2014, CS Dept., Bilkent University                                         Page 4 of 8
Please write your name only in the last page.
d) Consider the following use case scenario:
       Mr. Smith is a registered patient of a clinic using CMS. Lately he is feeling back pain and decides to go to
       the clinic for an examination on upcoming Monday (March 31, 2014). Among the doctors available he
       prefers Dr. Clark. Since he is not very computer friendly, he prefers to call the clinic and ask Mrs. Black
       (clinic staff) to help him set up an appointment. As he is a morning person, he asks to get the first
       morning appointment (8:30) but Dr. Clark doesn't seem to be available at this hour. He then asks for the
       following day and successfully books an appointment with Dr. Clark. The system displays Mr. Smith's
       current address ("123 York Ave, NY") and health insurance information ("FirstHealth",456) and asks
       whether or not an update would be needed. Mr. Smith tells Mrs. Black that there is no change in this
       information, and Mrs. Black completes the task. You may skip any authentication steps.
          [2 pts] First, identify the use case that this scenario belongs to.
            The scenario looks like an instance of the "MakeAppointment" use case.
          [18 pts] Then, draw a UML Sequence Diagram for this particular scenario. You may use any
           software/solution domain objects if needed as well.
CS 319 Midterm, Spring 2014, CS Dept., Bilkent University                                           Page 5 of 8
Please write your name only in the last page.
CS 319 Midterm, Spring 2014, CS Dept., Bilkent University   Page 6 of 8
Please write your name only in the last page.
CS 319 Midterm, Spring 2014, CS Dept., Bilkent University   Page 7 of 8
Please write your name only in the last page.
Mini Dictionary:
To authenticate             Doğrulamak
To approve                  Onaylamak
Available                   Uygun, mevcut
Business logic              İşleme mantığı
Customer representative     Müşteri temsilcisi
Balance due                 Borç
Compensation                Tazminat/maaş/telafi
To convey                   Taşımak, iletmek
Examination                 Muayene/tetkik
Flexible                    Esnek
Head nurse                  Başhemşire
To inspect                  İncelemek
To justify                  Doğrulamak, haklı göstermek
Mail order                  Posta ile yapılan mal siparişi
Outstanding balance         Ödenmemiş bakiye
To place an order           Bir sipariş vermek
Privilege                   Ayrıcalık/imtiyaz
To report to                Karşı sorumlu olmak/rapor etmek
To return a product         Bir ürünü iade etmek
Salary                      Maaş
Sensitive                   Duyarlı/hassas
Skeletal                    iskelet gibi, çatısal
Staff                       Çalışan
Time-off                    İzin, çalışılmayan zaman
Time period/slot            Süre/zaman aralığı
I hereby affirm that the work submitted in this examination is my own exclusively.
Name & Signature: Uğur Doğrusöz                                                      Section:
CS 319 Midterm, Spring 2014, CS Dept., Bilkent University                               Page 8 of 8