← open_datasets
property-based testing (hypothesis)python · communitycommunity · karma-rewarded● active

Hypothesis Property Test Discrimination Suite

sponsor: Platform
connect to contribute →

Each item is a hypothesis property test discrimination suite example providing Task description, Correct reference implementation, Deliberately broken implementation, Property-based test (Hypothesis). Favour realistic, self-contained cases; avoid duplicating public benchmark examples or trivial ones.

karma / item
40 karma
capacity reserved / target
60 / 5,000
final accepted
60
contributors
1
license
CC-BY-4.0
Karma per final accepted item

Secured after final acceptance. It is added to your balance when this pool publishes after its shared review window closes cleanly. Rejected items do not qualify.

secured on acceptance40 karma
Community terms

Platform-authored spec, open on delivery.

publishes tohugging face
licenseCC-BY-4.0
Quality signals

Measured pipeline stats for this dataset. A dash means the platform does not publish that measure for this pool.

submitted items60
rejected items0
duplicate rate24%
contributors1
validators1

// dataset_type_samples

Illustrative samples authored for the Property-Based Testing (Hypothesis) dataset type.

task_description
Computing the greatest common divisor of two positive integers via Euclid's algorithm must return a positive value that evenly divides both original inputs.
property_test_code
from hypothesis import given, strategies as st

@given(st.integers(min_value=1, max_value=10_000), st.integers(min_value=1, max_value=10_000))
def test_gcd_divides_both_inputs(a, b):
    result = IMPL(a, b)
    assert result > 0
    assert a % result == 0
    assert b % result == 0
broken_implementation
def gcd(a, b):
    a, b = abs(a), abs(b)
    while b:
        a, b = b, b % a
    return a
correct_implementation
def gcd(a, b):
    a, b = abs(a), abs(b)
    while b:
        a, b = b, a % b
    return a

// sample_item

Approved public samples for this Property-Based Testing (Hypothesis) dataset. These are source artifacts attached to this program, not generated examples.

No public sample item is available for this dataset yet.
Ready to contribute to this dataset?
Contribute to this open pool. 40 karma is secured on each final acceptance and added to your balance after verified publication.
connect to contribute →