Business and technology qualifications, Levels 3-6, in Brussels. Explore qualifications
Portal login
Diploma in Higher Education Studies

Tracing and testing a program

HES 211 · Introduction to Programming with Python — Week 13 of 16

CourseHES 211
Week13 of 16
SemesterII
TutorOnline in the course chat

This week’s topics

Tracing and testing a program

  1. Print statements and trace tables
  2. Choosing test data

What you will be able to do

  • 5.2 Use print statements/debugger to trace a program.
  • 5.1 Identify and fix syntax and logic errors.

Activity

Trace a program with a trace table and test it with your own data.

Study materials

Further resources

  • Introduction to Computer Science, 9.3: Testing · PDF · OpenStax Introduction to Computer Science (2024), 9.3 Testing: test levels and choosing tests, pp. 468–472 · for registered students
  • Introduction to Computer Science, 2.1: Test cases · PDF · OpenStax Introduction to Computer Science (2024), 2.1 on checking an algorithm with test cases, pp. 46–51 · for registered students
  • Think Python, Appendix A: Debugging with print statements · PDF · Downey, Think Python 2e (Green Tea Press), Appendix A on adding print statements to trace what a program does, pp. 193–200 · for registered students
  • A multi-national study of reading and tracing skills in novice programmers · Open-access article · Lister et al. (2004), ACM SIGCSE Bulletin (ITiCSE working group report). Study of novices tracing code by hand, like a trace table. · for registered students
  • Software-testing education: a systematic literature mapping · Open-access article · Garousi et al. (2020), Journal of Systems and Software. Overview of how program testing and test data are taught. · for registered students
Materials marked “for registered students” open in the student portal, which is set up as soon as you receive final acceptance.
Course chat

Admitted students ask questions on this week’s page in the student portal: an AI assistant trained on the course answers first, and during the course’s timetabled classes Connect to your tutor brings your tutor into the chat, who may start a call if needed.

Open this week in the portal
Course plan
  • Week 1: What is programming? High- and low-level languages
  • Week 2: Your first Python program
  • Week 3: Variables, data types and constants
  • Week 4: Input, output and calculations
  • Week 5: Making decisions: if, elif and else
  • Week 6: Repeating code: for loops
  • Week 7: Repeating code: while loops
  • Midterm: Midterm evaluation
  • Week 9: Functions: reusable code
  • Week 10: Lists
  • Week 11: Looping through data; tuples and dictionaries
  • Week 12: Finding and fixing errors
  • Week 13: Tracing and testing a program
  • Week 14: Mini project: a small program step by step
  • Week 15: Review and coursework completion
  • Final: Final assessment and submission
Back to the course
Scroll