Skip to main content

Testing Test Writing

Write focused tests for core user flows and critical paths with clear test names, behavior-focused assertions, mocked external dependencies, and fast execution, deferring edge case testing until explicitly required. Use this skill when creating or modifying test files, writing unit tests, integration tests, or test cases for any feature. Apply when writing test files (test/, __tests__/, spec/, .test.js, .spec.ts, test_*.py), implementing tests for core user workflows, testing critical business logic, mocking external dependencies (databases, APIs, file systems), writing descriptive test names, creating fast-running unit tests, or adding tests at logical completion points of feature development. Use for any task involving test creation, test coverage, test strategy, or test-driven development.

星标

7

分支

0

更新时间

2025年10月29日 14:48

下载技能文件

下载包含 SKILL.md 和所有相关文件的完整技能目录

相关技能

maxritter

Testing Anti Patterns

maxritter

Prevent common testing anti-patterns that undermine test effectiveness and code quality by ensuring tests verify real behavior rather than mock behavior, keeping production code free from test-only pollution, and enforcing thoughtful mocking strategies. Use this skill when writing or modifying any test files (.test.ts, .test.js, .spec.ts, _test.py, test_*.py, *_test.go, *_spec.rb), when adding mock objects, stubs, spies, or test doubles to test suites, when considering adding methods or properties to production classes that are only called from test code, when setting up complex test fixtures or test data, when tests are failing and you're tempted to adjust mocks to make them pass, when deciding how to isolate code under test from external dependencies, when implementing dependency injection or test seams, during code reviews when reviewing test implementation and mocking strategies, when refactoring tests that have become brittle or hard to maintain, when test setup code is becoming longer than the actual test assertions, or when choosing between integration tests with real components versus unit tests with mocks.

7testing-qa
maxritter

Testing Test Driven Development (TDD)

maxritter

Apply rigorous test-driven development methodology following the Red-Green-Refactor cycle (write failing test, implement minimal code to pass, refactor while staying green) that ensures tests genuinely verify behavior by requiring observed failure before implementation, preventing untested code and false-positive tests. Use this skill when implementing any new feature or functionality in any programming language, when fixing bugs or resolving defects in existing code, when refactoring code to improve design while preserving behavior, when adding new methods, functions, classes, or modules to a codebase, when modifying existing behavior or business logic, when writing code in any file that will be executed in production environments, when creating API endpoints, service methods, or controller actions, when implementing data validation, transformation, or processing logic, when building user interface components with testable behavior, when writing algorithms, calculations, or business rules, when integrating with external APIs, databases, or third-party services, when you're about to write production code without having written a test first, when you've already written implementation code and need to delete it to start with TDD, when someone suggests "writing tests after" to save time, when under time pressure and tempted to skip testing, when a task seems "too simple to test", before making any code change that could affect application behavior, or when working on any code that is not throwaway prototypes, generated code, or configuration files (which are the only exceptions that require explicit partner approval).

7testing-qa
maxritter

Testing Debugging

maxritter

Apply systematic four-phase debugging methodology (root cause investigation, pattern analysis, hypothesis testing, implementation) that ensures thorough understanding before attempting solutions, preventing random fixes and reducing debugging time from hours to minutes. Use this skill when encountering any test failures in test suites (Jest, pytest, RSpec, JUnit, Go testing), when production bugs are reported or discovered, when code produces unexpected output or behavior different from requirements, when experiencing build failures or compilation errors, when integration tests fail due to component interaction issues, when performance problems or slowdowns are detected, when encountering race conditions, timing issues, or intermittent failures, when error messages or stack traces appear in logs or console output, when refactoring causes existing tests to fail, when you've already attempted one or more fixes that didn't resolve the issue, when deployment or CI/CD pipelines fail, when you're tempted to make a "quick fix" without understanding root cause, when multiple symptoms appear across different parts of the system, when debugging multi-component systems with layered architectures (API, service layer, database, external services), or when previous debugging attempts have taken longer than expected without resolution.

7testing-qa
maxritter

Testing Final Verification

maxritter

Enforce evidence-based completion verification by requiring fresh execution of verification commands and confirmation of output before making any success claims, ensuring work is genuinely complete rather than assumed complete. Use this skill when about to claim that work is complete, finished, or done, when about to state that tests are passing or a test suite succeeds, when preparing to commit changes to version control, when about to create pull requests or merge requests, when claiming that a bug has been fixed or resolved, when stating that build processes succeed or compile without errors, when reporting that linting, formatting, or code quality checks pass, when delegating work to agents and receiving success reports that need independent verification, when moving from one task to the next in a multi-step implementation, when about to use words like "should work", "probably works", "seems to", "looks correct", or other qualifying language that implies uncertainty, when feeling satisfied with work and ready to mark tasks complete, when expressing confidence without having run verification ("I'm confident this works"), when trusting partial verification as proof of complete success, when tired or under pressure and wanting to finish quickly, during code reviews when verifying that claimed changes actually work, when implementing regression tests and need to verify they fail before the fix (red-green cycle), or before any communication that implies success, completion, or correctness of implemented functionality.

7testing-qa
alirezarezvani

test-generator

alirezarezvani

Automatically suggest tests for new functions and components. Use when new code is written, functions added, or user mentions testing. Creates test scaffolding with Jest, Vitest, Pytest patterns. Triggers on new functions, components, test requests, testing mentions.

47testing-qa
alirezarezvani

code-reviewer

alirezarezvani

Automatic code quality and best practices analysis. Use proactively when files are modified, saved, or committed. Analyzes code style, patterns, potential bugs, and security basics. Triggers on file changes, git diff, code edits, quality mentions.

47testing-qa
Toowiredd

testing-builder

Toowiredd

Automatically generates comprehensive test suites (unit, integration, E2E) based on code and past testing patterns. Use when user says "write tests", "test this", "add coverage", or after fixing bugs to create regression tests. Eliminates testing friction for ADHD users.

11testing-qa
CuriousLearner

test-generator

CuriousLearner

Generate unit tests based on existing code patterns and testing frameworks.

9testing-qa
CuriousLearner

code-reviewer

CuriousLearner

Automated code review with best practices, security checks, and quality standards.

9testing-qa
CuriousLearner

seed-data-generator

CuriousLearner

Generate realistic test data for database development, testing, and demos.

9testing-qa
CuriousLearner

data-validator

CuriousLearner

Validate data against schemas, business rules, and data quality standards.

9testing-qa
giuseppe-trisciuoglio

unit-test-bean-validation

giuseppe-trisciuoglio

Unit testing Jakarta Bean Validation (@Valid, @NotNull, @Min, @Max, etc.) with custom validators and constraint violations. Test validation logic without Spring context. Use when ensuring data integrity and validation rules are correct.

6testing-qa
Testing Test Writing - maxritter 的 Claude AI 技能 | SkillsMP