testing-basics

Provide standardized testing patterns for unit, integration, and end-to-end tests.

6|Updated Dec 7, 2025
One-click install
npx skills add https://github.com/timequity/plugins --skill testing-basics
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-basics
Source: https://github.com/timequity/plugins/tree/main/craft-coder/testing-basics
Command: npx skills add https://github.com/timequity/plugins --skill testing-basics

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Core testing patterns applicable to any project.

Core Features & Use Cases

  • Test Structure: AAA pattern, clear test naming.
  • Test Types: Unit, Integration, E2E.
  • Mocking & Isolation: Basic mocking, test isolation basics.

Quick Start

Install a testing framework and write your first tests.

Frequently Asked Questions about testing-basics

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

FAQPage Schema
What is the AAA pattern in unit testing?

The AAA pattern—Arrange, Act, Assert—structures unit tests into three phases: set up test data and mocks (Arrange), execute the code being tested (Act), and verify the results match expectations (Assert). This standardized approach makes tests readable and maintainable across any language or framework.

How do I write unit tests for my code?

Install a testing framework for your language, create test files alongside your code, and write tests using the AAA pattern. Name tests clearly to describe what they verify, isolate the code under test using mocks for external dependencies, and run tests before committing to catch regressions early.

What's the difference between unit, integration, and end-to-end tests?

Unit tests verify individual functions in isolation; integration tests check that components work together; end-to-end tests validate entire workflows from user input to final output. Each type catches different categories of bugs—unit tests find logic errors, integration tests expose component interactions, and E2E tests verify system behavior.

How do I mock external dependencies in tests?

Create mock objects that simulate the behavior of external services, databases, or APIs without calling them directly. Inject mocks into the code being tested, specify their expected return values, and verify they were called correctly. This isolates your tests and makes them fast and reliable.

What test coverage should I aim for?

Aim for coverage that protects critical business logic and error paths—typically 70–80% for most projects—rather than chasing 100%. Focus on meaningful coverage: test edge cases, error handling, and integration points. A quick pre-commit checklist helps ensure tests run and key scenarios are covered before pushing code.

Can I apply testing patterns across different programming languages?

Yes. Core testing patterns like AAA, test naming conventions, isolation, and mocking principles apply universally across languages and frameworks. Each language has its own testing tools, but the underlying structure and reasoning remain consistent.