random number generator
Code that produces unpredictable-looking numbers or choices, such as Python's random module.
In more detail
Python's random module is pseudo-random: it computes its sequence from a seed. Code that accepts a generator as an argument can be tested with a tiny object whose choice method returns a known value.
Related terms
- random seed — The starting value of a pseudo-random number generator; the same seed always produces the same sequence of numbers.
- seam — A place in the code where you can swap in different behaviour without editing the code itself, such as a parameter.
- deterministic — Always producing the same result from the same inputs, with nothing left to chance or timing.
Taught in
- Testing Time And Randomness — Automated Testing, TDD & Quality Engineering