Property-Based Test - CI/CD用語集の定義
property-based testとは、手作業で選んだいくつかの例に対してアサーションするのではなく、自動生成された多数の入力に対してある性質が成り立つことを検証するテストで、自分では書こうと思わないエッジケースを浮かび上がらせます。
性質の例
reverse([1,2,3]) == [3,2,1]をテストする代わりに、任意のリストについて2回反転すると元に戻ることをアサートします。QuickCheck、Hypothesis、fast-checkといったツールが数百のケースを生成します。
Shrinking
性質が失敗すると、frameworkは失敗した入力を、まだ壊れる最小のケースまで縮小し、バグの診断を格段に容易にします。
関連ガイド
Fuzz Test - CI/CD Glossary DefinitionFuzz Test: A fuzz test feeds a program large volumes of random, malformed, or unexpected input to find crashe…
Snapshot Test - CI/CD Glossary DefinitionSnapshot Test: A snapshot test records the output of code (a rendered component, a serialized object) to a st…
Mutation Score - CI/CD Glossary DefinitionMutation Score: A mutation score is the percentage of injected code mutations (deliberate bugs) that a test s…