Back to list
zircote

testing-standards

by zircote

Software Development Lifecycle standards plugin for AI coding assistants. Enforces build, quality, testing, CI/CD, security, and documentation best practices.

0🍴 0📅 Jan 21, 2026

SKILL.md


name: Testing Standards description: This skill should be used when the user asks about "testing", "test coverage", "unit tests", "integration tests", "test organization", "test best practices", "flaky tests", "test isolation", "TDD", "regression tests", or needs guidance on test structure, coverage requirements, and test execution. version: 1.0.0

Testing Standards

Guidance for implementing comprehensive testing that meets SDLC requirements.

Tooling

Available Tools: If using Claude Code, the pr-review-toolkit:pr-test-analyzer agent reviews test coverage and identifies gaps. Use after creating PRs to ensure adequate test coverage.

Test Organization

Required Test Categories (MUST)

Projects MUST maintain these test categories:

CategoryLocationPurpose
Unit testsAlongside source codeTest individual functions/methods
Integration testsDedicated test directoryTest component interactions
Documentation testsWithin doc commentsVerify examples work
End-to-end testsDedicated e2e directoryTest full system behavior

Naming Convention (MUST)

Test files MUST be clearly identifiable by naming convention:

LanguageUnit TestsIntegration Tests
Rustmod tests in sourcetests/ directory
TypeScript*.test.ts, *.spec.tstests/integration/
Pythontest_*.py, *_test.pytests/integration/
Java*Test.java*IntegrationTest.java
Go*_test.go*_integration_test.go

Test Coverage

Coverage Requirements

RequirementLevel
New functionalityMUST include tests
Bug fixesMUST include regression tests
Coverage measurementMUST be tracked
Minimum coverageSHOULD target 80%
Critical pathsMUST have 95%+ coverage
Coverage reportsMUST be uploaded to tracking service

Regression Tests (MUST)

Bug fixes MUST include regression tests that:

  1. Fail before the fix is applied
  2. Pass after the fix is applied
  3. Document the bug being fixed
#[test]
fn test_issue_123_null_pointer_on_empty_input() {
    // Regression test for issue #123
    // Previously caused null pointer when input was empty
    let result = process_input("");
    assert!(result.is_ok());
}

Critical Path Coverage (MUST)

Critical paths requiring 95%+ coverage:

  • Authentication and authorization
  • Data validation and sanitization
  • Financial calculations
  • Security-sensitive operations
  • Data persistence operations

Test Execution

Pre-Merge Requirements (MUST)

  1. All tests MUST pass before code can be merged
  2. Tests MUST be deterministic (no flaky tests)
  3. Tests MUST be isolated (no shared state between tests)
  4. Tests MUST run on all supported platforms in CI

Performance Guidelines (SHOULD)

Test TypeTarget Duration
Unit tests< 1 second each
Integration tests< 30 seconds each
Full test suite< 10 minutes

Flaky Test Policy

Flaky tests (tests that sometimes pass, sometimes fail) MUST be:

  1. Identified and tracked
  2. Fixed or quarantined immediately
  3. Never ignored or re-run until green

Test Best Practices

Arrange-Act-Assert Pattern (MUST)

Tests MUST follow the AAA pattern:

test("should calculate total with discount", () => {
  // Arrange
  const cart = new ShoppingCart();
  cart.addItem({ price: 100, quantity: 2 });
  const discount = 0.1;

  // Act
  const total = cart.calculateTotal(discount);

  // Assert
  expect(total).toBe(180);
});

Test Naming (MUST)

Test names MUST clearly describe what is being tested:

Good:

test_user_creation_with_valid_email_succeeds
test_login_with_invalid_password_returns_401
test_empty_cart_returns_zero_total

Bad:

test1
testUser
test_it_works

Coverage Requirements (MUST)

Tests MUST cover:

  • Happy path: Expected inputs produce expected outputs
  • Error cases: Invalid inputs produce appropriate errors
  • Edge cases: Boundary conditions handled correctly

Edge Cases to Test

CategoryExamples
Empty inputsEmpty strings, empty arrays, null/None
Boundary values0, -1, MAX_INT, empty, single item
Invalid inputsWrong types, malformed data
Concurrent accessRace conditions, deadlocks
Resource limitsLarge inputs, memory constraints

Implementation Checklist

  • Organize tests by category (unit, integration, e2e)
  • Follow naming conventions for test files
  • Set up coverage measurement
  • Configure coverage reporting in CI
  • Ensure all tests are deterministic
  • Verify test isolation
  • Add regression tests for bug fixes
  • Cover critical paths with 95%+ coverage

Compliance Verification

# Run all tests
make test

# Check coverage
make coverage

# Verify no flaky tests (run multiple times)
for i in {1..5}; do make test || exit 1; done

# Check critical path coverage (language-specific)
coverage report --include="src/auth/*,src/security/*" --fail-under=95

Additional Resources

Reference Files

  • references/test-patterns.md - Common test patterns and anti-patterns
  • references/coverage-config.md - Coverage tool configuration

Examples

  • examples/rust-test-setup.md - Rust test organization
  • examples/typescript-jest.config.js - Jest configuration
  • examples/python-pytest.ini - Pytest configuration

Score

Total Score

75/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 100以上

0/15
最近の活動

1ヶ月以内に更新

+10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

+5

Reviews

💬

Reviews coming soon