Answer all questions below. Q4 has an interactive playground. When you are done, export your answers as JSON at the bottom.
Test the UNSW Lecture-Theatre Booking system with Decision-Table testing. Rules are checked one by one and the first matching rule applies. Outputs: 0=Booked, 1=Wait-list, 2=Rejected.
| Input | Encoding |
|---|---|
| room_size | 1=Small, 2=Medium, 3=Large |
| time_slot | 1=Morning, 2=Afternoon, 3=Evening |
| week | 1 to 12 (numeric) |
| equipment | 1=Standard, 2=AV, 3=ComputerLab, 4=Hybrid |
| staff_role | 1=Academic, 2=Admin, 3=Guest |
Rules: invalid input → rejected; exam weeks 11–12 allow only academics and block Large theatres; teaching weeks 1–10 have room/equipment/role constraints; otherwise booked. Exactly one table below is correct — select it.
Below are four candidate CFGs for binary_search, written as DOT graphs and rendered. Exactly one is correct — select it.
Develop a test suite achieving loop-boundary coverage (loop runs 0, 1, and 2 times). Fill each circled blank. Recall mid = int(round((top+bott)/2.0)).
Marking: each loop case = 1 mark; within a case, one wrong blank −0.5, two or more wrong −1.
(a) Introduce exactly one single-line bug into binary_search so that all three Q3 tests still pass (the bug is invisible to the Q3 suite).
(b) Give one extra test case that distinguishes the mutant from the original (original passes, mutant fails).
Use the playground: edit the function to your mutant, enter your distinguishing test, and press Run check. It reports whether your mutant still passes the Q3 suite and whether your test separates the two.
(a) Describe your one-line mutation (form from → to):
Calculate the Halstead programming effort for the following code (parentheses are not counted as operators):