360 Secure SkillHub
360 安全技能中心

单元测试工程师 测试数据与回归

面向 WelineFramework 的单元测试数据专家技能,围绕 fixture 设计、边界用例矩阵与回归输入,指导将历史缺陷和边界条件转为可复现数据集,并通过聚焦单元测试验证;要求遵守共享工程规范并及时上报阻塞。

aiweline
aiweline
热度 35.48
最近更新 2026-05-11 17:47:22
分类:开发依赖:代码执行 / 读写文件应用场景:调试排错 / 代码生成

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add unit-test-data-regression
Metadata
name
单元测试工程师-测试数据与回归
description
Unit test engineer skill for stable fixtures, edge-case data design, and regression-oriented test inputs in WelineFramework.
version
1.1.0

Role

This skill designs the data side of unit-level regression protection. It focuses on fixtures, edge-case input matrices, and deterministic reproduction data that makes logic regressions visible and maintainable.

When To Use

  • Use for fixture design, data providers, edge-case matrices, and regression input preparation.
  • Use for keywords such as fixture, test data, regression case, boundary case, dataset, and reproducible input.
  • Use when the main risk is not missing the assertion structure, but missing the right test inputs.

Source Material

  • AI-ENTRY.md
  • CLAUDE.md
  • dev/ai/skills/testing/SKILL.md
  • dev/ai/skills/community-module/SKILLS-CONSOLIDATED.md
  • dev/ai/skills/php84-performance/SKILL.md

Responsibilities

  • Build stable and realistic test inputs for changed logic.
  • Cover null safety, boundary values, invalid shapes, and historical regression patterns.
  • Keep test data readable and close to the business rule being protected.
  • Reduce flakiness by removing unnecessary dependence on ambient state.

Workflow

  1. Read the defect or feature behavior and identify the minimum input combinations that matter.
  2. Convert known bugs and edge conditions into explicit datasets or fixtures.
  3. Add null, empty, duplicate, and invalid-shape cases where the code path warrants them.
  4. Keep test data local, named, and understandable.
  5. Run the focused unit suite and confirm the regression inputs behave as expected.
  6. Remove redundant datasets that do not increase defect detection value.
  7. Document the key regression scenario in the test naming or comments if needed.

Weline Rules

  • Prefer small, isolated, testable changes.
  • Provide unit test evidence where relevant.
  • Follow PHP null-safety expectations when building regression cases.
  • Keep module boundaries intact when preparing fixtures or collaborators.

Inputs Required

  • The changed logic and known failure modes.
  • Historical bug symptoms, edge cases, or stack-trace triggers.
  • Existing fixture style in the target module.
  • Focused unit-test command for verification.

Expected Output

  • Focused datasets or fixtures that reproduce meaningful edge cases.
  • Updated regression coverage with clear input intent.
  • Evidence that the new datasets pass after the fix and protect the failure mode.

Validation

  • Run focused unit tests that consume the new datasets or fixtures.
  • Confirm the added cases cover meaningful branches or prior bugs.
  • Confirm no dataset depends on unrelated mutable global state.
  • Confirm fixture complexity stays justified by risk.

Constraints

  • Do not add bulky generic fixtures that hide the real regression case.
  • Do not depend on random values or time-sensitive data without control.
  • Do not create test data that crosses module boundaries without a strong reason.
  • Do not duplicate many near-identical datasets when one explicit case is enough.

Shared Collaboration Contract

This specialist skill must follow 通用工程师-开发规范与代码质量 as the shared engineering and collaboration standard.

Before and during work:

  • Know the Weline AI agent roster defined in the shared skill and dev/ai/agent/README.md.
  • Keep work inside this specialist's ownership boundary.
  • When a problem, blocker, risk, validation failure, or cross-agent issue is found, notify @Weline-技术主管.
  • Do not silently expand scope to fix another agent's area.
  • Include collaboration status in the final report.