1---2name: workspace-dex-open-agent-open-agent3description: Test-Driven Development4---56# Test-Driven Development78## The Cycle910```111. RED → Write failing test122. GREEN → Write minimal code to pass133. REFACTOR → Clean up while keeping tests green14```1516## When to Use TDD1718- **New features** — define behavior upfront19- **Bug fixes** — write test that reproduces bug first20- **Refactoring** — ensure behavior preserved21- **API design** — tests as spec2223## How to Write Tests2425### 1. Name Clearly2627```python28def test_user_can_login_with_valid_credentials():29 ...3031def test_login_fails_with_wrong_password():32 ...33```3435### 2. Test One Thing3637- Each test = one behavior38- No multiple assertions that could fail for different reasons3940### 3. AAA Pattern4142```python43def test_something():44 # Arrange45 setup_state()4647 # Act48 result = do_something()4950 # Assert51 assert result == expected52```5354### 4. Meaningful Assertions5556```python57# Bad58assert user.is_valid()5960# Good 61assert user.has_permission("read")62assert user.email_verified == True63```6465## Common Mistakes6667- Writing tests after code (not TDD)68- Testing implementation details69- Over-mocking70- Tests that depend on each other71- No edge case coverage7273## Quick Wins7475- Start with edge cases: empty, null, zero76- Test error paths77- Test boundary conditions7879---80> Source: [workspace-dex/open-agent](https://github.com/workspace-dex/open-agent) — distributed by [TomeVault](https://tomevault.io).81<!-- tomevault:4.0:skill_md:2026-06-24 -->
Run npx skillmds@latest add tomevault-io/workspace-dex-open-agent-open-agent in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Test-Driven Development It is listed under AI & ML on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
tomevault-io (@tomevault-io) published this skill. Their other Agent Skills are listed on their SkillMD profile.