Ask students to find and fix a bug in code to demonstrate debugging skills.

Ask students to identify a bug in code. You can model good debugging practices by showing various inputs that produce correct and incorrect output. You can ask students to fix a bug that you demonstrate with tests or ask them to find a bug. For example, you can ask students to write a test case that will demonstrate the bug.

Example: "Programming involves a lot of debugging. Let's practice!"

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

More about this tip