Home›Lesson Plans›Computer Science›Programming · Grade 10

Testing & Test Cases

Tenth graders learn to test their code — thinking up test cases (including tricky edge cases), running them, fixing failures, and re-testing. Testing catches bugs before users do. They order the process, then write test cases for a program.

Grade 10Testing & Test Cases50 minutes1 class periodCSTA / ISTEExplicit teaching4 StandardsCSTA
Start the Lesson
Assign or share this lesson

Copy link works with Canvas, Schoology, Moodle and any other LMS — paste it in as a resource or assignment.

Lesson at a Glance

Everything you need before the bell rings

Learning Objectives

Students will be able to…

  • ✓Write test cases.
  • ✓Cover edge cases.
  • ✓Run tests & fix.
  • ✓Re-test.
Essential Question

How do you make sure your code actually works — in every case?

0
Lesson Phases
0
Vocabulary Terms
0
Standards Aligned
0
Interactive Task
Put in Order · Interactive

Order the Testing Steps

Project this and have students put the testing steps in order.

🧪 Put the testing steps in orderTry it
Tap the first step of testing code!
The Lesson · Explicit teaching

50 minutes, five moves

Tap any phase to open the teacher moves and student actions.

1

Hook — Does It Work?

5 min

Your code runs once — but does it work for ALL inputs?

👩‍🏫 Teacher Moves

  • Pose the question.
  • Share ideas.
  • Set the goal.

🎒 Student Actions

  • Think.
  • Share.
  • Get ready.
2

Use — Testing

12 min

Students learn.

👩‍🏫 Teacher Moves

  • Send students to Order the Testing Steps.
  • Order the steps.
  • Note include edge cases.

🎒 Student Actions

  • Order.
  • Say.
  • Note it.
3

Modify — Test It

13 min

Students practice.

👩‍🏫 Teacher Moves

  • List normal test cases.
  • Add an edge case.
  • Predict each result.

🎒 Student Actions

  • List.
  • Edge.
  • Predict.
4

Create — Create

15 min

Students apply.

👩‍🏫 Teacher Moves

  • Test a small program.
  • Fix a failure.
  • Re-test it.

🎒 Student Actions

  • Test.
  • Fix.
  • Re-test.
5

Reflect — Reflect

5 min

Students close.

👩‍🏫 Teacher Moves

  • What is an edge case?
  • Why re-test after a fix?
  • Complete the exit ticket.

🎒 Student Actions

  • Say it.
  • Say it.
  • Complete the exit ticket.
Standards Alignment

Built to the standards you report on

Aligned to the CSTA K-12 Computer Science Standards and the ISTE Standards for Students.

CSTA
3A-AP-17

Systematically test and debug programs.

CSTA
3A-AP-21

Evaluate correctness with test cases.

CSTA
3B-AP-21

Develop and test as a process.

ISTE
5c

Verify computational solutions.

Differentiation

One lesson, every learner

Multilingual Learners

ELL / EMERGING READERS
  • Testing-step cards.
  • Frame: "an edge case is ___."
  • Test a tiny program.

Support & Access

IEP / 504
  • Use 3 core steps.
  • Use one normal test.
  • Use a template.

Stretch & Extend

GIFTED / EARLY FINISHERS
  • Write automated tests.
  • Add boundary cases.
  • Test a partner’s code.
Materials

What to gather

  • 📽️Screen / board
  • 🧪Testing cards
  • 💻Order the Testing Steps
  • 📋Test-case worksheet
  • 📓Notebooks
  • 🎫Exit-ticket slips
Vocabulary

Key terms — hover for a quick definition

test casean input and its expected resultedge casean unusual or extreme inputexpected resultwhat should happenbugan error in codedebugfind and fix a bugpass/failwhether a test succeedscoveragehow much is testedre-testtest again after a fix
Evaluate

Exit Ticket

Preview the three formative checks. Tap “Sample answer” to see what mastery looks like — hide them before you print for students.

QUESTION 1
What is an edge case?
An unusual or extreme input, like an empty list.
QUESTION 2
Why re-test after fixing a bug?
To confirm the fix worked and nothing else broke.
QUESTION 3
When should you think up test cases?
Before and while you code — not just at the end.

Reflect: testing & test cases.

Have students write test cases for a small program. A printable test-case worksheet is in the CS library.

Study · Flashcards

Study the key terms

Tap a card to flip it, then rate whether you knew it. Built from this lesson’s vocabulary.

🃏 Testing & Test CasesFlip
Card 1
Term
Tap to flip →
Meaning
0

Nice work!

Practice · Quiz

Check your understanding

A quick self-check with instant feedback, drawn from this lesson’s key terms.

📝 Testing & Test CasesQuiz
Score: 0
1 / 6
Question 1
0%

Nice work!

Practice · Worksheet

Printable worksheet

A print-and-go review sheet with a built-in answer key. Tap “Show answer key” to reveal answers, or print the clean version for students.

🖨️ Testing & Test CasesPrint
Name: ________________________
Date: ____________

Part A · Write the word that matches each meaning

Word bank: bug, coverage, debug, edge case, expected result, pass/fail, re-test, test case
  1. test again after a fix
  2. how much is tested
  3. an error in code
  4. what should happen
  5. whether a test succeeds
  6. find and fix a bug
  7. an input and its expected result
  8. an unusual or extreme input

Part B · Show what you learned

  1. What is an edge case?
  2. Why re-test after fixing a bug?
  3. When should you think up test cases?
Answer key — Part A: 1) re-test · 2) coverage · 3) bug · 4) expected result · 5) pass/fail · 6) debug · 7) test case · 8) edge case
Part B: 1) An unusual or extreme input, like an empty list. 2) To confirm the fix worked and nothing else broke. 3) Before and while you code — not just at the end.