Welcome to TDD Agent

The intelligent system automating Test-Driven Development. Let AI accelerate your workflow, improve code quality, and reduce development time.

Discover Features View on GitHub

About TDD Agent

TDD Agent in action

Revolutionizing Software Development

TDD Agent is an innovative AI-powered system meticulously designed to automate and enhance the Test-Driven Development (TDD) workflow. In the fast-paced world of software engineering, maintaining high code quality while accelerating development cycles is paramount. TDD Agent addresses this challenge by leveraging the power of cutting-edge Large Language Models (LLMs) to bridge the gap between natural language requirements and robust, well-tested code.

At its core, TDD Agent takes plain English requirements and intelligently generates comprehensive test cases using the popular pytest framework. But it doesn't stop there. The system then proceeds to automatically write the Python code necessary to pass these generated tests. This iterative process of test generation, code implementation, and automated refinement ensures that your software is built on a solid foundation of tests from the very beginning, leading to more reliable, maintainable, and bug-free applications.

Developed by Farshid Ashouri of RODMENA LIMITED, TDD Agent is born from a vision to empower developers, streamline workflows, and elevate the standards of software craftsmanship. We believe that by automating the often time-consuming aspects of TDD, developers can focus more on creative problem-solving and delivering exceptional user experiences.

Core Features

TDD Agent is packed with powerful features designed to automate and streamline your Test-Driven Development workflow.

Natural Language to Tests

Automatically generate comprehensive pytest test cases from plain English requirements, ensuring full test coverage from the start.

Automated Code Generation

TDD Agent intelligently creates Python implementations that satisfy the automatically generated tests, accelerating your development.

Iterative Refinement

When tests fail, the agent automatically analyzes failures and generates targeted fixes, re-running tests until they pass or max iterations are reached.

Multi-LLM Support

Seamlessly works with leading Large Language Models like OpenAI's GPT series (GPT-4o, GPT-4-turbo, etc.) and Google's Gemini models (2.0-flash, 1.5-pro).

Cost Tracking & Management

Monitor and analyze LLM usage costs with detailed breakdowns per-model, per-task, and per-project, including budget limits and alerts.

Git Integration

Automatic version control with meaningful commits at each stage of the TDD cycle, from initial project setup to successful fixes.

Project Management

Easily create, pause, and resume TDD projects. The agent maintains project state, allowing for interruptions and continuations.

User Authentication

Secure user accounts with JWT authentication, ensuring your projects and data are protected.

CLI & API Access

Interact with TDD Agent via a powerful command-line interface or integrate it into your existing workflows using its RESTful API.

Unlock Peak Developer Productivity

TDD Agent empowers you to write better code, faster. Spend less time on boilerplate and more time on innovation.

How TDD Agent Works

The Intelligent TDD Workflow

  1. 1. Define Requirements
    Provide your feature requirements in plain English. TDD Agent's natural language processing capabilities understand your intent.
  2. 2. AI-Powered Test Generation
    The agent intelligently generates comprehensive pytest test cases, covering positive, negative, and edge scenarios.
  3. 3. Automated Code Implementation
    TDD Agent writes the Python code required to satisfy the generated tests, choosing optimal LLMs for the task.
  4. 4. Test Execution & Analysis
    Tests are automatically executed (optionally in isolated Docker containers). Failures are meticulously analyzed.
  5. 5. Iterative Refinement Loop
    If tests fail, the agent intelligently generates fixes, re-runs tests, and repeats this cycle until all tests pass or a defined limit is reached.
  6. 6. Version Control & Reporting
    All significant steps are automatically committed to Git. Detailed cost and progress reports are available.
Collaborative AI Development

The Power of Iteration

The iterative refinement loop is at the heart of TDD Agent's intelligence. It's not just about generating code once; it's about continuously improving it based on test feedback. When a test fails, the agent doesn't just give up. It meticulously analyzes the failure, identifies potential root causes, and generates targeted fixes. This process might involve:

  • Understanding assertion errors and adjusting logic.
  • Correcting type mismatches or attribute errors.
  • Adding missing import statements or handling exceptions.
  • Refining algorithms to cover edge cases highlighted by tests.
Each fix attempt is a new iteration. The modified code is re-tested, and the cycle continues. This loop is designed to converge towards a solution where all tests pass. To prevent infinite loops or excessive resource consumption, the agent has built-in safeguards like maximum iteration limits. Furthermore, it can employ strategies like escalating to a more powerful (but potentially more expensive) LLM if simpler models repeatedly fail to produce a correct fix. This intelligent trial-and-error, guided by concrete test results, mirrors how human developers often debug and refine code, but at an accelerated pace.

Technical Deep Dive

TDD Agent is built using Python 3.8+ and leverages a robust stack of modern technologies. The backend is powered by FastAPI, providing a high-performance RESTful API for programmatic access and integration. Data persistence is handled by SQLAlchemy, allowing flexibility with database backends (defaulting to SQLite, with PostgreSQL support via Docker Compose for more scalable deployments). Alembic is used for managing database migrations, ensuring smooth schema evolution.

