Testing Test Writing

Writes strategic unit, integration, and end-to-end tests for core user flows.

Updated Mar 13, 2023
One-click install
npx skills add https://github.com/pdovhomilja/dovhomilja-cz --skill testing-test-writing-pdovhomilja
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Testing Test Writing
Source: https://github.com/pdovhomilja/dovhomilja-cz/tree/main/.claude/skills/testing-test-writing
Command: npx skills add https://github.com/pdovhomilja/dovhomilja-cz --skill testing-test-writing-pdovhomilja

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill ensures that new features are adequately tested without over-engineering, focusing on core functionality and critical user flows to maintain development velocity and deliver reliable software.

Core Features & Use Cases

  • Strategic Testing: Prioritize unit, integration, and end-to-end tests for critical user workflows and business-critical functionality.
  • Behavior-Driven: Focus tests on observable behavior rather than internal implementation details, making them more resilient to refactoring.
  • Mocking Dependencies: Effectively mock external services (databases, APIs) to ensure fast and isolated tests.
  • Use Case: When developing a new login feature, this skill guides the AI to write unit tests for password hashing, integration tests for user authentication, and an end-to-end test covering successful login and invalid credential scenarios, ensuring the core user flow is robust.

Quick Start

Write unit tests for the 'calculateTotalPrice' function, covering valid inputs, edge cases like zero quantity, and ensuring it runs quickly.

Frequently Asked Questions about Testing Test Writing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write unit tests that focus on critical user paths instead of testing everything?

Unit tests for critical paths prioritize core business logic over edge cases. Write tests covering valid inputs and typical scenarios—like password validation in a login flow—using descriptive names and standard file patterns (*.test.ts, *.spec.js). This maintains development velocity while ensuring essential functionality works.

What's the difference between unit, integration, and end-to-end tests, and when do I use each?

Unit tests validate individual functions in isolation; integration tests verify components work together (e.g., user authentication with database); end-to-end tests cover complete user workflows. For a login feature, use all three: unit for password hashing, integration for database queries, end-to-end for the full login success scenario.

How do I mock external dependencies like APIs and databases in tests?

Mocking replaces real services with controlled substitutes, ensuring tests run fast and in isolation. Replace database calls, API requests, and third-party services with mock implementations that return predictable responses, letting you test your code without external dependencies.

Why should tests focus on behavior rather than implementation details?

Behavior-driven tests validate what users observe—login succeeds, price calculates correctly—rather than how internals work. This makes tests resilient to refactoring; you can change implementation without rewriting tests, reducing maintenance burden while keeping coverage effective.

Can I use test-driven development (TDD) with strategic testing, or do I need to test everything?

Strategic testing aligns with TDD by writing tests for critical workflows first, deferring edge cases to dedicated phases. This approach maintains development speed and code reliability without over-engineering, focusing test effort on core business paths that matter most.

What file naming patterns and structure should my tests follow?

Use standard patterns: *.test.ts, *.spec.js, or __tests__/* directories. Organize tests alongside source files or in a dedicated test folder. Descriptive test names clarify what behavior they validate, making test suites easier to navigate and maintain across unit, integration, and end-to-end layers.