Code Monkey home page Code Monkey logo

debugging's Introduction

Debugging

(This is still a work in progress)

Debugging is a big part of a programmer's life. Programmers inevitably produce bugs as a side-effect of writing code. Having a proper understanding of what a bug is and how to squash it is an essential skill for any developer. In this class we provide the students with a vocabulary and tools for talking and thinking about bugs and how to get rid of them.

Theory

Following Andreas Zeller's Why programs fail we start by introducing a vocabulary:

  1. a defect - a piece of code that can cause an infection
  2. an infection - a program state that is different from the programmer's intention.
  3. a failure - externally observable effect of faulty program behavior caused by the infection.

Practice

The nature of classes in HackYourFuture is very hands-on and in that spirit we should provide the students with tools and assignments. We show some tools that can help track infections like console.log, the Chrome javascript debugger, assertions, and unit tests.

Assignments are comprised of buggy programs, ranging from easy/hard to fix. It's then up to the students to find and fix the bugs.

Of course for us as teachers it's gonna be challenging to come up with various buggy programs that strike the right difficulty balance.

Ideas of buggy programs

Ideas for buggy programs for students to solve:

Week 1

  • If, if-else, else condition as three individual if statements
  • Using an uninitialized variable
  • Attempt to add two numbers together but make one of the numbers a string
  • ...

If you have more ideas for buggy programs, please submit them by creating an issue on Github, or adding a pull request.

Requirements

  • To teach students how to systematically debug programs.
  • Integrate this material into the curriculum as much as possible.
  • Class is taught in a mandatory hangout session.
  • Do actual debugging in front of the class.
  • Work through one of the homework examples during class. Ask them if they made homework, and solve it together.

Ideas

  • Use the MAKEME, README, REVIEW structure just like the other classes.
  • Unit tests with npm and Github giving the student/teacher feedback (George)
  • Use the default structure for assignments:
    • For every assignment the student has to add a file.
    • Little programs they need to fork and fix. Clone and then pull request.
    • The student has to give a name to the file to explain what it does.
  • Give a master class to the HYF teachers and alumni.
  • Add assignments on unit testing.
  • Let them read the program line by line in class.
  • Look at the javascript 1 assignments for inspiration on writing buggy assignments.

Notes

  • Students use various IDEs: Brackets, Visual Studio Code, Chrome debugger.

TODO

  • Introduce myself (Frank) to class 12 before giving a hangouts lecture.
  • Ask the teachers to add debugging assignments.
  • What version of javascript do we use? If we use ES6, we need an ES6 compatible debug environment as well. I'm not sure the Chrome debugger can help us there.

debugging's People

Contributors

georgesapkin avatar mkruijt avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.