- 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.
- Example: "Draw a diagram as you trace through the lines of code!"
- See this and related tips as a Tip Sheet: http://csteachingtips.org/tips-for-assessing-programming