needle icon indicating copy to clipboard operation
needle copied to clipboard

Idea: Expose CompilationPolicy/FindMethodSpec to enable better testing of structural features

Open hyperpape opened this issue 4 months ago • 0 comments

The DFAClassBuilder has several different ways of compiling a DFA to a Java class. The choice of which optimizations to apply is extremely important for performance, and can be easily modified by changes that don't break any functional tests.

We currently avoid regressions using the SnapshotTests, and the benchmarks. These are reasonably effective, but the benchmarks are too slow for the edit-compile-test cycle, and creating dozens of snapshot tests seems likely to become cumbersome (they produce binary files included in the repository, and the output when they fail is JVM bytecode diffs).

An alternate approach would be to allow tests to access the FindMethodSpec and CompilationPolicy from the DFAClassBuilder and make assertions about it.

hyperpape avatar Aug 23 '25 12:08 hyperpape