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

symbolic: Refactor Testing library #434

Open
langston-barrett opened this issue Sep 4, 2024 · 0 comments
Open

symbolic: Refactor Testing library #434

langston-barrett opened this issue Sep 4, 2024 · 0 comments
Assignees
Labels
tech-debt Technical debt that would be nice to clean up testing Issues related to the test suite

Comments

@langston-barrett
Copy link
Contributor

While working on #430, I realized that Data.Macaw.Symbolic.Testing has pretty hacky ABI-neutral code to set up the program stack. It would be nice to use the ABI-specific stack setup code that fixing #430 would require in the test suites, both to improve the variety of binaries that could successfully be run through the test harness, and to test the stack setup code itself.

In order to accomplish this, we will need to refactor the main driver functions simulate{AndVerify,Function} to take the initial register and memory state as arguments. They can export functions to initialize this state the way it is done now, but different test-suites may choose not to use these defaults (e.g., the x86-symbolic test suite would instead set up the stack with the functions in #433). This will likely result in a more parsimonious organization of the code anyway.

Also, while I'm in the neighborhood, I find the ResultExtractor setup pretty strange. It seems weird that we feed the whole register and memory state to a callback and expect the callback to return a bitvector that we assert to be nonzero. Why not just give the callback the register and memory state and allow it to make whatever assertions it wants to? We can provide a helper for this nonzeroness assertion if we want.

I plan to fix these faults as part of working on #430.

@langston-barrett langston-barrett self-assigned this Sep 4, 2024
@RyanGlScott RyanGlScott added tech-debt Technical debt that would be nice to clean up testing Issues related to the test suite labels Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tech-debt Technical debt that would be nice to clean up testing Issues related to the test suite
Projects
None yet
Development

No branches or pull requests

2 participants