Key Terms:
Code
Condition
criterion
false
true
program
pseudocode
flowchart
variable
Lesson Plan: Testing
TEKS 6 (2)(B) Â (2) Computational thinking--applications. :
(B) use a design process to create block-based and text-based programs that include sequences, loops, conditionals, and events to solve an everyday problem.
Learning Objective
I will have a peer test and evaluate my game.
Success Criteria
My game was tested by a peer with feedback.
I will test my peers game
What action have you coded for your game?
Computer Science Concepts
Test
Iterate
Feedback
Welcome, future coders and digital detectives!
When you're building something cool, like a treehouse or a robot, you don't just finish it and walk away, right? You test it! You climb in the treehouse to make sure it's safe, or you turn on the robot to see if it moves the way you want.
Coding is exactly the same! After you write your instructions (your code), you need to test them to make sure everything works perfectly. This is a super important part of the design process for any program.
Imagine you've written a recipe for a delicious cake. Testing is like baking the cake to see if it tastes good, if it rises properly, and if it's actually edible!
In coding, testing means running your program and carefully checking if it does exactly what you expect it to do. It's about finding any mistakes, or "bugs," before anyone else does!
Think about apps you use every day. What happens if they crash, or a button doesn't work, or they give you the wrong information? It's frustrating, right?
Testing helps us:
Find Bugs: Just like real bugs, code bugs can cause problems! They can make your program crash, give wrong answers, or behave strangely. Testing helps you squash them!
Make it Reliable: You want your program to work every single time, no matter what. Testing helps ensure it's strong and dependable.
Improve User Experience: If your program is easy to use and doesn't have glitches, people will enjoy using it more! Testing helps make it user-friendly.
Save Time (in the long run!): Finding a small bug early is much easier than finding a huge problem after your program is already being used by lots of people.
Being a good tester is like being a detective. You need to be observant, think critically, and follow a process!
Here are the steps:
Understand the Goal: What is your program supposed to do? What problem is it trying to solve? What should the user experience be like?
Detective Question: "What's the mission?"
Plan Your Tests: Don't just randomly click! Think about all the different ways someone might use your program. What inputs will you give it? What do you expect to happen for each input?
Detective Question: "What clues will I look for? What should happen if I try X, Y, or Z?"
Example: If your program asks for a name, what happens if someone types a short name, a long name, or nothing at all? What if they type numbers instead of letters?
Run the Program: Execute your code with the inputs you planned.
Detective Action: "Let's see this in action!"
Observe and Record: Watch very carefully what actually happens. Does it match your expectations? Write down what you observed. If it's different from what you expected, you've found a potential bug!
Detective Action: "Gathering evidence! What did I see? Was it what I expected?"
Identify the Bug: If something went wrong, try to figure out where in your code the mistake is. Is it a typo? A wrong calculation? A missing instruction?
Detective Question: "Where's the culprit hiding in the code?"
Fix the Bug: Change your code to correct the mistake.
Detective Action: "Apprehending the culprit and correcting the error!"
Retest: After you fix a bug, run all your tests again (especially the one that found the bug!). You need to make sure your fix actually worked and didn't accidentally break something else.
Detective Action: "Double-checking my work! Did I solve the mystery completely?"
Lesson Plan: Iteration
.Â
TEKS 6 (2)(B) Â (2) Computational thinking--applications. :
(B) use a design process to create block-based and text-based programs that include sequences, loops, conditionals, and events to solve an everyday problem.
Learning Objective   Â
I will make iterations to my game
Success Criteria
I used my peers feedback to improve my game.
Computer Science Concepts
Peer Review
Feedback
Iteration
Hello again, Digital Detectives! Last time, we learned how to test our own code to find bugs. Today, we're going to level up our coding skills by learning how to make our programs even better!
Imagine you've built an amazing LEGO castle. You might show it to a friend, and they might say, "Wow, that's cool! What if you added a drawbridge here?" Or, "Maybe this tower could be a bit taller to look more realistic." This is like peer review and iteration in coding!
Iteration means making changes and improvements to your code based on feedback (from testing, peer review, or new ideas). It's the process of refining your program step-by-step.
Think of it like sculpting. You don't just make a perfect statue on the first try. You sculpt a bit, step back, look at it from different angles, maybe get some advice, and then make more changes. You iterate until it's just right!
Coding is Never "Done": There's almost always a way to make a program better, faster, or more user-friendly.
Continuous Improvement: Iteration helps you continuously improve your skills and the quality of your code.
Adapting to Needs: As you test and get feedback, you might realize the program needs to do something slightly different. Iteration allows you to adapt.
Building on Success: Each iteration builds on the last, making your program stronger and more complex over time.
Lesson Plan: Peer Review Testing
TEKS 7(3) Creativity and innovation--innovative design process (B) discuss and implement a design process that includes planning and selecting digital tools to develop and refine a prototype or model through trial and error;
Learning Objective
I will have 3 peers test my game and give more feedback
Success Criteria
3 of my peers tested my updated game and gave me more feedback.
Computer Science Concepts
Loops, Variables
Game Design Concepts
Sprites and Projectiles
Velocity
Game Score
Win/Lose Criteria
Randomization
Animation
Peer review is when another coder (your "peer") looks at your code and gives you feedback. It's like having a second set of eyes, or even a whole team of eyes, to spot things you might have missed or suggest new ideas.
Fresh Eyes: When you've been staring at your own code for a long time, it's easy to miss small mistakes or confusing parts. Someone else sees it with fresh eyes!
Different Perspectives: Everyone thinks a little differently. A peer might have an idea you never considered, or they might find a way to make your code clearer.
Catch More Bugs: Two (or more!) detectives are better than one at finding hidden clues (bugs)!
Learn from Each Other: When you review someone else's code, you learn new ways to solve problems. When your code is reviewed, you learn how to improve your own coding style.
Better Programs: Ultimately, peer review helps make your programs more robust, easier to understand, and more user-friendly.
Giving feedback is a skill! Here's how to do it constructively:
Be Kind and Respectful: Always remember you're helping someone, not criticizing them. Start with something positive!
Example: "I really like how you organized this part of the code."
Be Specific: Don't just say "This is confusing." Point to the exact line or section and explain why it's confusing.
Instead of: "This doesn't work."
Try: "On line 15, when I enter 'hello', the program crashes. I think it's because you're trying to add text to a number."
Focus on the Code, Not the Coder: Talk about the code itself, not the person who wrote it.
Instead of: "You made a mistake here."
Try: "This line of code might cause an error if..."
Suggest Solutions (if you have them): If you see a problem, try to suggest a way to fix it, or at least offer to help brainstorm.
Example: "Maybe you could use an if statement here to handle empty inputs."
Ask Questions: Sometimes, asking a question is the best way to get the coder to think about an improvement.
Example: "What happens if a user types in a very long sentence here? Is that what you intended?"