Program with GUTs in C
One of the greatest shifts in modern programming practices has been how programmers across many different domains and languages have embraced unit testing. For the C programmer, however, a lot of what has been said and done in the unit testing space, from test-driven development to unit-testing frameworks, has passed them by. Most of the blogs and talks and advice out there is targeted at languages that are some combination of dynamic, managed or object-oriented — which by no stretch of the imagination describes C.
This day long session looks at the good unit tests (GUTs) and test-driven development (TDD) from the perspective of C. Rather than trying to fake object orientation, what are the composition-oriented styles and tricks that C can support more comfortably? What are the best ways to express and isolate external dependencies for testing? What does it take in code and in mindset to allow unit testing to embrace C?
Kevlin is an independent consultant, speaker, writer and trainer. His development interests, contributions and work with companies covers programming, people and practice. He has contributed to open- and closed-source codebases, been a columnist for a number of magazines and sites and has been on far too many committees (it has been said that "a committee is a cul-de-sac down which ideas are lured and then quietly strangled"). He is co-author of A Pattern Language for Distributed Computing and On Patterns and Pattern Languages, two volumes in the Pattern-Oriented Software Architecture series. He is also editor of 97 Things Every Programmer Should Know and 97 Things Every Java Programmer Should Know. He lives in Bristol and online.