[code-reflection] Integrated: More systematic binary op tests
Hannes Greule
hgreule at openjdk.org
Mon Apr 8 20:18:24 UTC 2024
On Sat, 16 Mar 2024 09:09:19 GMT, Hannes Greule <hgreule at openjdk.org> wrote:
> This is more of an experiment to gather some opinions. Please let me know what you think.
>
> With this change, I'm trying to cover interpreter and bytecode generation/execution of binary ops in a more systematic approach.
>
> I didn't find a good way to automatically *generate* test cases, especially as there is insufficient information about allowed types. Therefore, this approach consists of two main steps:
>
> 1. A test that ensures that all bin ops have at least one test case
> 2. Dynamic tests based on these test cases
>
> Note that these tests currently all fail. It seems like neither the interpreter nor the bytecode generator can deal with invokevirtual methods properly, so unboxing always fails.
>
> ## Alternatives
>
> One other idea I had was to, instead of going through the dynamic test cases, go through all methods in that class annotated with `@CodeReflection` and check this way if all bin ops are covered. This might allow for more extension to e.g. unary ops. The rest of the tests would then work as in other test classes. The problem of different data types and values would still exist though. Maybe a property-testing approach like `jqwik` would help with different values.
This pull request has now been integrated.
Changeset: 9cc35978
Author: Hannes Greule <hgreule at openjdk.org>
Committer: Paul Sandoz <psandoz at openjdk.org>
URL: https://git.openjdk.org/babylon/commit/9cc359783867c9567751207efe369cc08655754b
Stats: 293 lines in 1 file changed: 293 ins; 0 del; 0 mod
More systematic binary op tests
Reviewed-by: psandoz
-------------
PR: https://git.openjdk.org/babylon/pull/40
More information about the babylon-dev
mailing list