Debugging

Published on May 07, 2020

No Description

PRESENTATION OUTLINE

Debugging

Day 2

Debugging

We learn from our mistakes
We're going to talk about bugs today.

No, not this kind of bug.

How many of you are perfect in every way?

What, you mean you're not perfect??

Do you sometimes make mistakes?

What happens when we make a mistake? What should we do?

We should fix it! Of course...


Photo by Caramosca

What is a bug?

Discuss what bugs are in programs.

Every program has bugs.

How many of you play Minecraft?
Do you ever see updates that say they fix bugs?
Yep, even Minecraft programmers make mistakes.

They're a normal part of programming.

What does a bug look like in a Scratch program?

Maybe you run the program and it doesn't do what you want it to do. Does that ever happen to you?

It happens to me. So when we find a bug, what do we do next?

next slide
Photo by Glen Carrie

Untitled Slide

We debug it!

We've talked about algorithms and sequences.

Who can tell me what the definition of an algorithm is?

It's a set of instructions for a computer to complete a task.

Is it important for these instructions to be in the correct sequence?

YES!

So, what's a good way to find a bug?

Read through the sequence of your code step by step, line by line to see if it makes sense.
Photo by Franz & P

Test often

Add code step by step and...
How do we keep the number of bugs down in our programs?

Add code in chunks.

Make your program do one thing. Test it. Is it right?

If yes, add more code to do another thing.

Test it. Is it right?

Add more code to do another thing.

If you test it over and over, you'll find the bugs easier.

You know what's really hard?

Making an entire program, testing it at the end and then finding the bug. It could be anywhere!

Photo by Jake Hills

Let's fix some bugs!

We're going to go to My Stuff in Scratch and open a folder called: Pokemon Debug Challenges.

There are 10 challenges in the Studio numbered 1 to 10. 1 is the easiest and 10 is the hardest.

Let's go there now.

I'll switch over to Scratch and show you where to go.

Open Scratch.
Open My Stuff
Click on Studios
Click on the Pokemon Debug Challenges

Open number 1. Click Remix and rename it.

Read the instructions.
Run the program.
Ask the kids -- what's the problem?
Click Inside.
What kind of code would make this problem.
Can you find the bug?
How should we fix it?
Everyone should fix it. They can then do or add anything they want with this program. They can have 30 minutes.
Photo by joeks

Untitled Slide

Photo by trustypics

Sharon Buttram

Haiku Deck Pro User