PHPackages                             jordimorillo/tdg-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. jordimorillo/tdg-php

ActiveProject

jordimorillo/tdg-php
====================

A Test Driven Generative Development tool to make the code parting from tests

v1.0.0-beta.1(1y ago)018MITPHPPHP ^8.0

Since Jul 7Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/jordimorillo/tdg-php)[ Packagist](https://packagist.org/packages/jordimorillo/tdg-php)[ RSS](/packages/jordimorillo-tdg-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (5)Versions (2)Used By (0)

TDG-PHP
=======

[](#tdg-php)

TDG-PHP is a tool for generating and testing PHP code based on provided tests. It utilizes a code generation service and runs tests to ensure the generated code meets the requirements specified in the tests.

Installation
------------

[](#installation)

To install TDG-PHP in your project, run the following command:

```
composer require jordimorillo/tdg-php
```

Usage
-----

[](#usage)

Once installed, you can use the `tdg-php` command to generate and test code based on a PHP test file. The command is executed as follows:

```
./vendor/bin/tdg-php path/to/test/file.php
```

### Parameters

[](#parameters)

- `path/to/test/file.php`: The path to the PHP test file that will be used to generate the code.

### Example Usage

[](#example-usage)

```
./vendor/bin/tdg-php tests/ExampleTest.php
```

Configuration
-------------

[](#configuration)

To ensure the tool works correctly, certain environment variables need to be configured. Below are the necessary variables and their purposes:

- `PROJECT_ROOT`: The root path of the project.
- `PHPUNIT_XML_PATH`: The path to the PHPUnit configuration file.
- `BASE_NAMESPACE`: The base namespace of the project.
- `TESTS_BASE_NAMESPACE`: The base namespace for the tests.
- `API_KEY`: The API key for the code generation service.
- `MAX_ATTEMPTS`: The maximum number of attempts to generate valid code.
- `PERMANENT_ATTACHMENTS`: Additional files that will always be attached in the code generation process.

### Example `.env` File

[](#example-env-file)

```
PROJECT_ROOT=/path/to/project
PHPUNIT_XML_PATH=/path/to/phpunit.xml
BASE_NAMESPACE=App
TESTS_BASE_NAMESPACE=Tests
API_KEY=your_api_key
MAX_ATTEMPTS=5
PERMANENT_ATTACHMENTS=src/Helper.php,src/Utils.php
```

Development
-----------

[](#development)

### Requirements

[](#requirements)

- PHP 8.0 or higher
- Composer
- PHP cURL extension

### Running Tests

[](#running-tests)

To run the tests, use the following command:

```
composer test
```

Contributing
------------

[](#contributing)

Contributions are welcome. Please open an issue or submit a pull request to contribute to the project.

License
-------

[](#license)

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.

### Additional Requirements

[](#additional-requirements)

For the tool to work, it is necessary to install Llama3 locally.

---

👤 Autor
-------

[](#-autor)

**Jordi Morillo Sells** — [LinkedIn](https://www.linkedin.com/in/jordi-morillo-sells/)

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance70

Regular maintenance activity

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

670d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bacc6bae7a5e994d4461613e7919ed98a4793f38774ddaa7c4835bb147fad741?d=identicon)[georgedreamer](/maintainers/georgedreamer)

---

Top Contributors

[![jordimorillo](https://avatars.githubusercontent.com/u/11392091?v=4)](https://github.com/jordimorillo "jordimorillo (34 commits)")

###  Code Quality

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/jordimorillo-tdg-php/health.svg)

```
[![Health](https://phpackages.com/badges/jordimorillo-tdg-php/health.svg)](https://phpackages.com/packages/jordimorillo-tdg-php)
```

###  Alternatives

[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[magento/magento2-functional-testing-framework

Magento2 Functional Testing Framework

15511.5M30](/packages/magento-magento2-functional-testing-framework)[neuron-core/neuron-ai

The PHP Agentic Framework.

1.8k245.3k20](/packages/neuron-core-neuron-ai)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M385](/packages/shopware-core)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[oat-sa/tao-core

TAO core extension

66136.7k74](/packages/oat-sa-tao-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
