A test can pass while the software is wrong. That becomes especially easy when an AI assistant writes both the implementation and its tests: the same mistaken assumption may appear on both sides of the assertion. Property-based testing offers a useful way to challenge those assumptions. Instead of checking only a handful of expected answers, you describe a family of inputs and properties that every valid result must satisfy.
DeepSeek can help you articulate those properties, identify missing boundary cases, and explain a small failing example. Hypothesis, a Python property-testing library, can generate inputs and simplify failures. Your written contract and independently reviewed assertions decide whether the behavior is acceptable. This guide combines those responsibilities in a complete interval-merging example that runs locally without a model API call.
Our central bug is small enough to understand at a glance: two touching ranges cover the right values but remain incorrectly separated. A coverage test passes. Several appealing algebraic properties pass too. We will show what those tests miss, add the missing requirement, and build a repeatable workflow for using DeepSeek without outsourcing the definition of correctness.
Evidence note: all prompts, examples, and diagrams below were written for this guide. The prompts are templates, not transcripts of measured DeepSeek responses. The reported Python checks were executed offline; they evaluate the example code and tests, not DeepSeek’s accuracy or a production application.
Runnable download: get the interval-testing lab ZIP, including the implementation, tests, intentional failure demo, dependency versions, and captured results. Review the README before running the deliberately failing demo.
1. Start with a contract the model cannot silently change
Imagine a service that receives occupied positions in a sequence: byte regions in a local buffer, numbered cells in a simulation, or integer slices in a toy scheduling engine. Each pair describes a half-open interval. Its start is included and its end is excluded. The pair (2, 5) therefore covers the integer cells two, three, and four. This convention makes the interval’s length equal to the end minus the start.
The service needs a canonical union: a sorted collection of maximal ranges covering exactly the original cells. We choose to merge both overlapping and touching ranges. Consequently, the inputs (0, 1) and (1, 2) must become (0, 2). There is no uncovered cell between them. Another application might preserve boundaries because each range belongs to a different owner; that would be a different contract and would need different tests.
Write the input rules as deliberately as the output rules. This implementation accepts a list whose elements are two-item lists or tuples. Endpoints must be Python integers, with booleans rejected explicitly. A reversed interval is an error rather than an invitation to swap endpoints. Equal endpoints represent an empty interval and disappear. The function returns a new list of tuples and must not change the input collection or its inner lists.
These choices prevent several subtle disagreements. Python treats booleans as instances of its integer type, so a simple integer check accepts values that may actually be flags. Silently reversing endpoints can conceal an upstream indexing error. Accepting arbitrary iterables introduces separate questions about generators, exhaustion, and infinite input. We keep those questions outside this example by documenting a list-only boundary.
The contract also defines scope. This is an integer algorithm, not a date-time scheduler, floating-point geometry library, or inclusive-range implementation. It carries no ownership metadata. It does not preserve the number of original intervals. A correct union may contain fewer intervals and a different ordering. Do not ask a model to preserve those features unless they are real requirements; an unnecessary invariant can make a valid implementation look broken.
A useful first prompt asks for ambiguity detection before code. Give DeepSeek the contract and ask which decisions could change an assertion. Require it to distinguish an unanswered question from a confirmed requirement. Then resolve those questions yourself. That brief step is often more valuable than generating a longer initial test suite, because every later test inherits the meaning established here.
Review this contract before proposing code:
- Input: a list of two-item lists or tuples of integer endpoints.
- Reject bool and other non-integer endpoints with TypeError.
- Reject reversed intervals with ValueError; drop empty intervals.
- Merge overlap and touching boundaries into maximal half-open ranges.
- Return sorted nonempty tuples in a new list, without mutating input.
Identify ambiguities, then propose independent properties.
For each property, describe a wrong implementation that would still pass it.
Do not change the contract or claim that passing tests proves correctness.
2. Keep the first implementation small enough to inspect
The implementation has two phases. Validation creates a separate list of nonempty interval tuples and sorts it. The merge pass then walks those tuples once. If the next range begins at or before the current range’s end, the ranges overlap or touch, so the current end expands to whichever endpoint is greater. Otherwise, a new output range begins.
That description gives a reviewer concrete things to inspect. Sorting must use the start position consistently. Nested intervals must not shrink the current end. Empty ranges must not introduce artificial output entries. The condition for merging must include equality because the contract explicitly merges touching boundaries. A model-generated explanation should point to those decisions instead of merely saying the algorithm is efficient.
Save the following code as merge_intervals.py. Its deliberate simplicity makes it a useful subject for property testing: the reference idea is understandable without depending on a large framework. The implementation accepts integer subclasses other than booleans, as documented, but the generated test domain uses ordinary Python integers.
"""Merge integer half-open intervals; touching intervals are also merged.
Input must be a list of two-item lists/tuples. Endpoints must be ints, not
bools. Invalid types/shapes raise TypeError; start > end raises ValueError.
Empty intervals disappear. Return a new list of sorted, nonempty tuples
without changing the input. Python int subclasses other than bool are accepted.
"""
def _validated_intervals(intervals):
if not isinstance(intervals, list):
raise TypeError("intervals must be a list")
checked = []
for pair in intervals:
if not isinstance(pair, (list, tuple)) or len(pair) != 2:
raise TypeError("each interval must be a two-item list or tuple")
start, end = pair
if any(not isinstance(x, int) or isinstance(x, bool) for x in pair):
raise TypeError("endpoints must be integers, not booleans")
if start > end:
raise ValueError("start must be <= end")
if start < end:
checked.append((start, end))
return sorted(checked)
def merge_intervals(intervals):
merged = []
for start, end in _validated_intervals(intervals):
if merged and start <= merged[-1][1]:
previous_start, previous_end = merged[-1]
merged[-1] = (previous_start, max(previous_end, end))
else:
merged.append((start, end))
return merged
Sorting requires work that grows roughly with the number of inputs times its logarithm; the following merge scan is linear in the number of retained intervals. This describes the algorithm’s structure, not a measured performance guarantee. Integer comparison cost can also depend on endpoint size. The implementation allocates new collections, so it should not be described as an in-place or constant-extra-memory solution.
The main reason to show the implementation before the tests is transparency. You can see exactly which behaviors the tests attempt to challenge. In a real review, it is also useful to design some properties from the contract without reading the implementation first. That reduces the chance of accidentally writing the same loop twice and treating agreement between the copies as independent evidence.
3. Choose properties that fail for different reasons
A property is an assertion about a family of inputs. A good collection of properties approaches correctness from several directions. Some properties describe the meaning of the result, some describe its required shape, and some compare results after a controlled transformation. Treat them as complementary checks; a long list of closely related assertions can still leave the same blind spot.
Coverage preservation checks the meaning
For our bounded integer examples, an independent oracle can enumerate every covered cell in a set. The set built from the output must equal the set built from the input. This catches accidentally lost ranges, invented coverage, off-by-one endpoints, and a function that always returns an empty list. It directly checks the reason the merger exists: preserving the union.
The oracle is intentionally inefficient but conceptually different from the implementation. It does not sort ranges and repeat the same merging rule. It enumerates points. That independence matters more than speed for small generated fixtures. Keep the oracle’s domain small enough that enumeration is cheap, and do not generalize the technique to intervals spanning billions of cells.
Canonical shape checks the representation
Coverage alone permits many representations of the same union. The output could contain duplicates, overlapping ranges, or two touching ranges where the contract requires one. We therefore require every output interval to be nonempty and every consecutive pair to have a strict gap: the previous end must be less than the next start. That condition simultaneously rules out overlap, touching boundaries, duplicates, and backward ordering.
Notice how easy it is to weaken this requirement by one character. A less-than-or-equal assertion allows equality, which means touching output ranges pass. That assertion would be appropriate for ordinary nonoverlap, but ordinary nonoverlap is weaker than our canonical representation. Use the contract’s exact words when explaining why the strict comparison is necessary.

