package page→ /quality/how-to-test.md
pages/quality/how-to-test.md
59 lines, 4.9 KB. As a page.
- ---
- type: Page
- title: "How to test"
- icon: "🧭"
- description: "The order of testing a product: four levels of verification, on what data, how to record a run and a defect, how to rate the quality of a result and not only \"works or not\"."
- ---
- This page is for someone checking a product for the first time. It answers four questions: how to check, on what data, where to record the result and what to do with a defect. Commands and addresses of test environments differ per project: they are written in the section "Our test environment" at the bottom.
- **The main rule on data.** We test on data as close to real as possible: real requests from the specification, the real model, real sources. Where emulation cannot be avoided (no access, a paid service), we say so: "emulation: <service>". A rating on emulation shows that the code and the scenario work, but does not guarantee quality on the customer's data.
- ## Four levels of verification
- We check each scenario on four levels. The lower level is cheap and fast; the upper one is closest to a human. **A green lower level does not replace an upper one** (norm QTS-R05).
- | Level | What | Model | Passed when |
- |---|---|---|---|
- | 1. Model stub | package tests and acceptance tests; the model is replaced by a stub, the database is a real test one | stub | all check commands finished with exit code 0 |
- | 2. Real model | the same scenarios on the real model | real | every scenario reached a result or its intended stop, the model's answers fit the schema, the cost is recorded |
- | 3. Console and procedures | the scenario from request to result through procedures on the test environment, without a window | real | at every step the state matched the expected one (read by a procedure, not from the text on screen), the result matched the reference |
- | 4. The window through the user's eyes | the same pass on screen, as a human does it: sign in under a role, a request, answers at the stops, a screenshot of every step | real | the result on screen and in the export is correct, there is no raw code and no empty places, confirmations stand where the scenario says |
- A test at a level is recorded in [Quality tests](/quality/tests.md) with the `level` field.
- ## How to record a run
- 1. Screenshots, video and exports go into the run's folder; screenshot names are `NN-what-is-on-screen.png`, where `NN` is the step number.
- 2. The report is a table `| test | result | what was seen |`. The result is exactly one of: `passed`, `partly`, `failed`, `not checked`.
- 3. A record in [Runs](/quality/runs.md): date, kind, what triggered it, commit, test environment, who ran it, the count of checks, whether there was no regression. It is better to build the record with a script from the report: that way the count adds up (norm QTS-R03).
- 4. If the run gave an indicator number, record a [measurement](/quality/measurements.md) with a sample and a source; `run` leads to the run.
- ## A defect
- - Whoever ran the run fixes it: the fix comes together with a test that fails without the fix (norm QTS-R06). The run's report holds the hash of the fix and an "after" screenshot.
- - You cannot fix it yourself (someone else's code, data, access): a record in [Bugs](/work/bugs.md): the symptom, where it is visible, the proof (the path to a screenshot), which requirement is violated, the severity.
- - The cause is in the test environment's data and not in the code: not a defect; the result is "partly" with the reason "data".
- - A defect that could have harmed the customer is a reason to check the [risk register](/quality/risks.md): did it have a risk?
- ## Quality of the result, not only "works"
- Besides "works / does not work", we rate a feature's result on a scale from 0 to 5:
- 1. **Usefulness:** a person can act on the result at once.
- 2. **Accuracy:** facts and numbers come from sources, nothing is invented, every fact has a link.
- 3. **Completeness:** everything the requirement asks for is filled in, with no "to fill in" marks.
- 4. **Fit to the request:** the result is about what was asked.
- 5. **Time saved:** how many minutes of a person's work the result replaces.
- A rating below 4 on any item is a quality defect. Average ratings over a set of requests are measurements of [indicators](/quality/indicators.md). The improvement loop: defect, fix with a test, repeat run, new measurement.
- An example from a sales project: five real requests from the specification for the "leads" feature (from the request to a commercial offer), level 2 or 4, five ratings for each result, the goal for time saved is at least 30 minutes per task.
- ## A change of model or prompt
- A change of model or prompt is not merged without a run with no regression on the sets of its agents (norm QTS-R04): a run record with `trigger: model` or `change` and the mark "No regression" (`passed: true`).
- ## Our test environment
- The project fills this in: addresses of the test environments, accounts by role (no passwords, only where to get them), commands for each level, where the run reports live.