Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Generate tests based on the Branching Tree Technique.
| Date | Stars |
|---|---|
| 2026-07-24 | 351 |
| 2026-07-25 | 351 |
| 2026-07-28 | 351 |
| 2026-07-30 | 351 |
| 2026-08-06 | 351 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
<p align="center">
<img src="https://github.com/user-attachments/assets/036bad22-3b0d-4ea3-9338-faecd017a290" width="200"></a>
<br>
<a href="https://crates.io/crates/bulloak/">
<img src="https://img.shields.io/crates/v/bulloak?style=flat&labelColor=1C2C2E&color=C96329&logo=Rust&logoColor=white">
</a>
<a href="https://codecov.io/gh/alexfertel/bulloak">
<img src="https://codecov.io/github/alexfertel/bulloak/coverage.svg?branch=main">
</a>
</p>
# bulloak
A Solidity test generator based on the
[Branching Tree Technique](https://twitter.com/PaulRBerg/status/1682346315806539776).
- [Installation](#installation)
- [VSCode](#vscode)
- [Usage](#usage)
- [`bulloak scaffold`](#scaffold-solidity-files)
- [`bulloak check`](#check-that-your-code-and-spec-match)
- [Rules](#rules)
- [Compiler Errors](#compiler-errors)
- [Trees](#trees)
- [Terminology](#terminology)
- [Spec](#spec)
- [Output](#output)
- [Examples](#examples)
- [Contributing](#contributing)
- [Publishing](#publishing)
- [Supported By](#supported-by)
- [License](#license)
<!-- prettier-ignore -->
> [!WARNING]
> Note that `bulloak` is still `0.*.*`, so breaking changes
> [may occur at any time](https://semver.org/#spec-item-4). If you must depend
> on `bulloak`, we recommend pinning to a specific version, i.e., `=0.y.z`.
## Installation
```bash
cargo install bulloak
```
### VSCode
The following VSCode extensions are not essential but they are recommended for a
better user experience:
- [Solidity Inspector](https://marketplace.visualstudio.com/items?itemName=PraneshASP.vscode-solidity-inspector) -
syntax highlighting for `.tree` files
- [Ascii Tree Generator](https://marketplace.visualstudio.com/items?itemName=aprilandjan.ascii-tree-generator):
convenient way to generate ASCII trees
## Usage
`bulloak` implements two commands:
- `bulloak scaffold`
- `bulloak check`
### Scaffold Solidity Files
Say you have a `foo.tree` file with the following contents:
```tree
FooTest
└── When stuff is called // Comments are supported.
└── When a condition is met
└── It should revert.
└── Because we shouldn't allow it.
```
You can use `bulloak scaffold` to generate a Solidity contract containing
modifiers and tests that match the spec described in `foo.tree`. The following
will be printed to `stdout`:
```solidity
// $ bulloak scaffold foo.tree
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.0;
contract FooTest {
modifier whenStuffIsCalled() {
_;
}
function test_RevertWhen_AConditionIsMet() external whenStuffIsCalled {
// It should revert.
// Because we shouldn't allow it.
}
}
```
You can use the `-w` option to write the generated contracts to the file system.
Say we have a bunch of `.tree` files in the current working directory. If we run
the following:
```text
$ bulloak scaffold -w ./**/*.tree
```
`bulloak` will create a `.t.sol` file per `.tree` file and write the generated
contents to it.
If a `.t.sol` file's title matches a `.tree` in the same directory, then
`bulloak` will skip writing to that file. However, you may override this
behavior with the `-f` flag. This will force `bulloak` to overwrite the contents
of the file.
```text
$ bulloak scaffold -wf ./**/*.tree
```
Note all tests are showing as passing when their body is empty. To prevent this,
you can use the `-S` (or `--vm-skip`) option to add a `vm.skip(true);` at the
beginning of each test function. This option will also add an import for
forge-std's `Test.sol` and all test contracts will inherit from it.
You can skip emitting the modifier definitions by passing the `-m` (or
`--skip-modifiers`) flag. Functions will still reference these modifiers in
their signatures; only the modifier definitions themselves are omitted. This is
useful together with bulloak check `-m` (which suppresses missing‑modifier
violations). If you use `-m` alone, the scaffolded file will not compile unExcerpt of 16,249 characters
Read on GitHubWould you bet a product on this? Bounded 0–100 and slow moving.
matched fp:20ed18ccfbb24a8a, topic:testing