Software development, law and ethics · A level · OCR H446 1.2.3, AQA 7517 4.13.1.1, Eduqas A500QS 1.5 · about 60 min
A small project taken through analysis, design, implementation, testing and evaluation, the way the NEA is written up.
[1 mark]In a project write-up, what should the evaluation be based on?
[1 mark]Why is it good practice to unit test gap_ok before the robot moves?
[1 mark]AQA's A level project is marked out of how many marks?
[1 mark]Put the stages of a project write-up in order.
Number the lines 1 to 5 to put them in the right order.
ImplementationAnalysisDesignTestingEvaluation[1 mark]The evaluation counts the criteria met. What does this print?
results = [("SC1", True), ("SC2", False), ("SC3", True)]
met = 0
for name, ok in results:
print(name, "met" if ok else "not met")
met += ok
print(f"criteria met: {met} of {len(results)}")Build the designed program. The robot starts facing the charging wall, 71 cm away. The delivery bay is to the right of where it parks.
Write these subroutines, and use them in this order:
- gap_ok(gap): gap is a number of cm; returns True if it is from GAP_LOW to GAP_HIGH inclusive, otherwise False.
- run_unit_tests(): tests gap_ok with exactly these five values, in this order: 16.9 (expected False), 17 (True), 20 (True), 23 (True) and 23.1 (False). For each, print test gap_ok(<value>): pass or test gap_ok(<value>): FAIL, then print unit tests: <passed> of 5 passed.
- approach(target): target is the gap in cm to park at; drive towards the wall and return the gap read with distance() once stopped. Call it as approach(20).
- sidestep(cm): move right cm centimetres. Call it as sidestep(30).
- signal(): LED green and an 880 Hz note.
- evaluate(gap, elapsed): gap is the value approach returned and elapsed is clock() read after signal(). Print SC1 gap <gap> cm: <result> using gap_ok, SC2 in the bay after <elapsed> s: <result> (met if elapsed is at most TIME_LIMIT), and SC3 signal: met, where each <result> is met or not met. Then print criteria met: <n> of 3, counting the criteria met.
The whole program prints exactly ten lines. SC4 is checked by watching the run, so the program does not print it: do not touch the wall.
# the two lines every program starts with: the commands, then the robot
from bugbot import *
connect()
GAP_LOW, GAP_HIGH = 17, 23 # SC1, in cm
TIME_LIMIT = 30 # SC2, in seconds
def gap_ok(gap):
passPlan your program here, then type it in and press Run.