Ask students to predict the output of code to demonstrate code tracing ability

  • Give students some code and ask them what they think the code would do, as well as the values/state of variables and objects are at various points in the code.
  • Ask students what code will output when provided specific inputs. You can also reverse this and ask students to provide inputs that will produce specific outputs.
  • Ask students to compare the output of code in different programs to help students see the differences between similar concepts or commands.
  • Help students understand that being able to predict the behavior of commands in a programming language is an important prerequisite to being able to write code. For all of these you can use them as formative assessment in class.

More about this tip

External Source

Interview with Jennifer Styer