question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add Hypothesis Testing

See original GitHub issue

It may be beneficial to add hypothesis testing to some of our tests. Hypothesis testing allows for us to verify mathematical properties such as commutativity:

from hypothesis import given
import hypothesis.strategies as st

@given(st.integers(), st.integers())
def test_ints_are_commutative(x, y):
    assert x + y == y + x

This allows the CI to look for edge cases for us. This would be useful testing metrics. https://hypothesis.readthedocs.io/en/latest/

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:2
  • Comments:13 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
thomasjpfancommented, May 14, 2020

@Zac-HD Thank you for the link to the tutorial and your offer to help out! There are certainty a few interesting places for us to use property-based testing.

1reaction
Zac-HDcommented, May 14, 2020

👋 hi all, I’m not much of an ML person but I am particularly interested in open source and in testing scientific code (as my tutorial at SciPy might indicate). So if getting a Hypothesis core dev to review or discuss some tests would ever be useful, ping me and let me know how I can help!

Along with - or before - testing all the mathematical properties you might think of, I highly recommend getting Hypothesis to generate any valid data (i.e. including unusual formats) and just calling your code. No assertions needed, in my experience you’ll find a bunch of crashes, quickly improve your input validation, and probably fix some bugs too. Once you have that experience, testing ‘metamorphic properties’ is ludicrously effective

Read more comments on GitHub >

github_iconTop Results From Across the Web

Hypothesis Testing - Statistics How To
Watch the video for a brief overview of hypothesis testing: Intro to Hypothesis Testing ... In Bayesian testing you add prior knowledge to...
Read more >
Hypothesis Testing | A Step-by-Step Guide with Easy Examples
Hypothesis testing is a formal procedure for investigating our ideas about the world. It allows you to statistically test your predictions.
Read more >
A Beginner's Guide to Hypothesis Testing in Business
To become more data-driven, you must learn how to validate your business hypotheses. Hypothesis testing is the key.
Read more >
2.2 Hypothesis Testing
Hypothesis Testing. Practice Exercise 1: The null hypothesis states that there is. No Response A relationship between independent and dependent variables
Read more >
Hypothesis Testing Steps & Real Life Examples - Data Analytics
Hypothesis testing techniques are often used in statistics and data science to analyze whether the claims about the occurrence of the events are ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found