Research indexJournal article
Implementing a Java testing framework from scratch without reflection.
Bettini
The Journal of Object Technology1 Jan 2026Open access
NobleIDark:/48914/w1/20261105/B358D1F0DOI10.5381/jot.2026.25.2.a2
Implementing a Java testing framework from scratch without reflection.
Bettini · The Journal of Object Technology · 2026
NobleIDark:/48914/w1/20261105/B358D1F0DOI10.5381/jot.2026.25.2.a2
Free to read at the publisher
You can read the abstract here, or the full text at the publisher.
Abstract
Java reflection allows a program to inspect and manipulate program structure at run time and is a powerful mechanism used in many Java frameworks, including testing frameworks such as JUnit. However, reflection shifts key checks from compile time to run time and can introduce runner-level overhead; therefore, it is often desirable to avoid it when comparable functionality can be achieved with ordinary, statically checked mechanisms. In this paper, we present JNRTEST (Java no reflection Test), a Java testing framework built from scratch that avoids reflection, runtime annotations, and dynamic class loading. Instead, JNRTEST relies on object-oriented and functional programming mechanisms provided by modern Java: tests and lifecycle hooks are registered through explicit, typed APIs and executed directly by the runner, while integrations are implemented via an event-driven listener model. Overall, JNRTEST serves as a proof of concept that a practical Java testing framework can be built around a reflection-free core using ordinary, statically checked language mechanisms.