Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

testing-strategy

БесплатноБез исполняемых скриптовНе проверен

Comprehensive guide for implementing AIDB tests following E2E-first philosophy, DebugInterface abstraction, and MCP response health standards

ai-debugger-incот ai-debugger-inc★ 22 звезды на GitHub15 установок в других каталогах

Об этом скилле

AIDB Testing Strategy

Priority: E2E → Integration → Unit (Highest ROI First)


CRITICAL: Test Execution Command

All tests MUST be run via ./dev-cli test run:

./dev-cli test run -s {suite} [-k 'pattern'] [-l {lang}]
  • Multiple -k and -l flags supported
  • NEVER use --local - suites know their natural execution environment; forcing local causes unexpected behavior
  • Direct pytest invocation is NOT supported

This skill guides you through creating and modifying tests for the AIDB project. The test infrastructure is complete - your job is to implement tests using proven patterns.

Related Skills

When implementing tests, you may also need:

  • adapter-development - Tests validate adapter behavior across languages
  • mcp-tools-development - MCP tools tested with DebugInterface abstraction
  • dap-protocol-guide - Tests exercise DAP protocol flows end-to-end
  • ci-cd-workflows - For testing CI/CD workflows themselves (not application code)

Core Philosophy

For complete test architecture, see test infrastructure in src/tests/.

1. E2E First, Unit Last

Why E2E First?

  • Validates real user workflows
  • Exercises the full stack (catches integration bugs early)
  • Most bugs discovered when testing actual components
  • Higher ROI than unit tests initially

Testing Priority:

  1. E2E Tests - Complete workflows, real programs, full integration
  2. Integration Tests - Component interactions, adapter lifecycle, state management
  3. Unit Tests - Edge cases, specific logic, error handling

2. Framework Tests: Keep It Simple

Goal: Verify we can launch and debug programs using various frameworks

Pattern:

  1. Connect to framework app (Django, Express, Spring Boot, etc.)
  2. Quick smoke test: set breakpoint → inspect → step
  3. That's it. Don't test framework internals.

We're testing that AIDB works WITH frameworks, not testing the frameworks themselves.

3. MCP Responses: Structure + Content + Efficiency

Don't just validate structure - validate content accuracy and payload efficiency.

Bad test:

assert "locals" in response["data"]  # Structure only

Good test:

# Structure
assert "locals" in response["data"]

# Content accuracy
assert response["data"]["locals"]["x"]["value"] == 10
assert response["data"]["locals"]["x"]["line"] == 5

# Efficiency (no junk)
assert len(response["data"]) <= 3  # No bloated payloads
assert len(response["summary"]) <= 200  # Concise summaries

4. VS Launch: Critical for Agent Workflows

Why critical:

  • Primary entry point for agents using framework debugging
  • Enables use of existing workspace launch configs
  • Complex variable substitution must work (${workspaceFolder}, etc.)

Test thoroughly:

  • Core launch.json parsing (language-independent)
  • Per-language config translation (Python/JavaScript/Java)
  • Variable substitution and resolution
  • Framework-specific launch configs

Critical Breakpoint Timing:

Set breakpoints when STARTING sessions (not after) to avoid race conditions with fast-executing programs:

# ✅ CORRECT
await debug_interface.start_session(program=prog, breakpoints=[{"line": 10}])

# ❌ WRONG: Race condition
await debug_interface.start_session(program=prog)
await debug_interface.set_breakpoint(file=prog, line=10)  # May be too late!

Exception: Long-running processes (servers) where you attach. Reference: src/tests/aidb_shared/e2e/test_complex_workflows.py

DebugInterface Abstraction

The cornerstone of our test strategy is the DebugInterface abstraction - a unified API that works with both MCP tools and the direct API.

For implementation details, see:

  • DebugInterface - Skill resource file
  • src/tests/_helpers/debug_interface/ - Debug interface source and docstrings

Why? One test validates both entry points.

Hypothetical Example (illustrates pattern, not a real test file):

from tests._helpers.parametrization import parametrize_interfaces

class TestBreakpoints(BaseE2ETest):
    @parametrize_interfaces  # Runs twice: MCP and API
    @pytest.mark.asyncio
    async def test_set_breakpoint(self, debug_interface, simple_program):
        """Test works with BOTH MCP and API."""
        await debug_interface.start_session(program=simple_program)

        bp = await debug_interface.set_breakpoint(
            file=simple_program,
            line=5
        )

        self.verify_bp.verify_breakpoint_verified(bp)
        await debug_interface.stop_session()

Key Points:

  • @parametrize_interfaces runs test with both MCP and API
  • Same test logic validates both entry points
  • No duplication, no drift
  • See DebugInterface for details

The Shared Suite: Testing De

Полный SKILL.md на GitHub

Установить testing-strategy в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

resources/debug-interface.mdresources/debugging-failures.mdresources/e2e-patterns.mdresources/framework-tests.md

FAQ

Что делает скилл testing-strategy?

Comprehensive guide for implementing AIDB tests following E2E-first philosophy, DebugInterface abstraction, and MCP response health standards

Как установить скилл testing-strategy?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл testing-strategy запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить testing-strategy с