Back to the curriculum

L1-M04 · Level 1 · ~32 h

AI Functional and Negative Testing

What you build: Functional and negative test pack

lessons
5
lesson hours (estimate)
≈ 15.5 h
lessons with a public video
5/5
0/5 lessons marked done · Progress is saved in this browser only. No account, nothing is sent to a server.
In review. The curriculum, module overviews and Levels 1–3 lessons are drafts written with AI assistance and reviewed by AI. Human review is still pending. English translation: AI-assisted, not human-reviewed.

Levels 1–3 lessons, exercises and quizzes are published as drafts, in Vietnamese with an AI-assisted English translation. They may change after human review.

Module path

  1. Lesson 1 · L1-M04-L01≈ 3 hVideo

    Test oracles for LLM features

    What you build: Chooses an oracle per requirement (exact, rule, reference, human)

    Needs: L1-M02-L02, L1-M03-L05

    Key terms (5)
    • Test oracleCơ chế quyết định output đúng hay sai
    • Exact / rule / reference / human oracleOracle so khớp chính xác / tính chất / dữ kiện tham chiếu / người chấm
    • False pass / false failCho qua nhầm / đánh rớt nhầm
    • Product contractHợp đồng hành vi của sản phẩm
    • VerdictKết luận của test (PASS/FAIL/REVIEW)
  2. Lesson 2 · L1-M04-L02≈ 3.5 hVideo

    Negative and boundary inputs (empty, very long, mixed language, malformed)

    What you build: Boundary pack for a chatbot

    Needs: L1-M04-L01

    Key terms (7)
    • Equivalence partitioningPhân vùng tương đương
    • Boundary value analysisPhân tích giá trị biên
    • Off-by-oneLỗi lệch một
    • Normalization (NFC/NFD)Chuẩn hóa Unicode (dạng dựng sẵn / dạng tách)
    • Zero-width characterKý tự độ rộng bằng 0 (vô hình)
    • Code-switchingTrộn ngôn ngữ trong một câu
    • Issue (vs bug)Câu hỏi/vấn đề cần làm rõ (khác với lỗi)
  3. Lesson 3 · L1-M04-L03≈ 3 hVideo

    Exploratory testing charters for AI features

    What you build: Runs and documents a session-based charter

    Needs: L1-M04-L02

    Key terms (7)
    • Exploratory testingKiểm thử khám phá
    • Session-Based Test Management (SBTM)Quản lý kiểm thử theo phiên
    • CharterNhiệm vụ của phiên test
    • Time boxKhung thời gian cố định
    • Task breakdown (test/bug/setup)Phân bổ thời gian trong phiên
    • OpportunityThời gian đi theo hướng ngoài charter
    • DebriefBuổi trao đổi sau phiên
  4. Lesson 4 · L1-M04-L04≈ 3.5 hVideo

    Prompt injection for testers (direct and indirect)

    What you build: Injection test cases mapped to OWASP LLM01

    Needs: L1-M04-L03

    Key terms (7)
    • Prompt injection (direct / indirect)Chèn chỉ dẫn (trực tiếp / gián tiếp)
    • System prompt leakageLộ system prompt
    • CanaryChuỗi đánh dấu cài vào để phát hiện rò rỉ
    • Deny-list / allowlistDanh sách chặn / danh sách cho phép
    • Payload splittingTách câu tấn công thành nhiều phần
    • Defence in depthPhòng thủ nhiều lớp
    • Red-teamingTấn công thử có chủ đích để tìm điểm yếu
  5. Lesson 5 · L1-M04-L05≈ 3.5 hVideo

    Refusal, safety and bias behaviour (over- and under-refusal)

    What you build: Refusal test set with expected behaviour per policy

    Needs: L1-M04-L04

    Key terms (7)
    • Over-refusal / exaggerated safetyTừ chối quá mức
    • Under-refusalTừ chối thiếu
    • Contrast pairCặp đối chứng
    • Refusal setBộ case kiểm tra hành vi từ chối
    • Counterfactual testingTest đổi một thuộc tính
    • BiasThiên lệch
    • HandoffChuyển nhân viên

A. Module overview

Field Value
Module ID L1-M04
Level 1 - AI QA Engineer
Description Functional and negative testing for an AI assistant: choosing oracles; boundary input and Vietnamese Unicode; session-based exploratory testing; direct and indirect prompt injection, mapped to OWASP LLM01/LLM07; refusal behavior and counterfactual testing. The product under test is ShopEasy Assistant (fictional, rule-based simulation), running offline.
Why this module matters Negative and injection testing is what product teams most often skip, and it has the biggest consequences when it goes wrong: data leaks, phishing links, abandoning customers who need help.
Target professional competencies Level 1: "Negative, boundary and injection testing", "Risk-based test design", "Report AI defects".
Estimated duration 5 lessons (165 + 195 + 165 + 195 + 195 minutes) ≈ 15 hours + module assignment ~16 hours + quiz 0.5 hours ≈ 32 hours for someone new to Python. Estimate, not yet measured with real learners.
Prerequisites L1-M01, L1-M02, L1-M03. No API key needed.
Module output Functional and negative test pack for ShopEasy Assistant v2, including injection cases mapped to OWASP
Cost 0 VND

B. Learning objectives

ID Objective
MO1 Choose and verify an oracle (exact, rule, reference, human) for each contract clause.
MO2 Design a boundary pack using equivalence partitioning, boundary values and Unicode normalization.
MO3 Run and report a charter-based exploratory testing session.
MO4 Design prompt injection cases by technique, map them to OWASP, and check consequences.
MO5 Measure over-refusal and under-refusal, and apply counterfactual testing.

C. Lessons

ID Lesson Duration Prerequisites Concepts Hands-on output
L1-M04-L01 Test oracles for LLM features 165' L1-M02-L02, L1-M03-L05 oracle problem, 4 oracle types, false pass/fail A verified oracle for each clause
L1-M04-L02 Negative and boundary input 195' L01 equivalence partitioning, boundary values, NFC/NFD, invisible characters Boundary pack
L1-M04-L03 Exploratory testing charter 165' L02 session, charter, session sheet, debrief Session sheet + one automated test
L1-M04-L04 Prompt injection for testers 195' L03 direct/indirect, canary, consequence-based oracle, defense in depth Injection cases mapped to OWASP
L1-M04-L05 Refusal, safety and bias 195' L04 over-/under-refusal, control pairs, counterfactual Refusal set + two rates

D. Hands-on assignment (module assignment)

Functional and negative test pack for ShopEasy Assistant v2 (fictional). The team says v2 has fixed the bugs of v1. The learner verifies that against contract C1-C12, finds new defects, and reports them. Details in exercises.md.

E. Module assessment

Component Weight Content
Knowledge quiz 20% quiz.md: 12 questions, 20 points
Practical assignment 40% Rubric: Test design + Implementation
Applied QA analysis 20% Rubric: Oracle matrix + Defect analysis
Review/reflection 20% Rubric: Reporting + Reflection

Formula: module score = 0.2 × quiz% + 0.8 × assignment rubric score (out of 100). Pass conditions: quiz ≥ 70% and every mandatory acceptance criterion and total ≥ 70%.

F. References

See references.md.

Objective ↔ assessment matrix

Objective Lesson Module quiz Assignment
MO1 L01 Q1, Q8 Oracle matrix; AC1
MO2 L02 Q2, Q6 Boundary pack; D1-D4
MO3 L03 Q5 Exploratory session
MO4 L04 Q3, Q7, Q9, Q12 Injection cases; AC2; D5, D6
MO5 L05 Q4, Q10, Q11 Refusal set, counterfactual; AC3; D7-D9