THE BIG BOOK OF COMPUTING PEOAGOGY

Page 68

RESEARCH

CODE TRACING Reading code before writing it is vital, and code tracing is an ideal activity to develop learners’ program comprehension eveloped in the early 2000s, code tracing is a well-established approach to help learners build their program comprehension. Put simply, it involves reading and analysing code before running it, to predict its outcome. Novice programmers should be competent in code tracing before they can confidently write programs of their own. Here, we explore code tracing, its benefits, how it fits in with the concept of the notional machine, and how you can use code tracing in the classroom.

D

What is code tracing?

It is widely understood that young learners should ideally have developed some reading skills before they begin learning to write. Similarly, in computing, there is a body of evidence to suggest that code tracing, a form of code reading, is an

SUMMARY Tracing involves: ■ Reading the code ■ Interpreting the meaning ■ Recording the flow and/or outputs

Benefits of tracing: ■ Fosters program comprehension ■ Improves code writing ■ Supports learners in analysing and

explaining code ■ Exposes misconceptions ■ Reduces cognitive load ■ Helps learners develop a consistent

notional machine

68

The Big Book of Computing Pedagogy

effective precursor to code writing and independent programming. When tracing code, learners review chunks of code, or whole programs, and record their expected behaviour and execution flow at various stages. They can capture this through annotation as well as by recording the program output at each stage. You may ask learners to trace a piece of code, predict the outcome, and then guide them through the code, line by line, to test their prediction. Typically, you’ll ask learners to predict away from the computer, to ensure they focus on reading rather than executing the code. You could also give

basic level, followed by explaining the code, and finally progressing to writing. Many other studies have been completed based on this theory. Hertz and Jump, who developed the trace-based teaching model, found that starting a class with 20–30 minutes of tracing increased attainment and decreased dropout rates.3 A 2004 study found that learners who could trace effectively less than 50 percent of the time could not explain the code effectively.4 Code tracing can help to reduce the cognitive load placed on learners. By focusing learners’ efforts on existing and working programs, and by answering specific

STARTING A CLASS WITH 20–30 MINS OF TRACING INCREASES ATTAINMENT AND DECREASES DROPOUT RATES

learners short sections of code in the form of worked examples (see page 90), or ask them to complete trace tables where some values are provided, and they can use code tracing to record the missing values. Then, with this secure understanding, you can allow learners to create their own programs featuring the concepts they have traced. While there is no single approach to tracing, there are some clearly defined methods, such as TRACS1 tracing, which may be helpful for learners to follow.

Benefits

Harrington2 identified that when learning to program, learners build their understanding in a hierarchical way. Tracing is at the most

questions, educators can avoid unnecessary extraneous load being placed on learners. If learners have the opportunity to trace code, they can comprehend the code and its function before seeing it in action. Many other subjects explore similar ideas, such as the Talk for Writing framework in literacy, and progressing from concrete objects to abstract numerals in mathematics. This approach also helps develop learners’ understanding of the notional machine — how the code is executed. If we accept that there is a broad consensus advocating code tracing as an effective strategy with a range of evidence to support the claim, what should we consider when using it in the classroom?


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.
THE BIG BOOK OF COMPUTING PEOAGOGY by black century - Issuu