Idempotence checks stability
Merging an already merged result should produce the same result. This is called idempotence. It is useful for catching algorithms that require a second pass to finish consolidation. However, a function that always returns an empty list is also idempotent. So is a consistently wrong function that leaves every touching boundary intact. The property becomes valuable alongside coverage and canonical-shape checks.
Input transformations check hidden dependencies
The order of input ranges should not change their union. Our compact executable suite checks reversal of the input list. Reversal is one useful order transformation, not an exhaustive test of all permutations. You can add a generated permutation strategy when order sensitivity is a particular concern. Avoid claiming that a single reversal check proves permutation invariance.
Translation provides another useful extension. If the same integer offset is added to every endpoint, the output should shift by exactly that offset. This property can test very large coordinates without enumerating all cells between them. It is not part of the displayed passing suite, so treat it as an exercise to add rather than a result already established here.
Nonmutation checks a caller-visible promise
A function may compute the correct union while damaging its caller’s data. Sorting the supplied list in place is a common example. The test therefore takes a deep copy of the input, invokes the function, and checks that the original remains equal to the copy. It also checks that the returned list is a separate object. Generating both inner lists and tuples helps exercise this promise across the two accepted pair shapes.
For more complex objects, equality and a deep copy might not be enough. A method could change a cache, file, or database while leaving the visible collection unchanged. The promise being tested must match the observable state that matters to callers. Here the function is pure local computation, so the small-state check is appropriate.

