-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Description
If I’m not missing something, the LUnit Parameterized Add-On allows defining test classes with variable parameters, enabling theory-like tests.
Currently, parameters are applied at the class level, meaning that the same parameter set is shared by all test methods in the class. This results in test methods being executed multiple times even when a specific method does not actually use a parameter-based approach.
In most modern unit testing frameworks (e.g. JUnit, NUnit, xUnit), parameterized or theory-style tests associate parameter sets with individual test methods rather than with the entire test class.
Problem
Applying parameters only at the class level introduces several limitations:
- All test methods are forced to share the same parameters, even when their test logic is unrelated.
- Test classes tend to grow artificially large or fragmented to accommodate different parameter sets.
- It reduces flexibility compared to theory-based testing approaches found in other frameworks.
Expected Behavior
It should be possible to define variable parameters at the method level, so that each test method can:
- Declare its own parameter set.
- Execute independently from other methods in the same class.
- Better reflect the intent of theory-style testing.
Possible approaches could include:
- Allowing parameter definitions to be associated with individual test methods.
- Supporting both class-level and method-level parameters
Motivation
Supporting method-level parameters would:
- Improve test clarity and intent.
- Reduce unnecessary class duplication or fragmentation.
- Make the Parameterized Add-On more expressive and closer to modern theory-based unit testing frameworks.