25-Comp-A6 Software Engineering · May 2015
Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer)
National Exams — May 2015 — 98-Comp-A6 Software Engineering. Three-hour, closed-book exam, no calculator permitted. Format: eight questions, candidates answer any five (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 eight questions are solved below for completeness.
Reference texts: Sommerville, Software Engineering (10th ed., Pearson) — software process models, function-oriented and object-oriented design, software testing, distributed software engineering, real-time software engineering, reliability engineering, verification and validation; Pressman, Software Engineering: A Practitioner's Approach (9th ed.) — supplementary process/testing coverage; Coulouris, Dollimore, Kindberg & Blair, Distributed Systems: Concepts and Design — scalability, distributed objects, client-server architectures.
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.
A real-time software system is one whose correctness depends not only on the logical correctness of the results it produces, but on the time at which those results are produced: the system must respond to stimuli from its environment within a specified, bounded time, and a logically-correct response delivered too late is considered a failure of the system, not merely a delayed success.
In a hard real-time system, missing a deadline is a system failure with potentially catastrophic consequences (e.g. an airbag control system deploying too late to protect the occupant). In a soft real-time system, missing an occasional deadline degrades the quality of service but does not constitute outright system failure (e.g. a video-streaming player occasionally delivering a frame late causes a visible stutter, not a safety incident).
| System | Stimuli | Controls / Monitors |
|---|---|---|
| Anti-lock braking system (ABS) | Wheel-speed sensor signals at each wheel | Controls the brake-fluid solenoid valves at each wheel to prevent lock-up |
| Patient infusion pump | Infusion-rate/pressure sensor readings; programmed dosage rate | Controls the pump motor delivering medication; monitors line-occlusion and air-in-line conditions |
| Elevator control system | Floor call buttons, in-car floor-select buttons, car-position and door sensors | Controls the hoist motor and door actuators; monitors car position and overload condition |
Reading the narrative as a trace through the machine's states gives four states connected by the sequence of user actions it describes: the machine idles until a coin is deposited, then waits for the selection (coffee, with an optional milk/sugar choice), then outputs the cup, then waits for the user to trigger hot-water dispensing before returning to idle.
Idle is the machine's rest state, awaiting a coin. On coinInserted it transitions to AwaitingSelection, in which the machine accepts the button press encoding the drink type and the milk/sugar options (the question's "with and without milk and sugar" is modelled as a parameter of the single selectionMade event, not as separate states, since it changes what is dispensed but not the control sequence). On selectionMade the machine transitions to DispensingCup, outputs a cup with the selected powdered mix, and waits in that state for the user to place the cup under the tap and press the water button. On waterButtonPressed it transitions to DispensingWater, dispenses hot water, and on completion returns automatically to Idle to await the next customer.