Course map
Stage 1: Foundations
Stage 2: Data Integration
Stage 3: Building & Shipping
Stage 4: Customer Engagement
Stage 5: Specialization

Part 14 / Stage 4

Proofs of concept and demos

Goal: Show value quickly and safely: POCs that test the riskiest assumption against agreed go/no-go criteria, and demos that are rehearsed, smoke-tested, and told as the customer's story. Time: ~2.5 hours · Needs: Python 3.14+, the course venv

What you will learn

  • Designing a POC around the riskiest assumption
  • Go / no-go criteria agreed before building
  • Demo data: seeded, realistic, never confidential
  • Demo scripts and smoke tests
  • Running the demo as the customer's story
  • When things break: fallbacks and honest recovery

Topics in this part

Practice

Work in the course venv. Check each answer by running it; compare with solutions/ only after trying.

Exercise 1: A POC verdict function

Write verdict(accuracy, go=0.8, stop=0.6) returning "go", "no-go" or "iterate once". Print the verdict for 0.85, 0.55 and 0.7 — and make the thresholds arguments, because they were agreed with the customer, not hard-coded by you.

Show the solution to Exercise 1
# Exercise 1: the verdict was agreed before the build
def verdict(accuracy, go=0.8, stop=0.6):
    if accuracy >= go:
        return "go"
    if accuracy < stop:
        return "no-go"
    return "iterate once"

for acc in (0.85, 0.55, 0.7):
    print(f"accuracy {acc:.2f} -> {verdict(acc)}")

Exercise 2: Craft the distribution

Extend demo_shipments so exactly one shipment is always delayed and it is always S-3002 (the one you click in the demo). Keep everything else seeded-random. Prove it over three runs.

Show the solution to Exercise 2
# Exercise 2: the story needs its delayed shipment in the same place
import random

def demo_shipments(n, seed=2025):
    rng = random.Random(seed)
    cities = ["Mumbai", "Pune", "Delhi", "Jaipur", "Chennai", "Bengaluru"]
    rows = []
    for i in range(n):
        origin, dest = rng.sample(cities, 2)
        sid = f"S-{3000 + i}"
        status = "delayed" if sid == "S-3002" else rng.choice(["delivered", "in_transit"])
        rows.append({"id": sid, "route": f"{origin} -> {dest}", "status": status})
    return rows

runs = [demo_shipments(5) for _ in range(3)]
assert runs[0] == runs[1] == runs[2]
delayed = [r["id"] for r in runs[0] if r["status"] == "delayed"]
print("delayed every run:", delayed)
assert delayed == ["S-3002"]
print("rows:", runs[0])

Exercise 3: A smoke test that fails usefully

Break the lesson's demo app (make /summary return 2 delays) and show the smoke test catching it with DO NOT DEMO. Then fix it and show ready to demo. The failure message should say which step and what was expected.

Show the solution to Exercise 3
# Exercise 3: a smoke test that names the broken step
from fastapi import FastAPI
from fastapi.testclient import TestClient

def build_app(delayed_count):
    app = FastAPI()
    @app.get("/summary")
    def summary():
        return {"delayed": delayed_count}
    return app

STEPS = [("Daily summary shows 1 delay", "/summary", lambda j: j["delayed"] == 1, "delayed == 1")]

def smoke(app):
    client, ok = TestClient(app), True
    for say, path, check, expected in STEPS:
        j = client.get(path).json()
        passed = check(j)
        ok &= passed
        print(f"[{'PASS' if passed else 'FAIL'}] {say}" + ("" if passed else f" - expected {expected}, got {j}"))
    print("ready to demo" if ok else "DO NOT DEMO: fix failures first")

print("broken app:")
smoke(build_app(2))
print("\nfixed app:")
smoke(build_app(1))

Exercise 4: The fallback plan as data

Model the demo script as a list of steps each with a fallback field ("recording at 02:10", "second environment", "skip and narrate"). Write fallback_plan(steps) that prints the what-if-it-breaks table you would keep beside your laptop.


Show the solution to Exercise 4
# Exercise 4: the what-if-it-breaks table
STEPS = [
    {"step": "Open dashboard with last night's sync", "fallback": "recording at 00:30"},
    {"step": "Click the delayed shipment S-3002", "fallback": "second environment (warm)"},
    {"step": "Show the automatic email reply", "fallback": "recording at 02:10"},
    {"step": "Live status update via the API", "fallback": "skip and narrate; show after the meeting"},
]

def fallback_plan(steps):
    print(f"{'If this step breaks':45s} | Do this")
    print("-" * 75)
    for s in steps:
        print(f"{s['step']:45s} | {s['fallback']}")

fallback_plan(STEPS)

Mini-project: The Acme demo kit

One script: seeded demo data (with the crafted delayed shipment), a 5-step demo script in story form (say/do pairs), and the smoke test that runs every step and prints the verdict. This is what you run twenty minutes before the week-4 demo.

A solution is in solutions/mini_acme_demo_kit.py.

Stretch: record a fallback video of the happy path and write the 'what if it breaks' plan for each step.

Common mistakes

Mistake Why it hurts Fix
POC = mini product Weeks spent; the risky assumption still untested One assumption, cheapest test, hard end
Verdict criteria set after the result Goalpost arguments; zombie workstreams Go/no-go numbers agreed before building
Demoing on real data Confidentiality incident + ragged story Seeded generator, crafted distribution
No smoke test The environment rotted since rehearsal Executable script-check before every demo
Feature tours The room checks their phones The customer's story, their people, their numbers
Winging a failure Panic reads as incompetence Named fallback per critical step; honest recovery

Quick recap

  • A POC is an experiment on the riskiest assumption, not a draft of the product.
  • Agree the go/no-go numbers before building; a clean no-go is a win.
  • Demo data is seeded, realistic and free of anything confidential, and it tells the same story every run.
  • The smoke test is the demo script made executable, and it runs before the meeting.
  • The demo tells the customer's story and ends on the success criteria; collect objections while you have the room.
  • Handling breakage plainly, with a fallback ready, earns more trust than a flawless run.

Checklist

  • I can name Acme's riskiest assumption and the two-day test for it.
  • I wrote go/no-go numbers for that POC.
  • I generated seeded demo data twice and got identical rows.
  • I ran the smoke test and saw "ready to demo".
  • I drafted a five-step demo script in story form.

Read more: FastAPI testing · Python random

Search the guide