Ask students to explain, compare, or critique code to practice abstracting from lines of code.

Ask students to write sentences to describe code in a way that a friend that isn’t in the class would understand. This provides students the opportunity to demonstrate that they can abstract from individual lines of code. You can make the task a little easier by telling students to summarize the responsibility or behavior of particular parts of the code. As an easier to grade alternative, you can ask students to rename variables in the code.

Example: "Describe the code to someone who has never seen code."

See this and related tips as a Tip Sheet: http://csteachingtips.org/tips-for-assessing-programming

More about this tip