My Test for a Safety Guard Deleted the Real Revenue Ledger
说明与用途
在 Windows PC 上的变异测试导致真实收入分类账被意外删除。经历三次事件后,实施了路径阻止、针对不存在文件的测试以及文件夹快照,以防止进一步的数据丢失。
问题
Mutation testing on a Windows PC caused unintended deletion of real revenue ledger files, creating data loss.
结果
Implemented path‑blocking guard and test adjustments prevented further ledger deletions and ensured mutation testing does not affect production data.
工作流
- Run mutation testing on temporary code copy
- Execute tests that call real browser script and ledger writer
- Detect unintended writes/deletions to real data folder
- Implement guard to refuse writes/deletes under real data folder
- Adjust tests to target non‑existent paths
- Snapshot data folder before/after each mutant
- Rebuild ledger from runner logs if deletion occurs
证据
The edits happen in a temporary copy of the code. That felt safe. It wasn't, because the copy was only a copy of the code.
Later that day a mutation slipped past a test's fake recording function. The real one ran and wrote test values into the real daily revenue ledger.
The mutant without the delete check ran os.unlink on the real ledger at 16:34.
- 记录日期: 2026-10-03T05:55:43.162Z