Pretty much any function in SymPy that can have mathematical properties written about it could potentially benefit from property testing. However, a big challenge with this project is the input data generation (the strategies in hypothesis terminology). Generating arbitrary SymPy expressions is a difficult problem. There was some initial work on this at https://github.com/sympy/sympy/pull/17190. But the problem is that just generating expressions itself can be buggy. Consider the expression I posted about in another mailing list thread. It takes 8 seconds just to construct, essentially because the expression constructor itself is buggy. https://groups.google.com/g/sympy/c/XSJuvibPOro/m/Q3TTETm7AwAJ
So for now, it's better to actually focus on those functions that take relatively simple inputs. The simplest possible input is an integer. For instance, several functions in the ntheory module basically just take an integer as input. The next simplest is polynomials. The initial work that has been done on hypothesis testing has been in these modules, but the work hasn't gone very far and there is still more that can be done there. So I would suggest starting where there are existing hypothesis tests and expanding the tests in those parts of SymPy. We'll want to expand beyond that, but building strategies is one going of the harder parts of this project. By the way, if you didn't notice on the idea page, this issue has a lot more details on hypothesis testing in SymPy https://github.com/sympy/sympy/issues/20914. Aaron Meurer On Tue, Mar 4, 2025 at 2:19 AM Pradyot Ranjan <[email protected]> wrote: > > What are the components that can benefit most out of hypothesis testing? I > can try to implement them before I start writing a proposal it that's okay. > > On Tue, 4 Mar, 2025, 4:29 am Pradyot Ranjan, <[email protected]> > wrote: >> >> Last year I worked as a GSoC student for PyBaMM. We had a stretch goal >> regarding the implementation of hypothesis testing which can be tracked here >> : >> - https://github.com/pybamm-team/PyBaMM/issues/4703 >> I also reviewed some PRs regarding this : >> - https://github.com/pybamm-team/PyBaMM/pull/4724 >> >> Other than this I also worked as an LFX mentee last year where I implemented >> Fuzz testing (which is similar to Hypothesis's property-based testing in >> some ways). >> >> >> On Tue, 4 Mar, 2025, 3:23 am Aaron Meurer, <[email protected]> wrote: >>> >>> Yes, that project is still very relevant. If you search the codebase >>> for hypothesis you'll see that it is currently only used in a few >>> tests, but we want that to increase by a lot. >>> >>> What sort of experience do you have with hypothesis? >>> >>> Aaron Meurer >>> >>> On Mon, Mar 3, 2025 at 1:53 PM Pradyot Ranjan <[email protected]> >>> wrote: >>> > >>> > Hi, >>> > Just wanted to know if this project is still relevant regarding GSoC? If >>> > it is, who is the mentor? >>> > I have some experience with hypothesis testing and would love to work >>> > here. >>> > >>> > Thanks, >>> > Pradyot Ranjan >>> > >>> > -- >>> > You received this message because you are subscribed to the Google Groups >>> > "sympy" group. >>> > To unsubscribe from this group and stop receiving emails from it, send an >>> > email to [email protected]. >>> > To view this discussion visit >>> > https://groups.google.com/d/msgid/sympy/afa7d863-666f-475f-ae4c-1ccb8a5d3752n%40googlegroups.com. >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "sympy" group. >>> To unsubscribe from this group and stop receiving emails from it, send an >>> email to [email protected]. >>> To view this discussion visit >>> https://groups.google.com/d/msgid/sympy/CAKgW%3D6Jj85nrRpoBWnz7uwziokTKHquJDP%3Dbt8YFuZQi5pTwew%40mail.gmail.com. > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion visit > https://groups.google.com/d/msgid/sympy/CANENgK7CmETia1vkWPr2pTrN3mNi1r%2B%2B-ALPAcPQcmaw9uvA3w%40mail.gmail.com. -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/sympy/CAKgW%3D6Lwsx_W7P4rn9om2ZemuKdF4Ad-fEnmfayzvnWSD4k6QQ%40mail.gmail.com.
