"You want to know how two chemicals interact. Do you ask them? No, they're going to lie through their lying little chemical teeth. Throw them in a beaker and apply heat."
Dr. Gregory House, MD (Hugh Laurie)
I'm fairly confident that Fox or CBS will never make a TV drama about software development. It's for the same reason that there are few biopics about writers or philosophers: it is simply not very interesting watching someone think or tap away at a keyboard. Sure, if my job involved saving the world by skateboarding in transport terminals evading the FBI while hacking into the mainframe of a corrupt corporation, movies will certainly be made about it. Sadly though, my profession verges perilously close to the same degree of glamor as accountancy; and yes there are times I daydream about being a lumberjack.
Though I will never see an episode of 'Buffy the Code Debugger' on November 2004 a show aired on Fox that did catch the very spirit of what I do as a software architect. 'House MD' is centered around Dr. Gregory House, played by Hugh Laurie: a rather complex and antisocial Certified Clinical Diagnostician. House is a flawed antihero, addicted to painkillers, maverick to point of unethical behavior, egotistical and contemptuous of authority: an archetypal 'outsider'. Despite these flaws he is fundamentally a likable character; like Harry Callahan of the 'Dirty Harry' movies, he is acceptable to us within the dramatic context. His professional ethics are questionable, but motivated from the higher imperatives of saving lives. Human values over bureaucratic rules.
Although House is a fundamentally enjoyable character it is with his diagnostic approach that I most identify. That approach is not much different from what I do when troubleshooting a software application or system. My problem domain is different, malfunctioning software rather than a sick patient, but the diagnostic process is in almost all points the same: the application of the scientific method. Here is a breakdown of Dr. House's diagnostic methodology:
- Gathers a list of symptoms: just the facts. House doesn't like to talk to patients because 'they lie'.
- Brainstorm and shortlist the possible causes.
- Research environmental factors: his team is sent to investigate the patient's living environment.
- Research the shortlist of candidate complaints
- Formulate a hypothesis
- Test the hypothesis, even to the point of deliberately putting the patient in a coma!
- Evaluate the test results
- Repeat steps 5 thru 7 until a diagnosis is reached
- Treat the patient based on diagnosis
- Monitor the patient for improvement in response to treatment
- If patient does not respond repeat steps 5 thru 10
In comparison is the methodology I use for non-trivial cases of troubleshooting:
- Gather facts about the observed behaviors: replicating the behavior
- Identify likely software components that might be involved
- Consider environmental factors - dependent data sources, user conditions (browser configuration etc.)
- Do any necessary research - support forums, software documentation (IRC is great for real-time answers)
- Formulate a hypothesis
- Test the hypothesis with prototype, code or configuration changes etc.
- Evaluate the results of test scenarios
- Repeat steps 5 thru 7 until the cause of the problem is clear
- Apply a remedy (code patch, data repair etc.)
- Monitor the application in the live user environment to verify a permanent resolution
- If problems persist or new problems are exposed repeat steps 5 thru 10.
In trivial cases the diagnosis is usually reached at step two.
This approach to software diagnosis is systematic and although it might sound laborious it usually yields a more rapid problem resolution than simply jumping into the code looking for the problem. In software engineering you should always first solve the problem then apply the solution to the code. Inexperienced developers often try to solve problems in the code and that is usually the very worse place to do it.
So next time I'm at a party and an attractive woman asks me what I do I can say, "Do you like House MD? I do that with software". Let's face it, I am only in this job for the glamor.