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

Explore outside-in invariant testing #99

Open
moodmosaic opened this issue Jan 21, 2025 · 0 comments
Open

Explore outside-in invariant testing #99

moodmosaic opened this issue Jan 21, 2025 · 0 comments
Labels
question Further information is requested

Comments

@moodmosaic
Copy link
Member

Currently, rv supports inside-out invariant testing, where invariants written in Clarity have direct access to contract state. While this works well, it might be worth exploring outside-in testing.

This approach was used in PoX-4 (stacks-network/stacks-core@57cc223), where rv didn’t yet exist. In @friedger's catamaran-swaps case, Clarity's design (e.g., no native iteration over a map of swaps) makes outside-in testing a suitable approach for verifying balances.

Using the same simnet instance and TypeScript tests, as shown for example in stacks-network/stacks-core@9905e7e, could make this possible.

Supporting both inside-out (tests in Clarity) and outside-in (tests in TypeScript) approaches would make rv more versatile, providing functionality that similar tools (e.g., on Ethereum) often focus on individually:

  • Inside-out (e.g., Echidna, dapp.tools, Foundry)
  • Outside-in (e.g., Ackee/wake)

This is a placeholder for discussion; more details will follow as we dig into this.

@moodmosaic moodmosaic added the question Further information is requested label Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant