Build fluency in the vocabulary of testing a general rule against many randomly generated inputs.
0 / 5 completed
1 / 5
At standup, a dev mentions defining a general rule that must always hold, like sorting a list twice producing the same result as sorting it once, and having a testing framework generate many random inputs to try to break that rule. What is this testing approach called?
Property-based testing defines a general rule, or property, that must always hold, like sorting a list twice producing the same result as sorting it once, and has a testing framework generate many random inputs specifically to try to break that rule. Example-based unit testing checks a fixed, hand-picked input and expected output, which only exercises the specific cases a developer thought to write. This randomized-input, invariant-driven approach is what lets property-based testing explore a far wider range of inputs than a developer would ever hand-write.
2 / 5
During a design review, the team wants a failing randomly generated input to be automatically reduced down to the smallest input that still reproduces the same failure, rather than leaving a developer to debug a large, complicated failing case. Which capability supports this?
Automatic shrinking reduces a failing randomly generated input down to the smallest input that still reproduces the same failure, turning a large, hard-to-read failing case into something a developer can actually debug quickly. Reporting only the original, full-sized generated input leaves a developer to manually untangle which part of a complicated case actually triggered the failure. This shrinking capability is what makes property-based testing's random inputs practical to actually debug once one of them fails.
3 / 5
In a code review, a dev notices a property test asserting that sorting a list twice always produces the exact same result as sorting it once, verified across a large number of randomly generated lists rather than one specific example list. What does this represent?
An idempotence property, verified across many randomly generated inputs, checks that sorting a list twice always produces the exact same result as sorting it once, regardless of what specific list the framework happens to generate. A single hand-picked example list checked once only verifies that particular case, saying nothing about a list the developer didn't think to test. This property, checked across a wide range of generated inputs, gives far broader confidence than any single fixed example could.
4 / 5
An incident report shows a bug triggered by an empty list input reached production undetected, because every example-based test the team had written happened to use a non-empty list, and nobody had thought to add that specific edge case by hand. What practice would prevent this?
Adding property-based tests whose random input generation naturally includes an edge case like an empty list catches exactly the kind of bug that slipped past hand-picked example-based tests in this incident, without requiring a developer to have thought of that specific case explicitly. Continuing to rely solely on example-based tests leaves the test suite dependent on a developer's own imagination for which edge case to cover. This broader, randomized coverage is a key reason property-based testing complements, rather than replaces, example-based testing.
5 / 5
During a PR review, a teammate asks why the team adds property-based tests instead of relying only on hand-picked example-based unit tests that already pass. What is the reasoning?
Example-based tests only cover the specific inputs a developer thought to write, which inherently limits their coverage to whatever edge cases occurred to that developer at the time. Property-based testing generates a much wider range of inputs, including an edge case a developer might never have considered, like an empty collection or an extreme numeric value. The tradeoff is that a property-based test requires the added upfront work of defining a genuinely general, always-true property, which isn't always as straightforward to articulate as a single concrete example.
What does the "Property-Based Testing Vocabulary" vocabulary exercise cover?
This exercise tests real IT vocabulary related to property-based testing vocabulary through 5 multiple-choice questions, each built from realistic workplace sentences rather than abstract definitions.
Is this vocabulary exercise free to use?
Yes. Every exercise on CoderSlingo, including this one, is completely free — no account, sign-up, or payment required.
How many questions does this exercise have?
This exercise has 5 questions. Each one shows a real-world sentence or scenario with multiple-choice options and an explanation once you answer.
What happens after I answer a question?
You'll see immediate feedback showing whether your answer was correct, along with a short explanation of why — then a button to move to the next question, and a full results screen at the end.
Can I retry the exercise if I get questions wrong?
Yes. Once you reach the results screen, click "Try again" to reset your answers and go through the exercise from the start as many times as you like.
Do I need to create an account to take this exercise?
No account is needed. Your answers are scored in your browser during the session — nothing is saved to a server, so you can jump straight in.
Is my progress saved if I leave the page?
No — progress within an exercise resets if you navigate away or reload. Each exercise is short enough to complete in a few minutes in one sitting.
Are these vocabulary exercises connected to other topics?
Yes — this module shares real-world context with 9 other vocabulary modules. See "Related vocabulary" below to keep building a connected skill set.
How is this different from reading a glossary or blog article?
Exercises like this one are active recall drills — you have to choose the correct term or phrasing yourself, which builds retention faster than passively reading a definition.
Where can I find more vocabulary exercises?
Browse the full Vocabulary exercises hub for hundreds of modules covering Agile, DevOps, security, databases, architecture, and more — organised by IT role and skill.