Property-based testing is a form of testing that has been around for quite a while. LayoutTest is a form of property-based testing. In this video, Kyle mentions other testing frameworks that implement property testing, such as SwiftCheck. Property-based testing is popular in functional programming, but that doesn't mean you have to know functional programming to take advantage of it. Plus, learn how LayoutTest differs from the standard idea of property-based testing.
- [Narrator] LayoutTest borrows concepts…from something called property-based testing…which is popular in functional languages…like Haskell or Scala.…In this video we will learn a little bit…about what property-based testing is…and how it is used.…We will also look at how LayoutTest differs…from standard property-based testing.…The original implementation in Haskell…was called QuickCheck.…There's also an implementation in Scala called ScalaTest.…The framework generates random values…and method calls using generators.…You then define invariants or properties…that must hold true.…
After all the random calls are made with random data,…you test these invariants to make sure they hold true.…When a failure occurs,…the framework will tell you what path led to this failure…so that you can reproduce it and debug.…You can go a little more in depth with this…and write code to narrow down test data and calls…to make it easier to debug exactly what's going on.…You can make constraints for the random input as well…to make it so that certain issues that you know…
Released
3/9/2017- Installing the library
- Specifying test data
- Reviewing property-based testing
- Using test data and writing the LayoutTest test
- Testing views at different sizes
- Debugging with snapshots
- Dealing with common errors
- Advanced debugging tips
- Exploring catalog view
Share this video
Embed this video
Video: What is property-based testing?