{"id":36300,"date":"2020-12-19T08:31:45","date_gmt":"2020-12-19T03:01:45","guid":{"rendered":"https:\/\/techmasala.addastudents.com\/dev\/?p=36300"},"modified":"2020-12-19T08:31:47","modified_gmt":"2020-12-19T03:01:47","slug":"how-to-introduce-debugging-to-kids","status":"publish","type":"post","link":"https:\/\/techmasala.addastudents.com\/dev\/how-to-introduce-debugging-to-kids\/","title":{"rendered":"How to Introduce Debugging to Kids"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/5sbdngfSZVK7kyPxEjcF3EI57m3yiFZ_yyqrcdtUFD2RvxadkmWZ9_N-7Mo2kx8ufw4cJ85Zb_3C5bANVBqZFmKgp2EbGBMnYM0ouXWe0xR61duqP1CBbbO3lHuwZqEzkV4cgEMZ\" alt=\"A child debugging code on a computer screen\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">When it comes to <strong>teaching kids problem-solving<\/strong>, few methods are as powerful as learning to <strong>debug code<\/strong>. The process of finding bugs and implementing debugging strategies is great practice for problem-solving in other areas of a child\u2019s life.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">These simple guidelines will make it easy to introduce debugging to kids, setting them on the path to becoming better coders and problem solvers.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Incremental Testing<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before we get to the debugging process itself, we need to talk about finding bugs. The best way to do this is through a process called <strong>incremental testing<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">No programmer wants to deal with a dozen or more bugs all at once. Moreover, they don\u2019t want to have to search hundreds of lines of code to find the source of a bug. This is why \u2014 instead of finishing a large project and then testing \u2014 programmers test the code as they go, looking at only a few lines of code at a time.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Even the most complicated computer program, video game, or <strong>algorithm<\/strong> can be decomposed into tiny steps. Coders take these individual steps, create them one at a time, and test each as they go. By following this best practice, even beginner coders can manage debugging with ease.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>What to Do When a Bug Is Introduced<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Once your student has found a bug, they should try to <strong>figure out exactly where and why it is occurring<\/strong>. The best way to start on this is to just take a look at what the code is doing and compare that to what the code is supposed to do.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Every computer programming language (<strong>Scratch<\/strong>, HTML, Python, etc.) has a way of printing or displaying <strong>variables<\/strong>. Using this with the variables affected by a bug can help narrow the source of a bug down to a single line of code.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u25b6 Practice debugging:<\/strong> <a href=\"https:\/\/techmasala.addastudents.com\/dev\/category\/learn-technology-free\/learn-javascript-online\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Step-by-Step Coding Tutorials for Kids<\/strong><\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Here\u2019s how it works.<\/h3>\n\n\n\n<ol class=\"wp-block-list\"><li>Go to the section of code where the bug was found.<\/li><li>Print the affected variables at the very beginning of the section.<\/li><li>Compare the printed value to what the variable\u2019s value was expected to be.<\/li><li>If the values match what is expected, try printing them at the next line of code and check again.<\/li><li>Keep doing steps 3 and 4 until they find the first line of code where the actual and expected values of the variable don\u2019t match.<\/li><\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">In some cases, the bug may be obvious now that the child has figured out where to look in the code. In other cases, they may find more variables that are impacted and have to repeat the 5 steps until they find and fix the root cause.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Staying Methodical<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The process described above may look complicated and tedious at first, but a <strong>methodical approach<\/strong> is the best way to find bugs. When a child is frustrated, it can be tempting for them to try random ideas hoping that trial and error provides a solution. Avoiding this impulse is important, but it takes time to learn.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Patience, focus, and determination may not be technical skills, but they are still practicable skills just like coding and logical thinking. One of the most difficult parts of debugging is remaining calm and working at the problem with a linear approach \u2014 one step at a time \u2014 until a solution is found.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>The Rubber Duck Method<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/cYnISZzq0Utm9HhlRctKtW38HHvzFYmRviKbFg_gleMO1N7c8mocY0ZN7e4eJ5oQ-SYHrjDbYMs2Zy3AtcftOr-cVir1VKv1pZIjLfHetFwvRmwebJFdK9AXzutRdFxuhMFuicd2\" alt=\"Child practicing debugging code with rubber ducks\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">If the cause of a bug is not readily apparent, there are other methods that can aid in the process.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">One of the best ways to master debugging is by teaching debugging. Young children can turn themselves into educators using what might be the cutest name of any process in all of computer science: <strong>the rubber duck method<\/strong>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Here\u2019s how it works.<\/h3>\n\n\n\n<ol class=\"wp-block-list\"><li>Have your student find their rubber duck. It doesn\u2019t have to be a rubber duck \u2014 any favorite toy will do.<\/li><li>Have them explain their code to the toy one line and even one symbol and syntax choice at a time. Ducks are slow to understand, so the more detail in the descriptions the better.<\/li><li>Watch the eureka moment happen!<\/li><\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Thinking out loud is great practice. Explaining those thoughts to someone else is better. Having to make those explanations simple enough for a rubber duck to understand is even better.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When a kid comes across a piece of code that they can\u2019t explain, they are likely to find that is where the bug is occurring. On top of finding bugs, this process also cements the child\u2019s understanding of their computer coding.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Advanced Debugging Tools<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/Eufo7gvu0kbahAnVsu5HP0KM04uovXAe_PDBu_4BKLfTGVItaE3j95fuFrwEZlWxq_ykmpdwF0TOsgjsxXIjonp7zsDzz-JprW5926Z4iITpw9MfKw6dAJcKHGIsPk4yxmMg2BIz\" alt=\"A kid holding a calculator in front of a blackboard\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">As your student advances to more complicated coding activities, they will need more advanced tools. Most coding languages, aside from Scratch and other block-based languages, have <strong>debugging tools<\/strong> that are far more powerful than the methods that we have talked about here.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">These tools do, however, require more advanced computational thinking and coding skills to use properly. There is no need to rush into these tools. Even advanced coders that have access to more complicated tools still use printed variables and variants of the rubber ducky method. It never hurts to master the simple methods! <em>This article originally appeared on <\/em><a href=\"https:\/\/junilearning.com\/?utm_source=gf&amp;utm_medium=introduce_debugging_to_kids&amp;utm_campaign=outreach\" target=\"_blank\" rel=\"noreferrer noopener\"><em>junilearning.com<\/em><\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When it comes to teaching kids problem-solving, few methods are as powerful as learning to debug code. The process of finding bugs and implementing debugging strategies is great practice for problem-solving in other areas of a child\u2019s life. These simple guidelines will make it easy to introduce debugging to kids, setting them on the path [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":33031,"comment_status":"open","ping_status":"open","sticky":true,"template":"","format":"standard","meta":{"footnotes":""},"categories":[70,72],"tags":[586,93,584,585,110,587,94],"class_list":["post-36300","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-learn-technology-free","category-tech","tag-code","tag-coding","tag-debugging","tag-developers","tag-kids","tag-language","tag-programming"],"_links":{"self":[{"href":"https:\/\/techmasala.addastudents.com\/dev\/wp-json\/wp\/v2\/posts\/36300","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techmasala.addastudents.com\/dev\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techmasala.addastudents.com\/dev\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techmasala.addastudents.com\/dev\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techmasala.addastudents.com\/dev\/wp-json\/wp\/v2\/comments?post=36300"}],"version-history":[{"count":1,"href":"https:\/\/techmasala.addastudents.com\/dev\/wp-json\/wp\/v2\/posts\/36300\/revisions"}],"predecessor-version":[{"id":36301,"href":"https:\/\/techmasala.addastudents.com\/dev\/wp-json\/wp\/v2\/posts\/36300\/revisions\/36301"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techmasala.addastudents.com\/dev\/wp-json\/wp\/v2\/media\/33031"}],"wp:attachment":[{"href":"https:\/\/techmasala.addastudents.com\/dev\/wp-json\/wp\/v2\/media?parent=36300"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techmasala.addastudents.com\/dev\/wp-json\/wp\/v2\/categories?post=36300"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techmasala.addastudents.com\/dev\/wp-json\/wp\/v2\/tags?post=36300"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}