SPA Conference session: API Design as if Unit Testing Mattered

One-line description:Learn how to write APIs which increase the testability of client code
 
Session format: Tutorial (75 mins) [read about the different session types]
 
Abstract:Have you ever tried to write a unit test for a class that uses an external API? An API that is not mockable? Testing seems to be the last thing on our minds when we design APIs. It isn't that we don't test our APIs, we just don't make it easy to test code that uses our APIs. In this tutorial, Michael Feathers will describe a set of principles which will help you balance the security and extensibility of your API with the testability of client code. The principles will motivated from counter-examples in several commonly used frameworks in written in Java, C++, and C#. At the end of the session, you will be aware of the tradeoffs that you must make when considering testability, and how to make them in a manner appropriate for your development.
 
Audience background:Attendees should be developers with reading knowledge of Java, C#, and basic C++, along with experience using mock objects.
 
Benefits of participating:At the end of the session, attendees will know how to balance their use of final, static, and non-virtual functions to ensure testability of client code. They will also know how to make APIs more easily wrappable for clients who choose to ensure testability of their code through that mechanism.
 
Materials provided:Tutorial slides and a set of written notes on the topic.
 
Process:The session is primarily lecture, but I know that lecture at SPA is a very interactive affair.
 
Detailed timetable:
 
Outputs:I can supply a summary of the Q&A at the end of the session.
 
History:This session will be presented at XpDay Montreal in a few weeks. It hasn't been presented publically before.
 
Presenters
1. Michael Feathers
Object Mentor
2. 3.