agentleFS
gitByEOSgitByEOS/open-part-skills/skills/testcase/SKILL.md

testcase

Skill38 starsChanged 10 days agoMITView on GitHub

通过本skill的规则来完善用户测试用例的完整性和有效性。当用户需要补充或完善测试用例时使用

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

Files
SKILL.md

testcase

如何工作

  1. 需用户指定一个文件,若无文件需让用户实现一个最小可测模型,把reference/li-case.lua代码发给用户,并中断
  2. 确保有用户指定文件后,读取代码中的测试用例
  3. 再读取关联代码中的函数定义,分析有哪些条件需要覆盖
  4. 补充用户的测试用例,确保覆盖所有条件

要求

等价类划分法

  • 将输入数据划分为若干等价类,从每类中选取代表性数据测试。
  • 此项至少包含2个用例:一个有效等价类,一个无效等价类

边界值分析法

  • 使用边界三点法,使用覆盖输入数据的边界值
  • 边界三点法: 下离点(min-1) | 下点(min) | 内点(中间值) | 上点(max) | 上离点(max+1)
  • 此项至少包含5个用例

全覆盖分析法

  • 至少有一个用例覆盖不互斥的每个条件
  • 此项至少包含1个用例,尽可能给出1个用例覆盖N个条件,每多1组互斥条件则加1组用例

脏数据

  • 关键数据缺失,字符串格式错误,条件是返回false还是报错中断

用例数量判断

  • 不强制数量,根据场景复杂度自适应调整
  • 条件越复杂,用例数量越多
  • 输入项数量越多,用例数量越多
  • 组合可能性越多,用例数量越多

代码写入

  • 延续用户的代码风格,保持一致性
  • 使用清晰的命名和中文注释和LOG,增强可读性
  • 只修改用户传入的文件,不修改其他文件

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.