4. Generate useful inputs instead of mostly rejecting them
Hypothesis strategies describe how test inputs are generated. The strategy below draws a start between negative ten and ten and a length between zero and ten. Adding the length to the start constructs a valid endpoint pair directly. A list strategy then combines these pairs into collections of up to twenty intervals, including the empty collection. A second representation turns some tuples into lists. [2]
This construction deliberately includes empty ranges, negative coordinates, repeated values, overlap, nesting, and touching boundaries. It does not guarantee that every interesting combination will appear in a particular run. The explicit touching example makes the central regression durable regardless of generated exploration. Hypothesis’s example decorator specifies an input that must be checked in addition to generated cases. [3, 4]
Constructive strategies are usually easier to understand than generating arbitrary endpoints and rejecting nearly every reversed pair. Filtering can be appropriate when the accepted region is reasonably broad, but heavy rejection spends the budget discarding inputs rather than exploring behavior. An early return is an especially misleading substitute: it may count as a passing test even though no assertion ran. [6]
Keep valid and invalid inputs in separate tests. A valid-input strategy should exercise the promised algorithm. Invalid-input tests should verify the promised exception type. Broadly catching every exception inside a generated test erases that distinction and can accidentally classify genuine implementation failures as expected rejection. The parameterized cases below include malformed shapes, booleans, non-integer endpoints, and reversed intervals.
Create a clean virtual environment, install pytest and Hypothesis, and save the test module as test_intervals.py beside the implementation. No DeepSeek key or network request is needed when executing these tests. The commands below assume a Unix-like shell; Windows users can invoke the virtual environment’s Python executable from its Scripts directory instead.
python3 -m venv .venv
.venv/bin/python -m pip install pytest hypothesis
.venv/bin/python -m pytest -q
To reproduce the exact dependency versions used for the reported run, download the lab and install its requirements-lock.txt with .venv/bin/python -m pip install -r requirements-lock.txt. The generic installation above follows the versions available when you run it; the lock file preserves this guide’s tested environment.
from copy import deepcopy
import pytest
from hypothesis import example, given, strategies as st
from merge_intervals import merge_intervals
# Construct valid intervals directly: start in [-10, 10], length in [0, 10].
pairs = st.tuples(st.integers(-10, 10), st.integers(0, 10)).map(
lambda pair: (pair[0], pair[0] + pair[1])
)
interval_lists = st.lists(st.one_of(pairs, pairs.map(list)), max_size=20)
def points(intervals):
# Independent, deliberately bounded oracle: enumerate covered integer cells.
return {x for start, end in intervals for x in range(start, end)}
@given(interval_lists)
@example([(0, 1), (1, 2)])
def test_coverage_and_canonical_shape(intervals):
result = merge_intervals(intervals)
assert type(result) is list
assert all(type(pair) is tuple and len(pair) == 2 for pair in result)
assert all(start < end for start, end in result)
assert points(result) == points(intervals)
assert all(left[1] < right[0] for left, right in zip(result, result[1:]))
@given(interval_lists)
def test_idempotence(intervals):
result = merge_intervals(intervals)
assert merge_intervals(result) == result
@given(interval_lists)
def test_reversal_invariance(intervals):
assert merge_intervals(intervals[::-1]) == merge_intervals(intervals)
@given(interval_lists)
def test_no_mutation(intervals):
before = deepcopy(intervals)
result = merge_intervals(intervals)
assert intervals == before
assert result is not intervals
@pytest.mark.parametrize("bad, error", [
(None, TypeError), (((0, 1),), TypeError), ([1], TypeError),
(["01"], TypeError), ([(0,)], TypeError), ([(0, 1, 2)], TypeError),
([(False, 1)], TypeError), ([(0, True)], TypeError),
([(0.0, 1)], TypeError), ([(0, 1.0)], TypeError),
([(0, "1")], TypeError), ([(None, 1)], TypeError),
([(2, 1)], ValueError),
])
def test_invalid_input(bad, error):
with pytest.raises(error):
merge_intervals(bad)
def test_empty_and_large_integer_examples():
assert merge_intervals([]) == []
assert merge_intervals([(1, 1), [2, 2]]) == []
n = 10**100
assert merge_intervals([(n, n + 1), (n + 1, n + 2)]) == [(n, n + 2)]
The point-set oracle checks integer cells rather than real-number membership. That is appropriate because all accepted endpoints are integers and the contract uses half-open intervals: every nonempty unit cell is represented by its starting integer. If you later accept fractions, timestamps, or continuous coordinates, do not assume this oracle remains valid. Revisit the mathematical domain before widening the strategy.
There is another boundary worth noticing: the generated starts and lengths constrain all covered points to a small finite region, but the function itself accepts arbitrary-size Python integers. The explicit large-integer test checks one touching pair far outside the generated coordinate range without enumerating its coordinates. That is useful supplementary evidence, not comprehensive coverage of every large-number case.
5. Understand a failure before asking the model to fix it
Consider changing the implementation’s merge condition from less-than-or-equal to strictly less-than. Overlapping intervals still merge, but touching intervals remain separate. With the explicit input [(0, 1), (1, 2)], the buggy implementation returns the same two ranges. Both input and output cover the integer cells zero and one. The coverage oracle therefore passes.
Idempotence passes too, because another merge attempt makes the same decision. Reversing the input passes because the implementation sorts it. Nonmutation passes because the algorithm works on its own list. A reviewer who checked only those properties could be reassured by an entirely green test report even though the written contract was violated.
The strict-gap property identifies the missing requirement. The first range ends at one and the next starts at one, so the previous end is not strictly less than the next start. This is a representation defect, not lost coverage. That distinction tells you where to focus: restore the equality case in the merge decision rather than rewriting the oracle or changing the definition of a half-open interval.
In the accompanying offline exercise, the deliberately buggy demo fails on this explicit decorated example. We do not claim that Hypothesis discovered or shrank that exact fixture in the reported run. It was chosen to make the contract violation clear and repeatable. When Hypothesis finds a generated failure, it normally attempts to simplify it; that process is called shrinking. The result is often easier to explain, but it is not a promise of a globally smallest counterexample or the same output on every version. [2, 3]
A useful debugging packet contains the contract, a minimal relevant implementation, the failing input, the actual output, the expected behavior, and the exact failed assertion. It should also say which checks passed. In this case, knowing that coverage still matches prevents a model from proposing an unnecessary endpoint adjustment that might introduce an off-by-one error.
Analyze this failure without changing the contract.
Contract: touching half-open integer intervals must merge.
Input: [(0, 1), (1, 2)]
Actual output: [(0, 1), (1, 2)]
Expected output: [(0, 2)]
Passing check: input and output cover the same integer cells.
Failing check: previous_end < next_start for consecutive outputs.
Explain the violated requirement, identify the smallest plausible code
change, and list the existing tests that should run after the fix.
Do not weaken the failing assertion to make the suite pass.
Before accepting a proposed patch, run the original failing case unchanged. Then run the full suite. A change that fixes adjacency can still mishandle nesting if it replaces the accumulated end with a smaller end. Preserve the failure as a regression test and review the diff against the original contract, using the same evidence-based approach described in our DeepSeek code review guide.
6. Use DeepSeek to challenge the test design
The most useful model request is often a challenge rather than an implementation request. Ask which incorrect functions would pass your proposed suite. A model may suggest an always-empty result, a no-op function, a merger that ignores equality, or a function that sorts the input in place. You can turn each suggestion into a deliberate mutation and check whether your assertions notice it.
This exercise reveals whether the suite tests the requirement you think it tests. If an always-empty result passes, semantic preservation is missing. If an in-place sort passes, nonmutation is missing. If touching ranges pass unmerged, canonical representation is missing. Mutations are hypotheses about blind spots; they still need to be applied and run locally before you describe them as detected.
Ask DeepSeek to separate three outputs: confirmed defects, possible gaps, and optional improvements. A confirmed defect should include a concrete input and a violated contract clause. A possible gap may identify an untested domain, such as enormous coordinates. An optional improvement may suggest a clearer helper name. Mixing those categories can turn a style preference into a false correctness claim or hide a real bug among cosmetic suggestions.
Review these tests against the interval contract.
Return three sections: confirmed defects, test gaps, optional improvements.
For each confirmed defect, provide a concrete counterexample and explain
which contract clause fails. For each property, name one faulty behavior
it cannot detect. Suggest constructive Hypothesis strategies only where
they expand meaningful coverage. Do not call live APIs inside tests.
If the supplied evidence is insufficient, say what must be run locally.
You can use these prompts in a chat interface or as the content of a chat-completion request. DeepSeek’s official API documents a messages-based conversation interface, so there is no need to invent a special testing endpoint. Select a currently supported model from the official documentation or your application configuration; this tutorial intentionally avoids hard-coding a model alias that may change. [1]
Keep the model outside the generated-test loop. A property test may execute its body repeatedly during generation, replay, and simplification. Calling a hosted model for each input adds cost, latency, changing responses, and another service’s availability to what should be a local correctness check. It also makes a failure harder to reproduce. Ask the model for code once, review it, then run ordinary Python tests against that saved code.
If your actual application is itself model-based, the problem changes. You may need a versioned set of model responses, a separate integration evaluation, and explicit tolerances for nondeterministic behavior. Do not quietly replace deterministic unit properties with an LLM judge and report the resulting score as equivalent evidence. Keep the boundary between algorithm tests and model evaluation visible in your report.
Use synthetic, reduced fixtures when requesting help. There is no reason to upload real customer schedules or private document offsets to explain the adjacency bug. The small integers in this guide contain all necessary structure. If production data is involved, review what leaves your application first; our DeepSeek data-minimization guide explains that preparation step.

