Back to the curriculum

L1-M01 · Level 1 · ~18 h

AI and LLM Fundamentals for QA

What you build: LLM concept map and first test scenarios

lessons
5
lesson hours (estimate)
≈ 11 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-M01-L01≈ 2.5 hVideo

    What is an LLM? Next-token prediction for testers

    What you build: Runs a toy next-word model and explains why fluent output can be false

    Key terms (9)
    • Large Language Model (LLM)Mô hình ngôn ngữ lớn
    • Next-token predictionDự đoán token tiếp theo
    • ParameterTham số của mô hình
    • Pretraining / Fine-tuningHuấn luyện trước / Tinh chỉnh
    • RLHFHọc tăng cường từ phản hồi của con người
    • Confabulation / HallucinationTạo ra nội dung sai một cách tự tin
    • Greedy decoding / SamplingLuôn chọn khả năng cao nhất / Bốc ngẫu nhiên theo xác suất
    • OracleCơ chế quyết định một test pass hay fail
    • Characterization testTest ghi lại hành vi hiện tại của hệ thống
  2. Lesson 2 · L1-M01-L02≈ 2 hVideo

    Tokens and the context window

    What you build: Computes a context budget and tests history trimming

    Needs: L1-M01-L01

    Key terms (6)
    • Token / TokenizerMảnh văn bản mô hình xử lý / Bộ tách văn bản thành token
    • SubwordMột phần của từ
    • Context windowGiới hạn tổng lượng token mô hình xử lý trong một request
    • Context rotHiện tượng chất lượng giảm khi context quá dài
    • History trimmingCắt bớt lịch sử hội thoại
    • Dependency injectionTruyền một thành phần (ví dụ hàm đếm token) từ bên ngoài vào để dễ test
  3. Lesson 3 · L1-M01-L03≈ 2 hVideo

    Sampling, temperature and non-determinism

    What you build: Measures repeat-run consistency of a toy sampler

    Needs: L1-M01-L01

    Key terms (8)
    • LogitĐiểm số thô của token trước khi chuyển thành xác suất
    • SoftmaxHàm chuyển điểm số thành xác suất có tổng bằng 1
    • TemperatureTham số điều chỉnh độ ngẫu nhiên
    • Non-determinismCùng input nhưng output có thể khác nhau
    • Repeat-run testChạy lặp cùng một input để đo độ ổn định
    • Mode rateTỷ lệ của output xuất hiện nhiều nhất
    • Quality gateĐiều kiện phải đạt trước khi release
    • Flaky testTest lúc pass lúc fail mà không có thay đổi
  4. Lesson 4 · L1-M01-L04≈ 2 hVideo

    Anatomy of an LLM application: request, response, stop reason

    What you build: Normalises two providers' response JSON and detects truncation and refusal

    Needs: L1-M01-L02, L1-M01-L03

    Key terms (8)
    • Request / ResponseYêu cầu gửi đi / Phản hồi nhận về
    • System promptChỉ dẫn của nhà phát triển, đặt trước hội thoại
    • Stop reason / Finish reasonLý do model dừng sinh output
    • UsageSố token đã dùng
    • FixtureDữ liệu mẫu cố định dùng trong test. Lưu ý: trong pytest, `@pytest.fixture` là **hàm** chuẩn bị dữ liệu hoặc đối tượng cho test, khác nghĩa với file fixture JSON ở bài này
    • RefusalModel từ chối trả lời
    • Contract testTest kiểm tra hai bên tuân thủ cùng một "hợp đồng" dữ liệu
    • TruncatedBị cắt cụt
  5. Lesson 5 · L1-M01-L05≈ 2.5 hVideo

    LLM failure modes and a first test scenario

    What you build: Writes data-driven scenarios that catch seeded defects in a mock bot

    Needs: L1-M01-L01, L1-M01-L02, L1-M01-L03, L1-M01-L04

    Key terms (9)
    • Failure modeKiểu lỗi
    • Prompt injection (direct/indirect)Input làm model đổi hành vi ngoài ý muốn của nhà phát triển (trực tiếp/gián tiếp)
    • Format driftOutput lệch định dạng
    • OracleCơ chế quyết định pass/fail
    • HeuristicQuy tắc gần đúng
    • Reference answerĐáp án tham chiếu
    • Data-driven testTest lấy dữ liệu từ file bên ngoài
    • Seeded defectLỗi được cố ý cài vào để kiểm tra bộ test
    • Human reviewĐánh giá bởi con người

A. Module overview

