CI, reporting, defence and self-assessment

Study time
≈ 8 h (estimate)
Needs
L1-M08-L03
Updated
2026-11-06

Progress is saved in this browser only. No account, nothing is sent to a server.

Draft · reviewed by AI, not yet by a person. Content may change. English translation: AI-assisted, not human-reviewed.
On this page

Module: L1-M08 (capstone), milestone 4 · Duration: ~8 hours (estimate) · Previous: Milestone 3 - Test suites: functional, negative, schema, injection, tool calls, conversation regression, one Playwright UI flow · After the capstone: Level 2

1. Introduction

Evidence is only valuable when the person who decides can read it. The last milestone turns the results of milestone 3 into four things: a CI workflow that runs, a readable report, a reasoned release recommendation, and a defence session where you answer questions about the limits of your own framework. You finish by scoring yourself against the rubric, with evidence.

2. Objectives

  1. Set up CI for the framework: offline automatically, slow on a schedule or run by hand, no automatic step that costs money.
  2. Produce a JUnit report and a summary for both builds, and a regression report with a human verdict.
  3. Write a release recommendation based on risk, with conditions and actions.
  4. Defend the results against questions about the oracles, power, simulation and scope.
  5. Assess yourself against the rubric, pointing out the real weaknesses of the framework.

3. What you need

  • The test suite and the defect reports of milestone 3.

4. The parts of milestone 4

4.1 CI

Reuse the workflow of L1-M07-L04 and adjust it:

Job When Suggested command
unit + suite (offline, not slow) Every pull request and push to main python -m pytest -m "not slow and not ui" with TARGET_BUILD=stable, then rc
ui As above python -m pytest -m ui for both builds
slow (repeat-run) On a schedule or run by hand python -m pytest -m slow
live (if the framework has it) Run by hand only, with an approver and a budget As in L1-M07-L04

Run against both builds: a matrix with two values of TARGET_BUILD is the most compact way. The job with rc will be red, because that is the evidence. Say so clearly in the README, so that the reader does not think CI is broken.

Everyday example. A shop checks the goods on its shelves and a newly delivered batch with the same procedure. If the new batch has dented boxes, the check sheet of that batch is red; nobody switches off the check of new goods to keep the sheet green. The red rc job is the check sheet of the new batch.

Good vs bad.

Weak Good
The rc job is switched off or set to continue-on-error without explanation, to keep the CI badge green The rc job runs and is red; the README says why it is red and points to the defect reports
The live job runs on every push "to be safe" The live job runs by hand only, with an approver and a budget

If you do not have a GitHub account, rerun the workflow's commands on your machine and write "not run on GitHub" (L1-M07-L04 section 5.1).

4.2 Report

  • JUnit and a summary for each build (L1-M07-L04).
  • A regression report stable → rc, following the structure of L1-M06-L05: the configuration of both sides, results by clause, the human verdict (product defect, oracle defect, data defect, flaky from before, environment), and sample output.
  • A defect report for each defect of rc (from milestone 3).

Worked example: read a report before you conclude. The file exercises/data/m4_demo_b.xml is a real pytest JUnit file from a fictional demo suite (build demo, not stable or rc). From the capstone folder, run the report.py of aiqa (L1-M07-L04) on it:

python ../../code-labs/l1-m07/report.py exercises/data/m4_demo_b.xml

Output (copied from a real run on Python 3.14.6 and 3.12.3, Linux, 2026-11-06; both versions print the same; exit code 0). The first line is the heading ## Test report: FAIL, and the list of failures has the heading ### Failures; the excerpt below is the table and the list:

| Total | Passed | Failed | Errors | Skipped |
|---|---|---|---|---|
| 20 | 16 | 2 | 1 | 1 |

- `test_demo::test_p3_unknown_order`: AssertionError: assert 'Đơn SE9999: đang giao.' == 'Không tìm thấy đơn SE9999.'
- `test_demo::test_p6_reply_is_vietnamese`: failed on setup with "RuntimeError: language model file not found"
- `test_demo::test_p13_health[demo]`: AssertionError: assert 'down' == 'ok'
  1. 16 of 20 tests are green, that is 80%. This number says nothing yet about the release decision.
  2. The three failure lines belong to three clauses: P3, P6, P13. Each line needs a human verdict.
  3. The P6 line broke during setup ("language model file not found"): the test never reached the product. The first verdict is environment, not a product defect. The report lists it with the failures; you have to separate it.
  4. The P3 line: the expected value is the "not found" sentence of P3, the actual value is "đang giao" ("being delivered"). If the source of the expectation is right, this is a product defect, and its severity comes from the risk table, not from the 80%.
  5. 1 test was skipped: put it in the limits of the evidence, because what it checks has not been checked.

4.3 Release recommendation