7. Make a failure survive the next run
A useful failure is one another developer can reproduce. Record the Python version, Hypothesis version, pytest version, command, relevant settings, and test source revision. Include the failing input in a form that can be copied into a regression test. A screenshot of a red terminal is less useful than the exact assertion and a small fixture stored beside the code.
Hypothesis can use an example database to save and replay interesting inputs. Whether a persistent database is active depends on the chosen profile and settings. Current documentation describes different local and continuous-integration defaults, so do not assume every environment will preserve failures under a local directory. Check the effective configuration and decide deliberately whether the database is retained or recreated. [3, 4]
For a meaningful business-rule regression, an explicit example is straightforward and reviewable. The touching-range fixture communicates why equality matters even to someone who never saw the original failure. An explicit example is not shrunk; it is already the fixture you chose. Keep it small enough that its purpose remains obvious, and explain its connection to the contract in a comment when necessary. [4]
A reproduction blob can be useful for temporarily replaying a generated failure, but it is tied to a particular Hypothesis version. Treat it as a debugging aid rather than your sole long-term regression record. Likewise, deterministic generation settings can improve repeatability without freezing every future run across Python, dependency, or test changes. Lock dependencies when comparing a specific result, and retain human-readable examples for important bugs. [3, 4]
Flaky tests require a different investigation. If the same input alternates between pass and fail, look for mutable global state, uncontrolled time, network calls, randomness outside the test framework, or leftover files. Restore the relevant state between generated examples. Hypothesis needs failures and the sequence of data draws to reproduce reliably for its debugging process to work. Suppressing a warning does not repair an unstable oracle. [5]
Our example keeps all computation in memory and makes no network calls during tests. That narrow boundary is intentional. It lets you focus on the algorithm and assertions without interpreting a failed request, changed remote response, or stale service state. Add integration tests separately if the merger later becomes part of an API or database workflow.
8. Choose a budget and report exactly what ran
Generated testing explores a space; it does not exhaust arbitrary input sizes. Start with a strategy whose values are small enough to understand and whose assertions are cheap. A bounded list of twenty short intervals is already capable of expressing duplicates, containment, chains of overlaps, emptiness, and disconnected groups. Larger examples are useful only when they test a behavior the smaller domain cannot reveal.
Hypothesis’s maximum-examples setting is not a simple exact cap on all test-function invocations. Replay, explicit examples, rejected inputs, and shrinking affect execution. Avoid translating that setting into a claim such as “exactly one hundred random cases were tested.” Report the setting, the test outcome, and the relevant domain instead. Use statistics from the actual run if you need more detailed execution evidence. [3]
For fast pull-request checks, choose predictable small domains and avoid external services. A separate scheduled job can explore broader sizes or additional strategies if your project needs it. Make the distinction explicit in configuration so a developer can reproduce the same profile locally. Disabling a per-example deadline may make sense in some environments, but it should not conceal an accidentally unbounded oracle or a severe performance regression.
The offline verification for this guide used Python 3.12.14, pytest 9.1.1, and Hypothesis 6.168.3. Normal test discovery passed all eighteen pytest cases. That count includes four generated test functions, thirteen parameterized invalid-input cases, and one explicit empty/large-integer test function. It is a count of pytest cases, not the number of generated inputs explored.
The deliberate buggy demo was run separately and failed as expected at the strict-gap assertion for the explicitly supplied touching pair. It is not included in the ordinary passing test filename pattern. This separation keeps the normal command useful while preserving a clear teaching demonstration of what the suite should reject. No paid model API call was used, and no inference about DeepSeek’s model quality follows from these results.
A separate exhaustive check compared every ordered list of zero through four valid intervals with endpoints from negative two through two against a point-cell oracle that independently reconstructs maximal consecutive runs. All 54,241 inputs matched the canonical result and preserved their inputs. A separate seeded Hypothesis search also generated and simplified the touching pair shown above. These bounded checks strengthen the example without establishing correctness for every possible input.
Do not publish a test summary that says only “all tests passed.” A useful summary identifies the implementation tested, the input domain, the independent oracle, the intentional failure, and the limits. That gives a future maintainer enough information to decide what additional evidence is needed when the contract expands.
9. Review the suite before trusting the green result
Read each assertion as a requirement and ask what it excludes. Does coverage reject missing data? Does canonical form reject redundant representations? Does a nonmutation check observe the objects callers care about? Do invalid-input tests verify specific exceptions? If you cannot connect an assertion to a contract clause, clarify its purpose or remove it rather than accumulating unexplained checks.
Then reverse the question: does every important contract clause have evidence? List-only input, pair shape, boolean rejection, reversed endpoints, empty intervals, touching boundaries, output tuples, and input preservation are separate promises here. An impressive generated strategy does not compensate for a missing assertion. A deterministic example may be the clearest evidence for a narrow rejection rule.
Keep expected results independent where practical. For this example, the point set and the strict-gap condition approach the problem differently from the merge loop. For a parser, a round trip can be useful but may hide two mutually compatible bugs in the encoder and decoder. For normalization, idempotence does not prove that meaningful distinctions are preserved. The question is always which wrong behavior can satisfy the property.
Use AI-generated fixtures as starting material, then validate their labels and assumptions. Property-based generation serves a different purpose: it produces many inputs from a reviewed strategy at execution time. Both approaches can complement manually selected boundary examples. Our synthetic test data guide covers fixture quality; this guide focuses on the relationships that every generated result should satisfy.
Does passing property-based testing prove correctness?
No. The passing result covers the assertions and explored inputs under the tested environment. The assertions may be incomplete, the strategy may exclude important cases, and the implementation may fail outside the explored domain. Property testing provides strong practical counterexample search, especially when the oracle is independent and the contract is precise. Formal proof and exhaustive verification make different, more demanding claims.
Should DeepSeek write the implementation and tests together?
It can draft both, but review the tests from the contract rather than accepting agreement between two generated artifacts. Ask for counterexamples that defeat weak properties, inspect the strategies, and deliberately introduce a small defect to confirm that the expected assertion fails. A shared mistake between implementation and test is still a mistake, even when the code looks polished.
What should happen when a test and the product requirement disagree?
Resolve the requirement first. If users need to preserve boundaries between touching ranges, our strict-gap assertion would be wrong for their application. Update the written contract, explain the changed semantics, and revise the tests accordingly. Do not change the assertion merely because it is red; a test failure is evidence of a disagreement that needs an accountable decision.
What is the smallest useful starting point?
Choose one pure function, one bounded constructive strategy, one semantic oracle, one representation check, and one explicit regression. Run that locally and inspect the failure output. Once the loop is understandable, add transformations, invalid-input cases, and broader domains. A compact suite whose blind spots you can explain is a better foundation than a large suite whose green result you cannot interpret.
Bottom line: use DeepSeek to help formulate and challenge the specification, then make the evidence executable. In this interval example, the decisive insight is that equal coverage does not imply the required representation. The combination of coverage, canonical shape, stability, input preservation, and explicit boundary cases turns that insight into a practical test suite you can maintain.
Sources & References
Primary documentation checked for this guide on October 4, 2026. Library behavior can change; consult the version used by your project. Links below are external and open in a new tab.
- DeepSeek: Create Chat Completion — conversation messages and the current API request contract.
- Hypothesis: Strategies reference — integer bounds, list and tuple strategies, composition, and simplification behavior.
- Hypothesis: API reference — given, example, settings, profiles, phases, deadlines, and reproducibility limits.
- Hypothesis: Replaying failures — example databases, explicit regressions, and reproduction blobs.
- Hypothesis: Flaky failures — reproducible failures, state, and nondeterminism.
- Hypothesis: Adapting strategies — map, filter, assume, and avoiding ineffective rejection patterns.

[…] the site’s guide to DeepSeek code review complements this narrow arithmetic assignment. The property-based testing guide is useful when expanding generated cases, while requirements analysis can help turn an unresolved […]
[…] not mutate the caller’s mapping. These are useful candidates for the methods discussed in DeepSeek and property-based testing, although the essential examples should remain readable without an additional testing dependency. […]
[…] test, first write down what the graph contract requires and why. Then run the test locally. Our property-based testing workflow explores the same habit of checking general relationships; the lab here stays within the standard […]
[…] property-based testing guide uses interval merging to explain Hypothesis and shrinking. This tutorial extends that foundation to […]