Learning Hub/AI App Development/Session 5

Session 5 of 5 · 75 minutes

Testing, Safety and Demo Day

Make your app safe and reliable, test it with real people, and present it.

Goals

By the end of this session you can:

  • Add input checks and clear labels to an AI app
  • Run a simple user test and record what you learned
  • Explain three responsibilities of an AI app builder: honesty, safety and privacy
  • Present your finished app in a two-minute demo

Words to know

validation
Checking that input is acceptable before using it.
guardrail
A rule or check that keeps an app from doing something unsafe or unhelpful.
user test
Watching a real person try your app, without helping, to find what is confusing.
disclosure
Telling users clearly that an answer was written by AI.

The lesson

Step 1: Check what comes in

Your app will meet users who type things you never imagined: nothing at all, a whole paragraph, a single symbol. Validation checks input before using it.

Python
def check_word(word):
    word = word.strip()
    if not word:
        return None, "Please type a word."
    if len(word) > 40:
        return None, "That's too long. Please use a shorter word."
    return word, None

for test in ["gravity", "   ", "x" * 50]:
    cleaned, problem = check_word(test)
    print(repr(test[:12]), "->", cleaned if cleaned else problem)
Output
'gravity' -> gravity
'   ' -> Please type a word.
'xxxxxxxxxxxx' -> That's too long. Please use a shorter word.

The function returns two things: the cleaned word, or a friendly message about the problem.

Step 2: Be honest about AI

People should know when they are reading something an AI wrote, and that it can be wrong. Add a short line to every answer.

Python
def show_answer(text):
    print(text)
    print("AI-generated. Check important facts.")

show_answer("Gravity is the pull that makes things fall.")
Output
Gravity is the pull that makes things fall.
AI-generated. Check important facts.

Other guardrails you can add:

  • A list of topics your app will and won’t help with.
  • A rule that the app doesn’t store names or other personal data.
  • A fallback message when the model fails.

Step 3: Test with real people

You know how your app is supposed to work, so you can’t see where it confuses people. A user test shows you.

  1. Ask someone who hasn’t seen your app to try it.
  2. Give them a goal (“find out what photosynthesis means”) and say nothing else.
  3. Watch and take notes. Where did they pause? What did they type that you didn’t expect?
  4. Don’t explain. If they get stuck, that’s the finding.
  5. Thank them and ask: What was confusing? What would you change?

Step 4: Fix, then fix again

After two or three tests, you’ll see the same problems repeat. Fix the biggest one first. Then test again with someone new.

What you sawWhat you might change
They typed a whole sentenceAdd an example: Type one word, like "gravity"
They didn’t know it had finishedPrint a clear “Answer:” line
They typed in capitals and got no answerUse .lower()

Step 5: Responsibilities of a builder

You are now someone who builds software that others rely on. Three habits will serve you well:

  1. Honesty. Say what your app is, that AI is involved, and what it can’t do.
  2. Safety. Expect mistakes and misuse. Add checks, and don’t ship what you wouldn’t want a younger sibling to use.
  3. Privacy. Collect only what you need, and never share people’s information.

For Demo Day, present your app in two minutes: the problem you solved, a live demo, one problem you found in testing, and one thing you’d do next. Whatever you build next, you now know how.

Exercise

Break your own app

  1. Write down 5 ways a user could use your app badly or by mistake: empty input, a very long word, numbers only, rude language, a request that is off-topic.
  2. Try each one. What happens?
  3. For every problem, add a check or a friendly message.
  4. Ask a partner to find one more way to break it.
Need a hint?

Use if not word.strip(): for empty input and len(word) > 40 for too long.

Small project

Demo day: launch your Study helper

Finish your Study helper (or your own app idea from Session 1), test it with two people, and present it in a two-minute demo.

  1. Add validation: reject empty or very long input, and show a friendly message.
  2. Add a disclosure line to every answer: AI-generated. Check important facts.
  3. Run a user test with two classmates. Watch them without helping. Write down where they hesitated.
  4. Fix the biggest problem you saw.
  5. Prepare a two-minute demo: the problem, a live run, one thing that went wrong in testing, and one improvement you'd make next.

Stretch it: Write a short README for your app: what it does, how to run it and what it can't do.

Quiz

Check your understanding

Pick one answer for each question. Your score appears right in the page; nothing is sent anywhere.

  1. Question 1What is input validation?
  2. Question 2Why tell users an answer was AI-generated?
  3. Question 3In a user test, what should you do while the person uses your app?
  4. Question 4Which of these should an app avoid collecting?
  5. Question 5Your app gives a wrong fact. What is the most responsible response?