8000 Better Theories support for generative testing · Issue #1160 · junit-team/junit4 · GitHub
[go: up one dir, main page]

Skip to content
Better Theories support for generative testing #1160
@rschmitt

Description

@rschmitt

The execution model for @Theory-based tests is virtually tailor-made for generative testing: you take some parameters and assert an invariant over them. However, based on my reading of the current Javadoc, all data points have to be known up front. They can still technically be generated if you use a @DataPoints-annotated factory method, but this results in all of the randomly generated test data being buffered in memory up-front.

My hunch is that this limitation can be traced back to one of the many, many limitations of the JUnit execution model (maybe it's unacceptable to not know all the test methods/cases up front?). If not, however, it would be really nice if an Iterator<T> (or Iterable<T>) could be returned from a @DataPoints method, rather than just an array.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0