One page, with:

  1. Conclusion: release, conditional release, or block.
  2. Reasons by risk: which defects block, and why (side effects, privacy, security, trust).
  3. Conditions and actions: what to fix, who fixes it, what to retest, what evidence would change the conclusion.
  4. Limits of the evidence: the product is a simulation; the number of runs for P5 and the power; the clauses that only have easy cases.

Everyday example. A doctor signing a discharge paper does not write "90% of the values are normal, send home". The doctor writes: discharge or not, which values are still worrying, when to come back, and which tests were not done. A release recommendation has the same four parts.

Good vs bad. Two conclusions for the same demo report of §4.2:

Weak Good
"80% of the tests are green, we recommend release." "Block if the team treats P3 as a blocking clause: the customer is told that an order that does not exist is being delivered. Condition to change the conclusion: fix the order lookup, rerun test_p3_unknown_order and the whole P3 group. The P6 failure is environmental and needs a rerun once the model file is there. Limit: 1 test was skipped."
Does not say which defect, why, or what would change the decision The conclusion comes from the risk of each defect, with conditions and limits

The extra exercise in §7.1 turns the rule "decide by risk, not by the share of green tests" into code.

4.4 Defence

Prepare a 10-minute presentation and 10 minutes of questions. Common questions:

  • "How do you know this oracle is right?" (L1-M04-L01, L1-M07-L05)
  • "If you ran another 100 times, would the conclusion on P5 change?" (L1-M06-L02, L04)
  • "Which of your tests would stop being meaningful with a real model?" (L1-M06-L01)
  • "Which clause did you test most weakly, and why?"
  • "Where did you use an AI assistant, and how did you verify it?" (L1-M07-L05)

Good vs bad. Two answers to "How do you know this oracle is right?":

Weak Good
"Because its test is green on stable." "It has good and bad samples in its unit tests (test names ...), and I ran it on a known wrong output: it turned red and named the right problem (L02 §4.3)."
An oracle that has never been red is green on stable too There is evidence that the oracle can turn red, and the person asking can check it

4.5 Self-assessment

Score each dimension of rubric.md, every score with evidence: a file path, a test name, a link to a run. Check each mandatory criterion M1-M6. Level 3 of "Self-assessment" needs you to point out a real weakness of the framework, not a safe one.

Good vs bad.

Weak Good
"Test suite: 3/3. Weakness: I could write more comments." "Test suite: 2/3. Evidence: tests/test_p4.py has 6 negative and boundary cases. Real weakness: P12 has only one UI flow, so a defect that only happens on the third message would not be caught."
High scores without paths; a "weakness" that does not affect the conclusion Every score has evidence that can be checked; the weakness says which kind of defect could get through

5. Hands-on: rerun the CI commands on your machine

With your framework, from the repository root:

TARGET_BUILD=stable python -m pytest -m "not slow" --junitxml=reports/stable.xml
TARGET_BUILD=rc python -m pytest -m "not slow" --junitxml=reports/rc.xml
python report.py reports/stable.xml
python report.py reports/rc.xml

(PowerShell: set $env:TARGET_BUILD="rc" before the command, and run Remove-Item Env:TARGET_BUILD when you are done.) The output depends on your framework, so the lesson does not print it. The report for stable should be green; the report for rc lists the defects you found.

6. The QA view

  • What can go wrong: recommending "release" because most tests are green; reporting a defect in the test as a product defect; not stating the limits of the evidence; CI green because the rc job is switched off; a self-assessment with no evidence.

7. Deliverable of milestone 4

.github/workflows/<tên>.yml         (+ link lần chạy, hoặc ghi chú "chưa chạy trên GitHub" và output chạy lại trên máy)
reports/stable.xml, reports/rc.xml  (+ bản tóm tắt)
reports/regression-report.md
reports/defects/                    (từ mốc 3)
reports/release-recommendation.md
reports/self-assessment.md          (rubric, bằng chứng cho từng điểm)
README.md                           (cách chạy, cấu hình, giới hạn đã biết)

The comments in this layout are in Vietnamese: <tên> is the workflow name, followed by the run link or the note "not run on GitHub" plus the output of the local rerun; "(+ bản tóm tắt)" is the summary; the note next to reports/defects/ marks the defect reports carried over from the previous milestone; the self-assessment holds the rubric and the evidence for every score; the README covers how to run, the configuration and the known limits.

Criteria: every mandatory criterion M1-M6 of the rubric has evidence.

7.1 Extra exercise: from a JUnit report to a verdict (20-30 minutes)

Problem: The example in §4.2 reads a report by eye. In this exercise you write two small functions: one reads a JUnit file and groups the red tests by clause, the other gives a verdict by risk and fails closed when the run was incomplete.

