跳到正文
DEV Community· Jon Ömerağa·· 3 小時前AI 評分54

AI 報表:一項核對儀錶板、下鑽明細與 CSV 的回歸測試

AI reporting: One regression test for a dashboard, its drill-down and CSV

AI 導讀

Jon Ömerağa提出一項 AI 報表回歸測試,核對儀錶板數值、下鑽明細與 CSV 匯出是否在相同截止時間及篩選範圍下指向同一筆訂單。測試以 10:00 為截止時間,預期三個訂單中只有 O-42 符合逾期條件,並出現在明細和匯出中;只核對列數可能漏掉錯誤訂單。篩選結果為零時,儀錶板、明細和匯出也應清楚反映沒有匹配訂單,並明確説明匯出處理方式。

正文

Jon Ömerağa

A dashboard says there’s one late order. The detail view lists one. The CSV has two. If support gets that ticket, which part of the product should they trust?

I’m Jon Ömerağa and I work at dReveal, a reporting provider. This is a fictional test fixture; AI was used to help draft the article.

Start with three orders in one region, all evaluated at the same cutoff:

Order Last known status at 10:00 Late under the report’s rule?
O-42 Open, delivery promised at 09:00 Yes
O-43 Cancelled, delivery originally promised at 09:00 No
O-44 Open, delivery promised at 11:00 No

Three reporting surfaces agree on one late order, O-42.

For this test, “late” means an open order whose promised delivery time is earlier than the report cutoff. The tile should show 1. Clicking the tile should open exactly O-42. Exporting that same view should produce exactly O-42, with the cutoff and region indicated somewhere the recipient can see.

Test the order IDs, not just the row count. A CSV that returns O-43 instead of O-42 still has one row, and a count-only check would let it through.

If your product also lets users ask the report a question in natural language, run the same fixture through that interface: “At 10:00, in this region, which open orders are late?” The answer should point to O-42 and describe the scope, or say it cannot verify the underlying records. Trace the result to the same detail view. This catches a reporting mismatch even when the AI reply sounds convincing. For a companion example on source completeness and duplicate events, see three checks before trusting an AI-generated KPI.

Then rerun the test with a filter that matches nothing. The tile should show zero, the detail view should explain that no orders match, and the export should either contain headers only or be disabled with a clear reason. Pick one export behaviour and test it deliberately.

A slightly different scope can be legitimate. An export labelled “All orders” might include more rows than the tile. In that case, make the scope clear before the download so nobody mistakes the file for the filtered view.

This is a small regression test worth keeping next to your report definition. If a filter or export changes later, you can see immediately whether the three surfaces still agree.

來源:DEV Community · dev.to