It turns out the device driver design established previously has a serious drawback. While the SpiDriver interface enables unit testing, the cost of polymorphism has to be paid also in production code. In this article you are going to see how high that cost is, i.e. how much extra code the compiler actually generates for providing virtual methods. We will also introduce one possible solution to overcome that additional cost.

This post has moved to my new blog: [deardevices.com](https://deardevices.com/2017/10/15/test-driving-the-mcp2515-can-controller-part-2/)! [![Dear Devices](https://steffen.ronalter.de/assets/deardevices.png)](https://deardevices.com/2017/10/15/test-driving-the-mcp2515-can-controller-part-2/)