Skills101
← All practice quizzes

Quiz: Testing AI Code

5 questionsNo time limitPass: 60%+10 XP on first pass

The fastest way to trust AI-generated code is to test it. Write acceptance tests before asking, use edge-case tables, compare against a simple brute-force version on random inputs, and use AI to suggest tests without letting it grade its own homework.

Log in to take the quiz

Free account · see your score, answers and explanations, earn XP

  1. Question 1

    Why are tests written before the AI writes code more trustworthy?

  2. Question 2

    What was wrong with split_bill_ai for ₹100 among 3 people?

  3. Question 3

    What input type made the AI's max-subarray function wrong?

  4. Question 4

    What is a brute-force reference used for in randomised testing?

  5. Question 5

    An AI-written test fails. The AI suggests changing the expected value so it passes. What should you do?