Field Value
Module ID L1-M01
Level 1 - AI QA Engineer
Description How an LLM generates text (next-token prediction, tokens, context window, sampling), the request/response structure of an LLM API, and the main failure modes, taught from a tester's point of view. The module ends with a first set of test scenarios that runs with pytest.
Why this module matters To design tests for a system, you have to know the ways it fails. Every LLM failure mode has a specific technical cause. A tester who understands the cause can predict defects instead of just trying things at random.
Target professional competencies Level 1: "LLM fundamentals and limitations"; "Non-deterministic behavior testing" (introduction); "Basic AI security and prompt-injection awareness" (introduction).
Estimated duration ~11 hours for 5 lessons, including independent exercises (150 + 120 + 120 + 120 + 150 minutes) + ~6 hours of module assignment + 0.5 hours of quiz ≈ 18 hours for someone who has not written Python. This is the reviewer's estimate, not yet measured with real learners; people who already know Python may be much faster
Prerequisites Able to write test cases. Basic terminal use. No prior Python needed: L01 has a "Minimal Python for testers" section, and every exercise has a starter file (code-labs/l1-m01/exercises/). No AI or API key needed.
Module output LLM concept map + a first set of test scenarios + a defect report (ShopEasy assignment)
Cost 0 VND. All labs run offline with mocks and a toy model

B. Learning objectives

After this module, the learner can:

ID Objective
MO1 Explain the next-token prediction mechanism and why it leads to confabulation.
MO2 Calculate a context budget and design tests for conversation history trimming.
MO3 Measure output stability across multiple runs and report it with numbers.
MO4 Read response JSON from two providers and verify stop reason, refusal and usage.
MO5 Classify six failure modes and choose a suitable oracle for each requirement.
MO6 Implement data-driven test scenarios with pytest and write a defect report for AI.

C. Lessons

ID Lesson Duration Prerequisites Concepts Hands-on output
L1-M01-L01 What is an LLM? Next-token prediction for testers 150' - language model, parameter, Transformer, pretraining, fine-tuning, RLHF, greedy, sampling, confabulation Run a bigram model; a test that records fluent but wrong output
L1-M01-L02 Tokens and the context window 120' L01 token, tokenizer, subword, byte fallback, context window, context rot, history trimming Calculate a budget; a test that history trimming keeps the system prompt
L1-M01-L03 Sampling, temperature and non-determinism 120' L01 logit, softmax, temperature, non-determinism, repeat-run, mode rate, quality gate Repeat-run test and stability gate
L1-M01-L04 Anatomy of an LLM application: request, response, stop reason 120' L02, L03 system prompt, messages, content block, stop/finish reason, usage, refusal, fixture A two-provider parser and QA checks
L1-M01-L05 LLM failure modes and a first test scenario 150' L01-L04 F1-F6, direct/indirect prompt injection, oracle, data-driven test, seeded defect JSON scenario set, defect detection table

D. Hands-on assignment (module assignment)

ShopEasy order-support bot (fictional): the learner black-box tests a mock customer-support chatbot with seeded defects. The learner builds a concept map, designs at least 12 risk-based scenarios, automates them with pytest, and writes a defect report. Details, rubric and acceptance criteria are in exercises.md.

E. Module assessment

Component Weight Content File
Knowledge quiz 20% 12 questions: multiple choice, true/false, short answer, scenario quiz.md
Practical assignment 40% Rubric: Test design + Implementation exercises.md
Applied QA analysis 20% Rubric: Conceptual understanding (concept map) + Analysis (defects found) exercises.md
Review/reflection 20% Rubric: Reporting (defect report, recommendations) + Reflection exercises.md

Formula: module score = 0.2 × quiz% + 0.8 × assignment rubric score (out of 100). The assignment rubric is weighted 50 / 25 / 25 to match the 40 / 20 / 20 split above.

Weights follow the suggestion in the brief (section 6.2) and are configurable.

Module pass conditions:

  1. Quiz ≥ 70%.
  2. The assignment meets every mandatory acceptance criterion.
  3. Total score ≥ 70%.

Passing the quiz alone does not pass the module. Common mistakes are listed in the instructor guide.

F. References

See references.md.

Objective ↔ assessment matrix

Objective Lesson Module quiz End-of-lesson questions Assignment
MO1 L01 Q1, Q6, Q9 L01 Q1-Q5 Concept map
MO2 L02 Q2, Q10 L02 Q1-Q5 Context scenario (optional)
MO3 L03 Q3, Q7 L03 Q1-Q5 Reflection on stability
MO4 L04 Q4, Q8 L04 Q1-Q5 Format/crash checks
MO5 L05 Q5, Q11 L05 Q1-Q5 Risk and oracle columns of the scenarios
MO6 L05 Q12 L05 independent exercise Test suite + defect report