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:
- Simon Brown's Software Architecture for Developers Workshop (in London on 22nd - 23rd May 2017)
- Fast Track to RESTful Microservices (in London on 24th - 26th May 2017)
- Alberto Brandolini's DDD Modelling Workshop (in London on 26th - 28th June 2017)
- µCon 2017: The Microservices Conference (in London on 6th - 7th November 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.