You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Optimization mode can be treated as another test case provider, similar to property or assertion mode. This is a great issue for someone who is starting to work with medusa because it touches on medusa's most critical packages, how medusa uses the subscribe/publish model to handle fuzz testing, and how easy it is to create a new testing strategy in medusa.
I would recommend understanding how Echidna's optimization mode works first. At a high level, the optimization mode in Echidna tries to maximize some value x. It probably does this by storing the latest maximum, max, and upon the running of a new call sequence will check whether the new max is greater than max. If so, it overwrites max with the new maximum. Realistically, it doesn't matter what x is, what you care about is the return value of the echidna_opt (medusa_opt) function.
This can be done in medusa as well, please refer to test_case.go, test_case_assertion.go, test_case_assertion_provider.go, test_case_property.go, and test_case_property_provider.go. Similarly, you will probably create a test_case_optimization.go and a test_case_optimization_provider.go.
Here are some key considerations:
Support for optimization mode in the config and CLI. Should be disabled by default.
Use the property and assertion test case providers as examples on how to build out optimization mode.
Create a unit test or two that runs medusa in optimization mode.
The text was updated successfully, but these errors were encountered:
Optimization mode can be treated as another test case provider, similar to
property
orassertion
mode. This is a great issue for someone who is starting to work with medusa because it touches on medusa's most critical packages, how medusa uses the subscribe/publish model to handle fuzz testing, and how easy it is to create a new testing strategy in medusa.I would recommend understanding how Echidna's optimization mode works first. At a high level, the optimization mode in Echidna tries to maximize some value
x
. It probably does this by storing the latest maximum,max
, and upon the running of a new call sequence will check whether the new max is greater thanmax
. If so, it overwritesmax
with the new maximum. Realistically, it doesn't matter whatx
is, what you care about is the return value of theechidna_opt
(medusa_opt
) function.This can be done in medusa as well, please refer to
test_case.go
,test_case_assertion.go
,test_case_assertion_provider.go
,test_case_property.go
, andtest_case_property_provider.go
. Similarly, you will probably create atest_case_optimization.go
and atest_case_optimization_provider.go
.Here are some key considerations:
config
and CLI. Should be disabled by default.The text was updated successfully, but these errors were encountered: