Library › Coding AI › High school students

Write test cases for a science fair voting page

  • For High school students
  • You practice Keeping the AI to your sources
  • Time about 5 minutes

About this exercise

Your class used an AI app builder to make a People's Choice voting page for the science fair. Write exactly 5 numbered test cases, each 'Do: ... | Expect: ...', covering a normal vote, voting twice, a wrong student code, voting for your own project, and voting after the deadline. Use the deadline that's current now. No code blocks, under 130 words.

Common mistakes when you ask AI for this

  • Testing the old deadline. The rules say Friday, and the AI tests Friday. Try: Add: "Voting now closes Thursday 3:00pm."
  • Vague expectations. The AI writes 'should show an error' instead of the exact message. Try: Add: "Expect the exact message from the rules."
  • Ideas instead of tests. The AI lists things to think about without steps. Try: Show it: "1. Do: vote with a new code | Expect: Thanks! Your vote for ... is in."
  • Test code. The AI writes automated tests in code blocks. Try: Add: "Plain words, no code blocks."

What a strong prompt includes

  • Shows the test shape
  • Uses the new deadline
  • Asks for exact messages
  • Sets the count
  • Caps the length

Practice this now ↑

Related exercises