tdd-guide

Guide TDD workflows for Backend.AI with pytest and with_tables patterns.

662|179|Updated Oct 6, 2016
One-click install
npx skills add https://github.com/lablup/backend.ai --skill tdd-guide-lablup
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd-guide
Source: https://github.com/lablup/backend.ai/tree/main/.claude/skills/tdd-guide
Command: npx skills add https://github.com/lablup/backend.ai --skill tdd-guide-lablup

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill guides developers to implement Test-Driven Development workflows for Backend.AI projects, helping teams define test targets, write failing tests first, implement minimally, and steadily refactor with confidence.

Core Features & Use Cases

  • Guided TDD workflow: Step-by-step process from scenario definition to green tests and refactor.
  • Test scaffolding templates: Example fixtures, test structure, and guidelines for using with_tables and pytest.
  • Practical usage: Apply TDD patterns to repository-first design and feature development in Backend.AI.

Quick Start

  1. Define test scenarios for the feature under test, using a clear Test Target description.
  2. Write failing tests first (Red).
  3. Run tests to observe a red state, then implement minimal code to pass (Green).
  4. Re-run tests and perform safe refactoring, ensuring tests remain green.

Frequently Asked Questions about tdd-guide

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

FAQPage Schema
How do I implement test-driven development workflows for Backend.AI feature development?

Test-driven development for Backend.AI starts with defining clear test scenarios, writing failing tests first, implementing minimal code to pass them, and refactoring safely. This workflow targets feature development and bug fixes using pytest, pants, and with_tables patterns.

What is the best way to structure pytest fixtures for repository-first design in Backend.AI?

Structuring pytest fixtures for repository-first design involves using explicit test structures, strong typing, and small focused functions. You define test targets clearly, leverage with_tables patterns, and use scaffolding templates to ensure tests remain maintainable and isolated.

Can I use pants build system with pytest to run TDD workflows incrementally?

Yes, you can use pants with pytest to run TDD workflows incrementally. The workflow encourages observing a red state by running tests first, then implementing minimal code to achieve green, and continuously re-running tests during refactoring to ensure stability.

When do I need to use the with_tables pattern for testing in Backend.AI?

You need the with_tables pattern when defining test scenarios requiring specific database states or repository interactions. It provides scaffolding templates and guidelines for pytest, ensuring repository-first design tests have the necessary structured data context.

Why does my TDD refactoring step break existing green tests in Backend.AI?

Refactoring breaks green tests when implementations grow too large or lose focus. TDD enforces small, focused functions and strong typing to prevent this. Re-run tests continuously during refactoring to catch regressions immediately and maintain the green state.