alexfertel / bulloak

A Solidity test generator based on the Branching Tree Technique.
Apache License 2.0
225 stars 13 forks source link

Feature request: GPT integration to shorten function and modifier names #39

Open PaulRBerg opened 9 months ago

PaulRBerg commented 9 months ago

Depending upon the contents of the *.tree file, the scaffolded Solidity code can end up somewhat verbose. It would be nice if there were a way to shorten the generated text using a LLM like GPT.

E.g. given this input:

├── when the deposit amount is greater than a specific value
│   └── it should revert
└── when the deposit amount is less than or equal to the specific value
    └── it should do smth

The following function names would be generated:

function test_RevertWhen_DepositAmountGreaterThanSpecificValue {}
function test_DepositAmountLessThanOrEqualToSpecificValue {}

Notice that the "the" and the "is" and the "a" terms have been removed.

Alternatively:

function test_RevertWhen_DepositAmountNotGT {}
function test_DepositAmountLTE {}
PaulRBerg commented 9 months ago

Another very interesting application of GPT would be to use it to write the tests themselves - not just scaffold the skeleton Solidity file.