Please log in to watch this conference skillscast.
Out of the box, property-based testing is a very effective tool for finding edge case failure modes. Even a fairly naive test will quickly find _if_ there is a problem. Through the effective use of types, a property-based test can also tell you a lot about what the actual problem might be. This greatly speeds up debugging if regressions are introduced, but it can also give insight into a system that is less deterministic, such as where a fault may be caused by hardware.
In this talk, you will explore an example of using property-based tests in F# to detect bit errors caused by "sticky-bits" in hardware. You will learn more specific types which will make the nature of the hardware error more apparent. With these more targeted types, you will then discover how custom shrink operations can quickly identify the exact error. With the test framework in place, you will learn how to use it to identify other non-sticky-bit hardware errors.
Dale used to do chip design, including an ECC SDRAM controller, where he encountered sticky-bit issues in real life. He then worked as a Linux kernel programmer and often lamented the difficulty in testing kernel code. As Dale has moved up the abstraction ladder and now works primarily in FP, he thought it would be nice to blend all of these together. Hopefully it might inspire you and more to leverage higher-level techniques when dealing with low-level projects.
YOU MAY ALSO LIKE:
- Janet Gregory's Agile Testing for the Whole Team (in London on 28th - 30th October 2019)
- Modern development with Java (in London on 9th - 11th December 2019)
- droidcon London 2019 (in London on 24th - 25th October 2019)
- P3X - People, Product & Process eXchange 2019 (in London on 31st October - 1st November 2019)
- Device Tree Driver (in London on 29th October 2019)
- Testing and UB (in London on 21st November 2019)
- Principled Testing of Functional Reactive Systems (SkillsCast recorded in October 2019)
- Testing in Production. From DevTestOops to DevTestOps (SkillsCast recorded in September 2019)
Lightning Talk Session: Property-Based Testing of Hardware
Dale is a software developer because he got electrocuted too often when he was in hardware. He writes F# for fun, Scala for profit, and Swift for mobile pet projects.