User authentication utilizes JWT (JSON Web Tokens) for secure session management, with passwords hashed using bcrypt. The command-line interface is built with Click and enhanced with Rich for a better user experience. For LLM interactions, dedicated clients for OpenAI and Google Gemini are implemented, with a model selector component to choose the optimal model based on task complexity, cost, and performance. Docker integration (optional) provides isolated environments for test execution, ensuring consistency and security. GitPython is used for seamless Git integration.

The project structure is organized into core modules for file workspace management, test generation, code implementation, test execution, response parsing, Git management, and iterative refinement. This modular design facilitates maintainability and future expansion. The `FileWorkspaceManager` handles the creation and management of project directories and files. `TestGenerator` and `CodeGenerator` are responsible for the AI-driven aspects of creating tests and code respectively, utilizing prompt templates and LLM clients. `TestExecutor` runs the generated tests, and `ResponseParser` processes the LLM outputs.

Security is a key consideration in TDD Agent. User authentication is handled via JWTs, and sensitive information like API keys and passwords are managed securely (e.g., password hashing with bcrypt). When Docker is used for test execution, it provides an additional layer of isolation, preventing generated code from directly accessing the host system. Future enhancements include more robust sandboxing for plugin execution and advanced security scanning of generated code using tools like Bandit.

Cost management is integral to TDD Agent. The system tracks LLM token usage for every API call, differentiating between prompt and completion tokens. It uses up-to-date pricing models for various LLMs (e.g., GPT-4o, Gemini 1.5 Flash) to calculate costs accurately. Users can monitor their spending through detailed analytics, broken down by model, task type (test generation, code generation, etc.), and project. The system supports setting monthly budget limits, with warnings issued as users approach these limits. The `ModelSelector` also plays a role in cost optimization by allowing users to choose a balance between cost and quality, or to explicitly minimize costs by selecting cheaper models for less complex tasks.

TDD Agent is designed with extensibility in mind. The Alpha release stage plans to introduce a plugin architecture. This will allow for third-party extensions, such as support for additional LLM providers, integration with different version control systems, connections to various deployment targets, and custom code analyzers. The plugin system will feature dynamic loading, validation, and potentially sandboxing for security.

An AI Learning Engine is another significant future direction, planned for the Beta stage. This engine will enable TDD Agent to learn from its interactions and user feedback. It aims to capture successful prompt patterns, effective code generation strategies, and common error-fix solutions. By employing techniques like spaced repetition and model performance benchmarking, the system will continuously improve its efficiency and the quality of its outputs over time. Other advanced AI features on the roadmap include contextual model selection, ensemble model approaches, and even custom model fine-tuning.

Further down the line, the GA (General Availability) release envisions features like security penetration testing, chaos engineering integration, support for self-hosted and multi-modal LLMs, advanced Git features like LFS, and even explorations into quantum-resistant encryption and blockchain integration for specific use cases. The ultimate goal is to create a comprehensive, intelligent, and adaptive development partner.

Development Roadmap

TDD Agent is an ambitious project with a phased development plan. Each stage builds upon the last, delivering increasing value and sophistication.

Our Vision for TDD Agent

Empowering Developers, Elevating Software Quality

At RODMENA LIMITED, our vision for TDD Agent extends far beyond simple code generation. We aim to create an indispensable AI partner for software developers, one that profoundly transforms how software is conceptualized, built, and maintained. We envision a future where Test-Driven Development is not a chore, but an intuitive, accelerated, and deeply integrated part_of the creative process.

TDD Agent is designed to be more than just a tool; it's a learning system. As it assists developers, it will continuously learn from interactions, feedback, and the vast landscape of code it processes. This means the agent will become increasingly adept at understanding complex requirements, anticipating edge cases, suggesting optimal coding patterns, and even identifying potential architectural improvements. The goal is to evolve TDD Agent into a system that not only writes tests and code but also offers insightful guidance, much like an experienced mentor.

We see TDD Agent playing a crucial role in democratizing best practices. By embedding principles of clean code, robust testing, and secure development into its core logic, it can help teams of all sizes and skill levels achieve higher standards of software quality. The planned plugin architecture will foster a vibrant ecosystem, allowing the community to extend TDD Agent's capabilities to new languages, frameworks, and specialized domains.

Ultimately, TDD Agent is about freeing developers from an_increasing amount of automatable_ TDD effort so they can focus on what they do best: innovation, creative problem-solving, and building software that makes a difference. We are committed to building a tool that is not only powerful but also ethical, transparent in its operations (especially regarding costs and LLM choices), and adaptable to the ever-evolving landscape of software development and artificial intelligence.

Ready to Revolutionize Your Workflow?

Join us on this exciting journey to redefine Test-Driven Development. Stay updated on our progress and be among the first to experience the power of TDD Agent.

Star on GitHub Get in Touch

Get In Touch

We'd love to hear from you! Whether you have questions, feedback, or want to discuss potential collaborations, feel free to reach out.

Farshid Ashouri

Founder, TDD Agent

RODMENA LIMITED

farshid.ashouri@rodmena.com
www.rodmena.com
Farshid Ashouri on LinkedIn
Farshid Ashouri on GitHub

For project-specific inquiries or support for TDD Agent:
support@tddagent.ai
Documentation (Coming Soon): tdd-agent.readthedocs.io
Report Issues: GitHub Issues