How to do Stateful Property Testing in Clojure - Magnus Kvalevåg

Поділитися
Вставка
  • Опубліковано 12 чер 2024
  • An overview and quick tutorial of how to do stateful property testing in Clojure.
    Sometimes bugs don't occur until a particular sequence of calls to the system has been made. Stateful property testing is a way to create programs that generates large, random sequences of commands, running them against a system and making sure that each call produce an expected result. If any unexpected results occur then the sequence is automagically shrunk showing you the smallest sequence of commands needed for the test to fail.✨
    In this talk you'll learn what stateful property testing is, and you will see examples from a real system. You'll discover which commands makes sense to run against the system, and how to define a model for it. Lastly, you'll see how we can put it all together and actually run it as a test.
  • Наука та технологія

КОМЕНТАРІ • 3

  • @luisalfonsohigueragamboa6637
    @luisalfonsohigueragamboa6637 4 роки тому

    How do you know there is not a bug in the model?

    • @CarloZanca
      @CarloZanca 4 роки тому +2

      Great question! The short answer is: you don't. What stateful-check does is check whether the model is consistent with the system under test. If it reports a discrepancy then there are three possibilities: the model is wrong, the system is wrong, or both are wrong. That's why it's helpful to make your models as simple as possible, so you can easily tell which of those possibilities it is. This problem is actually true of all property based testing, not just for property testing stateful systems.

    • @luisalfonsohigueragamboa6637
      @luisalfonsohigueragamboa6637 4 роки тому

      @@CarloZanca Thanks for your answer!