stack twitter tryhackme rss linkedin cross

Wilco van Esch

Skip to main content

Search results

    What are mutation testing, approval testing, and property-based testing?

    To-the-point definitions of some less-talked-about types of testing.

    Mutation testing

    Automatically generate "mutations" of an application under test and run your test suite against it in order to evaluate how capable your test suite is of identifying resulting issues. It serves to test the quality of the test suite (specifically its fault detection and code coverage), not the quality of the application under test.

    Notable tool: Stryker

    Approval testing

    Instead of asserting against expected behaviour, capture any differences between the current output and the previous output and if there are any differences have them evaluated by a human reviewer. An example would be Percy visual regression checks. Think of approval testing as blacklisting changes and assertion-based testing as whitelisting changes.

    Notable tool: ApprovalTests

    Property-based testing

    Instead of writing a specific test case asserting that the application under test has a certain property for a certain input, assert that the property remains valid for a wide variety of inputs. An example of a property in this context could be that the result of a particular calculation should never be a negative number. The test would check that this is true for a wide variety of automatically generated inputs to the calculation.

    Notable tool: Hypothesis