Lightning Talk Session: Property-Based Testing of Hardware

6th April 2017 in London at CodeNode

There are 33 other SkillsCasts available from F# eXchange 2017

Please log in to watch this conference skillscast.

628170028 640

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.


Thanks to our sponsors

Lightning Talk Session: Property-Based Testing of Hardware

Dale Dunlea

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.