skillfed

tdd

tdd guides you through mandatory test-driven development across all Prowler components using the red-green-refactor cycle. Learn to write failing tests first, implement minimum code to pass, triangulate with edge cases, and refactor with confidence. Covers TypeScript/React, Python SDK, and Django API stacks with practical examples.

tdd teaches the red-green-refactor cycle for test-driven development across Prowler's UI, SDK, and API components.

AI-generated summary based on this skill's SKILL.md

14,491 2,285 Apache-2.0 updated by prowler-cloud

Install

prowler-cloud/prowler/tdd · repository language: Python

git clone https://github.com/prowler-cloud/prowler
cp -r prowler/skills/tdd ~/.claude/skills/tdd
npx skillfed install prowler-cloud/prowler/tdd

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

What is the tdd skill's test driven development workflow?

tdd guides you through the red-green-refactor cycle across all Prowler components. You write a failing test first, implement minimum code to pass it, then refactor with confidence. This mandatory workflow ensures quality and safety throughout TypeScript/React, Python SDK, and Django API stacks.

How do you write tests first in the TDD cycle red green refactor?

tdd teaches you to write failing tests before any implementation. Start by defining what your code should do via a test that fails, then write only the minimum code needed to make it pass, and finally refactor safely. This approach prevents over-engineering and catches bugs early.

How does tdd help with pytest moto testing and prowler SDK coverage?

tdd covers unit test coverage for the Prowler SDK using pytest with moto for AWS mocking. You learn to set up proper test stacks, use fixtures and mocking effectively, and ensure comprehensive coverage across SDK components while following the red-green-refactor discipline.

What anti-patterns does tdd help you avoid in testing?

tdd teaches you to avoid hardcoding fake implementations and ensures triangulation with multiple test cases for edge cases and boundary values. You learn to write meaningful tests that catch real bugs rather than tests that simply pass, maintaining quality throughout refactoring.

Can tdd help set up testing for UI and API components?

Yes, tdd covers testing setup for UI (TypeScript/vitest with React Testing Library), SDK (Python pytest with moto), and API (Django pytest). You learn proper stacks and workflows for each component type, ensuring test-driven development practices across your entire Prowler codebase.

How does tdd enable safe refactoring with test coverage?

tdd provides a safety net through comprehensive test coverage built during development. Once your test suite passes, you can refactor code confidently knowing tests will catch any regressions. This approach lets you improve code quality without fear of breaking functionality.

SKILL.md

rendered from the published skill — quoted content, verbatim

TDD Cycle (MANDATORY)

+-----------------------------------------+
|  RED -> GREEN -> REFACTOR               |
|     ^                        |          |
|     +------------------------+          |
+-----------------------------------------+

The question is NOT "should I write tests?" but "what tests do I need?"


The Three Laws of TDD

  1. No production code until you have a failing test
  2. No more test than necessary to fail
  3. No more code than necessary to pass

Detect Your Stack

Before starting, identify which component you're working on:

| Working in | Stack | Runner | Test

(truncated - see the full file via the links below)

Read as markdown · JSON record · Browse the source repository

File tree — 1 file
skills/tdd/SKILL.md

Related skills

Tags

red-green-refactor test-first-coding unit-test-patterns mock-driven-testing behavior-verification coverage-assessment triangulation-strategy multi-stack-testing ci-safety-net quality-assurance-workflow