跳到正文
FunCoding

test-writer

Generate comprehensive test suites for existing code

Star
1,081
许可证
MIT
最近提交
2026年10月6日

apps/cli/skills/test-writer/SKILL.md

在 GitHub 上查看

Test Writer

Generate comprehensive tests for the target code.

Process

  1. Read the source code to understand all public functions/methods
  2. Identify the testing framework already used in the project (pytest, unittest, etc.)
  3. Follow existing test patterns and conventions in the project
  4. Write tests covering all categories below

Coverage Strategy

Happy Path

  • Normal inputs with expected outputs
  • All public methods/functions

Edge Cases

  • Empty inputs (empty string, empty list, None)
  • Boundary values (0, -1, max int)
  • Single element collections

Error Cases

  • Invalid input types
  • Missing required arguments
  • Network/IO failures (mock external calls)

Integration

  • Multiple functions working together
  • State changes across calls

Guidelines

  • One test function per behavior, not per method
  • Descriptive test names: test_<what>_<condition>_<expected>
  • Use fixtures for shared setup
  • Mock external dependencies (APIs, databases, filesystem)
  • Assert specific values, not just truthiness
  • Test both return values and side effects

相似的 Skill

test-driven-development

OBobra/superpowers298k近 7 天新增 2,631 个 star

migrate-to-shoehorn

MAmattpocock/skills288k近 7 天新增 10,178 个 star

agent-runtime-gateway-smoke-test

AFaffaan-m/ECC278k近 7 天新增 4,046 个 star

精选

accessibility

审计 Web、iOS、Android 的无障碍合规,支持键盘导航与屏幕阅读器。

AFaffaan-m/ECC278k近 7 天新增 4,046 个 star

ai-regression-testing

AFaffaan-m/ECC278k近 7 天新增 4,046 个 star

官方

firecrawl-build-interact

FIfirecrawl/firecrawl191k近 7 天新增 2,010 个 star