Usages of fuzzing
As discussed previously, it is very difficult to write tests that cover all possible user scenarios and parameter value ranges. The number of test cases to write and maintain can become even more time-consuming than project work. In this section, we will explore Go’s fuzz testing capability, which can help us write tests that cover a wide variety of inputs.
Fuzz testing is a powerful technique that has been used to find bugs in a wide variety of software systems, including the Go standard library itself. It involves generating a wide variety of values and using them as input to the UUT. The generated values stress-test the UUT and help uncover bugs or unexpected behavior such as panics, memory leaks, or incorrect outputs.
Fuzz tests are automated, black-box tests that can be used to detect any potential functional or security issues in our system. They are usually run using a fuzz tool, which takes care of value generation, test execution, and error detection...