Back to the curriculum

L1-M02 · Level 1 · ~24 h

Prompt Engineering and Instruction Testing

What you build: Prompt test matrix

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

    Anatomy of a prompt: system, instructions, examples, context, input

    What you build: Unit tests for prompt assembly (tags, escaping, variables)

    Needs: L1-M01-L04, L1-M01-L05

    Key terms (7)
    • Prompt templateMẫu prompt có chỗ trống để điền dữ liệu
    • RenderLắp ráp template với dữ liệu thành prompt hoàn chỉnh
    • Few-shot / multishot examplesVí dụ mẫu đưa vào prompt
    • Delimiter / tagKý hiệu đánh dấu ranh giới giữa các phần
    • EscapeThay ký tự đặc biệt để nó không được hiểu như cấu trúc
    • Untrusted inputDữ liệu không tin cậy (do người dùng hoặc bên thứ ba tạo ra)
    • `conftest.py`File chứa fixture pytest dùng chung cho cả thư mục
  2. Lesson 2 · L1-M02-L02≈ 2.5 hVideo

    From instructions to verifiable acceptance criteria

    What you build: Requirement table with oracles, traceability and coverage

    Needs: L1-M02-L01

    Key terms (6)
    • Atomic requirementYêu cầu nguyên tử (chỉ nói một điều)
    • Acceptance criteriaTiêu chí chấp nhận
    • TraceabilityKhả năng truy vết giữa yêu cầu và test
    • Requirement coverageĐộ bao phủ theo yêu cầu
    • RegistryBảng tra cứu tên → hàm
    • Fail closedKhi không chắc, coi là lỗi thay vì coi là đạt
  3. Lesson 3 · L1-M02-L03≈ 2.5 hVideo

    Designing a prompt test matrix: partition, boundary and pairwise

    What you build: Pairwise matrix with per-partition oracles

    Needs: L1-M02-L02

    Key terms (7)
    • Factor / valueYếu tố / giá trị của yếu tố
    • Equivalence partitioningPhân vùng tương đương
    • Boundary valueGiá trị biên
    • CombinationTổ hợp đầy đủ
    • Pairwise / all-pairs testingKiểm thử theo cặp
    • Combinatorial explosionBùng nổ tổ hợp
    • Test matrixBảng tổ hợp test
  4. Lesson 4 · L1-M02-L04≈ 3 hVideo

    Prompt sensitivity: one small change, a different result

    What you build: One-change-at-a-time variants; finds a test-suite gap

    Needs: L1-M02-L02, L1-M02-L03

    Key terms (6)
    • Prompt sensitivityĐộ nhạy của output theo thay đổi của prompt
    • AblationBỏ từng thành phần để xem ảnh hưởng
    • ParaphraseViết lại cùng ý bằng câu khác
    • Load-bearing instructionChỉ dẫn chịu lực (bỏ đi thì hành vi hỏng)
    • Mutation testingKiểm thử đột biến: cố ý làm hỏng để đo bộ test
    • Frozen dataclassĐối tượng không sửa được sau khi tạo
  5. Lesson 5 · L1-M02-L05≈ 2.5 hVideo

    Prompt versioning and change review

    What you build: Change review with fixed/broken classification

    Needs: L1-M02-L04

    Key terms (7)
    • VersioningQuản lý phiên bản
    • Change requestYêu cầu thay đổi
    • Change reviewĐánh giá thay đổi trước khi chấp nhận
    • RegressionLỗi mới xuất hiện ở thứ trước đây chạy đúng
    • MaskingMột lỗi che khuất lỗi khác
    • Pin a model snapshotCố định một phiên bản model cụ thể
    • DiffPhần khác nhau giữa hai phiên bản

A. Module overview

Field Value
Module ID L1-M02
Level 1 - AI QA Engineer
Description A prompt is treated as a versioned artifact and as a specification written in natural language. The learner learns to unit-test prompt assembly, break instructions down into verifiable requirements, design a prompt test matrix (partition and pairwise), measure prompt sensitivity, and review a prompt change.
Why this module matters A prompt change can change product behavior without changing a single line of code. A team without a prompt testing process will release regressions without knowing it.
Target professional competencies Level 1: "Prompt and instruction testing"; "Prompt and model regression testing" (prompt part); foundation for "Functional, negative, boundary, and exploratory testing".
Estimated duration 5 lessons (150 + 150 + 150 + 180 + 150 minutes) ≈ 13 hours + module assignment ~10 hours + quiz 0.5 hours ≈ 24 hours for someone new to Python. Reviewer's estimate, not yet measured with real learners.
Prerequisites L1-M01. No API key needed.
Module output Prompt test matrix, with requirement traceability and a change review (ShopEasy assignment)
Cost 0 VND. All labs use a simulated model and run offline

About the simulated models: SimulatedTutor and SimulatedSummarizer react to phrases in the prompt, so that the learner can observe offline the behaviors that provider documentation describes. Real models do not work by keywords. The process taught in this module applies to real models; the numbers do not. From L1-M03, the learner runs the same process against a real model.

B. Learning objectives

ID Objective
MO1 Identify the components of a prompt and verify prompt assembly with unit tests.
MO2 Decompose instructions into atomic requirements with oracles, and measure requirement coverage.
MO3 Design a prompt test matrix using partition and pairwise, with per-partition oracles.
MO4 Measure prompt sensitivity with controlled variants, and detect gaps in the test suite.
MO5 Perform a change review between two prompt versions and write an evidence-based recommendation.

C. Lessons

ID Lesson Duration Prerequisites Concepts Hands-on output
L1-M02-L01 Anatomy of a prompt 150' L1-M01-L04, L1-M01-L05 system, instructions, examples, context, input; tags and escaping; assembly defects vs behavior defects Unit tests for a prompt template
L1-M02-L02 From instructions to acceptance criteria 150' L01 atomic requirement, oracle, traceability, coverage, fail closed A test suite with traceability
L1-M02-L03 Designing a prompt test matrix 150' L02 factor, partition, combination, pairwise, per-partition oracle A runnable pairwise matrix
L1-M02-L04 Prompt sensitivity 180' L02, L03 ablation, paraphrase, examples overriding instructions, mutation testing Sensitivity table, stronger oracles
L1-M02-L05 Prompt versioning and change review 150' L04 version, model pinning, fixed/broken, masking Change review

D. Hands-on assignment (module assignment)

Change review for the customer-support ticket summarizer prompt of ShopEasy (fictional). The learner receives the product contract, the v1 prompt currently in production, and a v2 change request. Task: extract requirements, build a prompt test matrix, run both versions, then write a change review with a recommendation. 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: Requirement analysis + Change analysis
Review/reflection 20% Rubric: Reporting + Reflection

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

Pass conditions: quiz ≥ 70% and the assignment meets every mandatory acceptance criterion and total ≥ 70%.

F. References

See references.md.

Objective ↔ assessment matrix

Objective Lesson Module quiz Assignment
MO1 L01 Q1, Q6, Q9 Assembly checks (optional)
MO2 L02 Q2, Q7, Q10 Requirement table + traceability
MO3 L03 Q3, Q11 Prompt test matrix
MO4 L04 Q4, Q8 Analysis of instruction changes
MO5 L05 Q5, Q12 Change review