Typically, people test the scenarios they can mentally conceive: good cases, bad cases, edge cases etc. However, there are always "unknown unknowns." To ensure that we are not blindsided by such scenarios, we get pre-built libraries to generate random and/or full-permutation test cases for us. We run this for math operations, staking calculations, and wherever else it makes sense.