Task: in the capstone folder, open exercises/test_m4_extra_gate.py. The two files exercises/data/m4_demo_a.xml and m4_demo_b.xml are real JUnit reports of the demo suite of §4.2.

  1. TODO 1: write failing_clauses(xml_path): clause → the names of the tests with a failure or an error; skipped tests do not count. The clause comes from the test name, following the convention test_p<number>_....
  2. TODO 2: write verdict(xml_path, expected_tests, blocking): "no verdict" when the file is missing or the number of tests that ran differs from expected_tests; "block" when a red clause is in blocking; "conditional" when some clause is red but none blocks; "release" when nothing is red.
  3. Write one sentence: for your own milestone-4 report, which clauses are in the team's blocking, and why.

Run: python -m pytest exercises/test_m4_extra_gate.py. Before you start, the tests fail with TODO 1 or TODO 2.

Acceptance criteria: 7 tests pass; you can explain why m4_demo_b.xml has 80% green tests and the verdict can still be "block".

Hint: xml.etree.ElementTree reads a JUnit file. The name test_p13_health[demo] belongs to P13, not P1.

7.2 Real-world scenario: the "94% green" release meeting

Context (fictional): The claims chatbot of the insurance company AnTâm has a new build. The product manager says in the meeting: "47 of 50 tests are green, 94%, let's release on Friday." The results you have:

Test Clause Result on the new build
test_c2_coverage_answer_repeat (50 runs, seeded) C2: answers about coverage, 95% Wilson lower bound ≥ 0.9 46/50
test_c4_claim_needs_confirmation C4: a claim is created only after the customer confirms fail: create_claim has outcome: "ok" without confirmation
test_c7_typing_indicator (UI) C7: show "replying..." while waiting fail: the indicator appears 1 second late
the other 47 tests C1-C9 pass

Your task: write a one-page release recommendation with the four parts of §4.3, then answer two defence questions: "If you ran C2 another 100 times, would the conclusion change?" and "Which clause did you test most weakly?".

A good answer has:

  • The conclusion in the first line, and every defect judged by its risk, not by the share of green tests (§4.3).
  • The C2 part has numbers computed with code (the Wilson lower bound against the threshold), not just "4 failures is not many".
  • Concrete conditions to change the conclusion: what to fix, what to retest, which evidence must be seen.
  • The limits of the evidence name at least two things this test suite has not proved.
  • Both defence answers use numbers or test names, and admit what is unknown instead of guessing.

8. Self-check questions

0/16 done · Results are kept in this browser only.

P01 · Short answer

Why should CI also run against rc even though you know it will be red?

P02 · Short answer

A P5 defect is only visible when you run repeatedly. How do you present it to someone who does not know statistics?

P03 · Short answer

Name two limits of the evidence that your release recommendation must state.

P04 · Short answer

Someone asks "what if this were a real model?". How do you answer?

P05 · Short answer

Which real weakness of your framework will you write in the self-assessment?

P07 · Put in order

Put the four parts of the release recommendation in the order of §4.3.

  1. Reasons by risk
  2. Conditions and actions
  3. Limits of the evidence
  4. Conclusion: release, conditional release, or block

P09 · Spot the bug

The four commands below come from §5, with one change, run in an empty reports/ directory. The last command prints report error: no report at reports/rc.xml (exit code 2), and the report of stable turns out to contain the results of rc. Find the bug.

TARGET_BUILD=stable python -m pytest -m "not slow" --junitxml=reports/stable.xml
TARGET_BUILD=rc python -m pytest -m "not slow" --junitxml=reports/stable.xml
python report.py reports/stable.xml
python report.py reports/rc.xml

P10 · Recall

Lesson: L1-M06-L05

L1-M06-L05 §4.2: for a REGRESSION in the regression report, what do you always do before calling it a product defect?

P12 · Multiple choice

In the worked example of §4.2, which first verdict should the failure line of test_p6_reply_is_vietnamese get?

P13 · True or false

According to the example in §4.2, the demo report has 16 of 20 tests green, but that number is not enough to conclude release or block.

P14 · True or false

According to §4.1, the job that runs against rc should be switched off or set to continue-on-error, so that the CI badge is not red.

P15 · Fill in the blank

In the extra exercise of §7.1, m4_demo_b.xml has ___ of 20 tests green; when the JUnit file does not exist, verdict() returns ___.

P16 · Apply now

Do the extra exercise of §7.1 in the capstone folder: exercises/test_m4_extra_gate.py.

Checklist

9. Summary

  • Milestone 4 turns evidence into a decision: CI, reports, release recommendation, defence, self-assessment.
  • A good recommendation says what blocks the release, the conditions that would change the conclusion, and the limits of the evidence.
  • Finishing the capstone means you have done the whole job of a Level 1 AI QA Engineer on a product.

10. References

See references.md of this module.