This week’s topics
Checking algorithms are correct: tracing, testing and timing
- Evaluating algorithms: correctness via pre-conditions, post-conditions and invariants
- Timing with %timeit
What you will be able to do
- 4.3 Evaluate the correctness and speed of an algorithm.
Activity
Start with this week’s 4 videos, then: Seminar, guided reading and a short written task: evaluate the correctness and speed of an algorithm.
Study materials
Videos
- Tracing algorithms · Oak National Academy, Key Stage 4 (GCSE level) · for registered students
- Using trace tables · Oak National Academy, Key Stage 4 (GCSE level) · for registered students
- Testing principles · Oak National Academy, Key Stage 4 (GCSE level) · for registered students
- Trace tables tutorial GCSE Computer Science · YouTube · Computer Science Tutorials · 5 min · for registered students
Further resources
- Introduction to Computer Science, 9.3: Testing · PDF · OpenStax Introduction to Computer Science (2024), 9.3 Testing: levels of testing, black-box and white-box testing, verification and validation, pp. 468–472 · for registered students
- Python Notes for Professionals, ch. 192: Unit Testing · PDF · GoalKicker Python Notes for Professionals, ch. 192: writing simple tests with unittest and assertions (a step up), pp. 772–779 · for registered students
- Transition from passive learner to critical evaluator through peer-testing of programming… · Open-access article · Grov et al. (2017), New Directions in the Teaching of Physical Sciences. Students learn to design test cases by peer-testing each other's programs. · for registered students
Materials marked “for registered students” open in the student portal, which is set up as soon as you receive final acceptance.