Skip to content

Property based testing to detect more (subtle and edge cases) bugs #12569

Open

Description

@Abdullahsab3

Is your feature request related to a problem or challenge?

Property based testing is a testing technique that can be used to ensure a certain property holds for a certain set of input. For example the associative property of addition:

$$ \forall a, b, c \in \mathbb{R} :\quad (a + b) + c = a + (b + c) $$

Property based testing is often used to test soundness/correctness of certain properties in interpreters, compilers and static analysis tools. As an example, property based testing is used to test certain lattice properties in the following static analysis tool (written in Scala) https://github.com/Abdullahsab3/maf/blob/master/code/shared/src/test/scala/maf/test/lattice/LatticeTests.scala

It might be interesting to use it for Apache Datafusion as well? I think bugs such as #12190 can be detected easier when this kind of tests are present. It might help improve the stability of Datafusion in the long run.

In the context of Datafusion, on top of my head, I think it might be useful to use this technique to test arithmetic properties between scalar values, time values, etc. There are likely more advanced use cases for property based testing in Datafusion wrt logical or physical plans.

In Rust the popular property based testing libraries are proptest (great documentation https://proptest-rs.github.io/proptest/intro.html) and Quickcheck (https://github.com/BurntSushi/quickcheck). Not sure how easy or feasible it is to use this technique in Datafusion or Arrow. Just an idea to share

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions