AI in Software Testing: Teaching Tips

Teaching Strategy

  • Start with the Why

    • Begin by discussing the limitations of traditional testing and how AI fills the gap.

    • Emphasize where and why AI fits into a QA workflow, not just how to use it.

  • Use Live Demos Frequently

    • Demonstrate test generation by typing prompts live into ChatGPT or Copilot.

    • Show students how prompt changes impact the output.

  • Encourage Iteration, Not Perfection

    • AI-generated output is a starting point, not a final product. Reinforce the need for human review.

    • Encourage students to tweak prompts and compare results.

  • Guide Critical Thinking

    • Ask students: “Would you trust this test? What would you do differently?”

    • Discuss potential risks of hallucinations or logic errors in AI-generated code.

Tips for Lab Delivery

  1. Allocate Time for Exploration

    • Students should test and refine AI prompts—build in reflection time after each lab.

  2. Encourage Pair Programming

    • Pairs or small groups promote discussion about AI reliability and prompt strategy.

  3. Use the Discussion Questions

    • At the end of each lab, facilitate a short group conversation based on the “Discussion and Sharing” section.

  4. Point Out Ethical Considerations Early

    • Begin seeding conversations about authorship, reliability, and limitations from the start.

Common Pitfalls and How to Handle Them

IssueHow to Address
AI-generated tests don’t runHelp students debug syntax or framework mismatches (e.g., CommonJS vs ESM in Jest).
Students trust AI output too quicklyRequire a review step: have them explain why a test is valid and what it misses.
Flaky test behaviorUse this as a teachable moment—jump to the Flaky Tests lab to reinforce key lessons.
Students stuck on promptsEncourage them to be specific and structured. Show examples from earlier labs.