Lesson 7 of 12 advanced

Evaluation beyond green unit tests

AI-এর উত্তর সুন্দর হলেই ঠিক না। আগে expected result বানাও, তারপর আলাদা test case-এ যাচাই করো।

Guess first

Pick an answer. You will see if you were right at the end of the lesson.

Can the same misunderstanding affect generation and grading?

Open interactive version (quiz + challenge)

Real-world analogy

Practising the same exam answer is different from solving a new question under the same rules.

What is it?

An evaluation compares outputs against a defined rubric. Unit tests check deterministic behaviour; integration tests check boundaries; model evaluations check task quality and safety on varied inputs. Keep a holdout set that did not guide prompt editing.

Real-world relevance

One shared support-ticket product, three optional entry points. Frontend: Evaluate a form with keyboard-only input, invalid values and delayed responses. Backend: Evaluate wrong-owner requests, malformed input and duplicate writes. Mobile: Evaluate reconnect, process restart, denied permissions and low-connectivity behaviour.

Key points

Quick check

Answer from memory — scrolling up first makes it stick less.

What artifact demonstrates this lesson?

Which statement is defensible?

Code example

cases = [
 {"text": "App crashes on save", "expected": "bug"},
 {"text": "No crash, need a receipt", "expected": "review"},
]
def evaluate(classify):
    results = [(c["text"], classify(c["text"]) == c["expected"]) for c in cases]
    return {"passed": sum(ok for _, ok in results),
            "total": len(results), "details": results}

Line-by-line walkthrough

  1. 1. Python: these are labelled synthetic fixtures, not measured product results. The report keeps case details so failures can be inspected. Add safety and ownership checks separately.

Spot the bug

Use the model to grade itself, then ship if it says perfect
Need a hint?
Can the same misunderstanding affect generation and grading?
Show answer
Use independent expected outcomes, deterministic checks and human review for ambiguous cases.

Explain like I'm 5

AI-এর উত্তর সুন্দর হলেই ঠিক না। আগে expected result বানাও, তারপর আলাদা test case-এ যাচাই করো।

Fun fact

A useful artifact for this lesson: One evaluation case includes input, permitted data, expected behaviour and failure criteria.

Hands-on challenge

Choose ONE stack; you do not need to build all three. Junior foundation: Write expected outcomes for five synthetic cases before evaluating them. Senior extension: Reserve holdout cases, repeat trials and report failure categories and uncertainty. Evidence: save the input, expected behaviour, actual result and one failure or limitation. Junior means basic coding and Git, not zero programming experience.

More resources

Open interactive version (quiz + challenge) Download the whole course as PDF / Word

Lock it in

← Back to course: AI-Assisted Software Engineering