The intelligent system automating Test-Driven Development. Let AI accelerate your workflow, improve code quality, and reduce development time.
Discover Features View on GitHubTDD 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.
TDD Agent is packed with powerful features designed to automate and streamline your Test-Driven Development workflow.
Automatically generate comprehensive pytest test cases from plain English requirements, ensuring full test coverage from the start.
TDD Agent intelligently creates Python implementations that satisfy the automatically generated tests, accelerating your development.
When tests fail, the agent automatically analyzes failures and generates targeted fixes, re-running tests until they pass or max iterations are reached.
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).
Monitor and analyze LLM usage costs with detailed breakdowns per-model, per-task, and per-project, including budget limits and alerts.
Automatic version control with meaningful commits at each stage of the TDD cycle, from initial project setup to successful fixes.
Easily create, pause, and resume TDD projects. The agent maintains project state, allowing for interruptions and continuations.
Secure user accounts with JWT authentication, ensuring your projects and data are protected.
Interact with TDD Agent via a powerful command-line interface or integrate it into your existing workflows using its RESTful API.
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:
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.
TDD Agent is an ambitious project with a phased development plan. Each stage builds upon the last, delivering increasing value and sophistication.
Goal: Demonstrate core feasibility: Can we generate tests from prompts and code from tests?
Key Achievements: Basic test generation from natural language requirements, initial code generation to pass those tests, and fundamental file system operations. Successfully connected to OpenAI and parsed LLM responses.
Goal: Deliver a core, functional TDD loop with user authentication, project persistence, and Git integration.
Key Features: User registration/login (JWT-based), database persistence for users and projects (SQLAlchemy & Alembic), complete TDD loop with iterative refinement for fixing failing tests, automated Git commits for all significant changes, basic CLI, LLM cost tracking, and a foundational REST API.
Goal: Showcase a complete TDD workflow with Docker, multiple LLM support, a professional UI/CLI, team features, basic analytics, webhooks, and a payment system skeleton.
Key Additions: Docker containerization for test execution, integration of multiple LLM providers (e.g., Anthropic Claude, Google Gemini alongside OpenAI), team collaboration features (organizations, team project sharing), email and webhook notifications, Stripe integration for subscription plans, enhanced CLI with interactive elements, and basic user activity analytics.
Goal: Implement all core features with advanced error handling, performance optimization, initial security measures, an admin dashboard, and the foundation for a plugin architecture.
Key Additions: Caching layers (Redis) for performance, security scanning (Pylint, Bandit, pip-audit), admin dashboard for user and system management, plugin system foundation, AI learning engine basics (feedback collection, pattern storage), advanced resilience patterns (circuit breakers, bulkheads), enhanced API (WebSockets), and feature flag system.
Goal: Deliver a feature-complete system with an activated AI learning engine, advanced analytics, multi-tenancy support, internationalization (i18n), an SDK for developers, and validated load testing.
Key Additions: Full AI learning system (spaced repetition, model benchmarking), complete i18n for multi-language UI and content, multi-tenant architecture with data isolation, developer SDKs (Python, JavaScript) and IDE plugins, advanced business analytics (churn prediction, LTV), comprehensive load testing, zero-downtime migration/upgrade paths, and disaster recovery procedures.
Goal: A production-ready, fully tested, secure, and scalable system with comprehensive documentation and support.
Key Additions: Security penetration testing, chaos engineering validation, advanced AI features (fine-tuning, GANs, XAI), enterprise-grade features (VPC isolation, cross-org collaboration), complete documentation, operational support systems, and accessibility compliance. Exploration of exotic capabilities like blockchain integration and multi-modal LLM inputs.
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.
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 TouchWe'd love to hear from you! Whether you have questions, feedback, or want to discuss potential collaborations, feel free to reach out.
Founder, TDD Agent
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