[code-reflection] RFR: More systematic binary op tests

Paul Sandoz psandoz at openjdk.org
Mon Apr 8 19:48:15 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.

Marked as reviewed by psandoz (Lead).

-------------

PR Review: https://git.openjdk.org/babylon/pull/40#pullrequestreview-1987284809


More information about the babylon-dev mailing list