In the 1980’s, I studied Pascal, and then Modula-2, in an effort to find ways to improve reliability in software. At the time, I was very frustrated with the poor quality software. It seemed that defects were expected and accepted, producing a very frustrating experience for users.
In the 1990s, I made the transition from procedural languages to object-oriented langages by learning the Eiffel language, invented by Dr. Bertrand Meyer.
I attended a course where Dr. Meyer taught me the Design-by-Contract method. I was hooked on the idea of using contracts in code to be more explicit. I also acquired a taste for automated testing, and then Test-Driven Design.
For many years, my career involved programming in C#. So Eiffel was not an option. But I believed so strongly in contract programming that I adopted a C# library that implemented some simple ideas of contract programming. Not surprisingly, the library (Code Project – Design by contract) , written by Kevin McFarlane, was inspired by Eiffel. Although the add-on library was not as capable as the Eiffel language, it enabled me to use contracts in a limited way in C#.
The decade of the 2000’s offered me exciting new opportunities for enhancing software quality as Microsoft Research introduced Spec#, Boogie and other tools to help us produce more correct code. This culminated in the commercialization of these efforts via the introduction of Code Contracts in the .Net Common Language Runtime version 4.0. This is an exciting time for developers who care about quality.
If you think of any other techniques that would enhance software quality, in additon to using contracts and test-driven development, I would love to hear your thoughts.
Correctness and reliability are not our only goals, but they are vital prerequisites for delivering valuable software solutions.