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:
- LDNUG September 2017 - #ProgNET Special with Richard Campbell (in London on 12th September 2017)
- Progressive .NET 2017 (in London on 13th - 15th September 2017)
- London Unreal Engine Meetup (in London on 20th September 2017)
- Fast Track to F# with Tomas Petricek & Phil Trelford (in London on 16th - 17th October 2017)
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.