Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High level testing API #51

Open
Xenomega opened this issue Dec 1, 2022 · 2 comments
Open

High level testing API #51

Xenomega opened this issue Dec 1, 2022 · 2 comments
Assignees
Labels
low-priority on hold This issue was marked as not desirable to complete for now

Comments

@Xenomega
Copy link
Member

Xenomega commented Dec 1, 2022

We currently have a good way to extend testing methodology using a lower level API. We'll want to add methods like RegisterTestCase and ReportTestCaseFinished into a higher level testing suite object that also wraps CallSequenceTestFunc and makes writing complex post call/event properties (per contract, method, or globally) just a few lines of code. It should contextualize all important info about the current state of execution in a test context object.

For more info, see here:
https://github.com/trailofbits/medusa/wiki/API-Overview-(WIP)#extending-testing-methodology

We envision this should look like for generic callback that just broadly take arguments for any call:
fuzzer.Testing.AddPostCallTest(contractName, functionName, callBackThatProvidesArgsAndTestContext)
fizzer.Testing.AddPostEventEmitTest(eventID, callback)

While we can also make method specific arguments that need to match the signature (but in Go) and will direct outputs into that callback's input, so we can (e.g. match our property test callback with event argument types, and the test suite will populate them for us through reflection maybe)?

@Xenomega Xenomega added the on hold This issue was marked as not desirable to complete for now label May 2, 2023
@Xenomega Xenomega self-assigned this May 2, 2023
@Xenomega
Copy link
Member Author

Xenomega commented May 2, 2023

More info to extend this later (in a separate issue that should be opened following this one):

A front end testing suite with consideration for Go interface generation for Solidity smart contracts. Building a testing harness around this that plugs into medusa will allow for complex contract deployments, simplification of testing provider code (assertion, property, others), capabilities to write complex custom testing logic with ease, custom cheat code integration, and more. This will inherently tell us where we should invest into API improvements to make querying of complex data easier, and help us standardize our Go API.

@anishnaik
Copy link
Collaborator

This API refactor should also aim to tackle #191 and #179

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
low-priority on hold This issue was marked as not desirable to complete for now
Projects
None yet
Development

No branches or pull requests

2 participants