Quality Gates with NDepend to Help You Fail Fast
Editorial note: I originally wrote this post for the NDepend blog. You can check out the original here, at their site. While you’re there, take a look at Quality Gates and other NDepend features.
I had this car once. I loved the thing, but, before the end of its life, my wife and I had developed sort of a running joke about it. Specifically, if you wanted to see the “check engine” light come on, take the thing on a road trip. About 100 miles in, that light would come on.
The fog of memory has probably colored this tale somewhat. I can’t imagine that this happened before literally every driving trip we took. But it sure seems like it did. I can vividly recall the feeling of “something’s wrong” when we’d come too far to reasonably turn back but still had most of the trip in front of us.
Against this backdrop, the wisdom of the software aphorism, “fail fast” hits home. Had the light come on as we sat in the driveway, about to leave, we’d have had options. Take my wife’s car. Go to the dealership on the way out of town to make sure we could safely drive. Something. But, 100 miles into the trip, those options narrowed to “just keep going and hope for the best.”
If you must fail, better to do so early.
Fail Fast with Software Builds
When I first started as a professional software developer, “the build” tended to mean something much different than now. We’d code furiously for months or years, and then someone would blow the “code freeze” whistle. Then, after some testing, the “build guy” would pull the latest stuff out of CVS or Visual Source Safe and work on turning it into something that could be burned on a CD and distributed. The first inkling of possible build problems would come something like 96% of the way through the project. Heck, at that time, we had “merge parties,” wherein merging integrating one another’s separately developed source code could take days.
This created serious risk for projects. We had the ability to unwittingly introduce defects that would not manifest until perilously close to project release time. Like my potentially ill-fated driving trips, a too-late warning could create unacceptable delays and logistical problems.
So we, as an industry, learned to fail faster. We brought in the concept of continuous integration and a build machine. At the very beginning of a project, set the thing up for regular integration and delivery to a production (like) environment. Know quickly if you introduced something that would gum up the downstream works.