All Collections
Classroom
Supporting Students
Debugging Student Code: Getting Un-Stuck
Debugging Student Code: Getting Un-Stuck

Strategies that teachers and students can use to help debug their code.

Jeremy Keeshin avatar
Written by Jeremy Keeshin
Updated over a week ago

Tools In the Code Editor

Docs Tab

Click Docs in the Code Editor to see examples of all of the most important coding concepts that students have learned so far. The Docs tab is a great place to look for examples and check code syntax.

.gif clicking DOCS tab scrolling though information

History Tab

The History tab can be found under the More tab, located on the right side of the Code Editor. Clicking on History will allow students and teachers to view every previous version of the program.

If a program used to work but isn't working now, it can be helpful to look back at an earlier version of the program to see what changes have been made since then. By comparing the two versions, you might be able to spot what caused the problem in the current version.

image highlights the History tab of the CodeHS IDE

Speed Slider and Step Debugger

Use the Speed Slider to run code more slowly so that students can pinpoint where the program gets off-track.

Use the Next and Last arrows, located at the top of the Code Editor to run code one line at a time to zero in on the exact line of code that is causing the error.

Highlighting left, right arrows and pause button along with turtle and hare slider

Comment Out Code

Comment out different sections of code, then re-run the code. When the code runs, the commented-out portions will be skipped, allowing students to use a process of elimination to target the portion of code that is causing an error.

Check the Error Messages and Test Cases

As much as possible, we always try to make error messages as informative as we can. If you're seeing an error message, check if it references a specific function, syntax error, or line of code that can be fixed before re-running the code.

Click here to learn more about the most common error messages you may run into when working on Karel assignments.

Students can also click the Check Code button to see where their program passes or does not pass the Autograder.


Using CodeHS Resources

Review the Video and Slides

Rewatch the lesson video, and go back over the lesson slides to review all of the examples code.ย 

image is a .gif that shows how to access the slides via the More tab, in the IDE

Review the Examples

Every CodeHS lesson includes an Example, which shows the lesson concept in a live code editor. This is a great opportunity to see code in action - students can review Example code at any time to compare to their own work.

Visit our Teacher Forum!

For help with specific student code issues, visit our teacher forum to talk with other computer science teachers, get help debugging code, and share tips and tricks for success! ๐Ÿ˜„ย 



Still have questions? Contact our team at hello@codehs.com to learn more!
โ€‹

Did this answer your question?