25-Comp-A6 Software Engineering · May 2014
Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer)
National Exams — May 2014 — 98-Comp-A6 Software Engineering. Three-hour, closed-book exam, no calculator permitted. Format: nine questions, candidates answer any five of the nine (all questions equal weight — each of the five counted questions is worth 20%; only the first five questions as they appear in the answer book are marked). All nine questions are solved below for completeness.
Reference texts: Sommerville, Software Engineering (10th ed., Pearson) — software process models, object-oriented design, formal methods, real-time systems, software testing, project management, critical/dependable systems, software quality, distributed systems; Pressman, Software Engineering: A Practitioner's Approach (9th ed.) — supplementary process/testing/quality coverage; IEEE 12207 — software life-cycle processes; SWEBOK — body-of-knowledge cross-reference.
Question text not reproduced: the examination questions are © Engineers and Geoscientists BC. Open the official past paper (linked at the top of this page) to read the question, then follow the worked solution below.
Applying the standard object-oriented heuristic of extracting candidate objects from the nouns of the problem description (diary, appointment, co-worker/user, time slot, request) and merging duplicates gives the following object model.
Person represents a co-worker and holds their normal working hours (used to keep proposed slots inside working hours). Each Person owns exactly one Diary, an aggregate of DiaryEntry objects; a DiaryEntry is marked either fixed (cannot be moved — e.g. an external commitment) or movable (the owner is willing to reschedule it), which is the key attribute that later drives the rearrangement logic. When a group appointment is wanted, a MeetingRequest is created holding the list of participants, the desired duration, and an acceptable date range; its findCommonSlot() operation queries every participant's Diary for free slots and intersects them. If the intersection is non-empty, the earliest common slot is booked directly as an Appointment referencing that slot and the full participant list. If no common slot exists, negotiateReschedule() hands control to a RescheduleAgent, which examines each participant's movable DiaryEntries near the desired time and proposes swaps (proposeSwap(entry)) back to the affected user for confirmation, re-running findCommonSlot() once a movable entry has actually been relocated.