Saturday, January 12, 2008

No Time to Do It Right, But Plently of Time to Fix What's Wrong

Do you take the time to test your code adequately? Do you write unit tests? Do your unit tests cover a majority of your code? Well, why not? Oh right, right. No time. The project is due in 3 days and you have 10 days worth of work. You're working nights and weekends as it is and your manager is breathing down your back. I mean, how can anyone be expected to spend time on writing unit tests under these conditions right? If quality was so important to them, they'd give you enough time to do things properly. Hey, you care about quality, but what can you do, right?

First of all, no, not right. Secondly, if you care enough about something, you'll find a way to do it regardless. So the question is, do you care enough about the quality of your work to stand up to management pressure and peer pressure? Or are you just content to keep your head down, do mediocre work, and not rock the boat like everyone else? If it's the latter stop reading and go away. For those of you who are tired of sacrificing your personal principles, and want to be able to look yourself in the mirror every day, maybe I can help.

By now, it should go without saying that the additional time it takes to do quality work always pays off. You should know through your experience that every defect caught early (say in development) is less costly to fix than if it were caught late (say QA or after release) by a factor of 10 to 100, or possibly more. Furthermore you should realize by now that the reason you have to crunch at the end of every single damn project to fix those remaining high priority bugs is a direct result of you and your team's sloppy work in the first place. And you won't even be able to fix all the bugs, only the "high priority" ones. Finally, you are missing out on one of the most rewarding aspects of doing quality work. Being known by your peers for doing quality work.

Ok, ok, so how do you fight "the man"? What can you do when management is pressuring you with an unrealistic time line that will compromise the quality of your work? Here are some thoughts:
  • Be real. If you know in your heart that you can't deliver that feature in 2 days that you are confident in, don't commit to it. If it will take 4 days, it will take 4 days. Don't compromise. Don't succumb to peer pressure. Seriously, grow a spine.
  • Ok, so they're asking you to work overtime to compensate for it, what do you do? First of all, did you previously agree on the unrealistic schedule? Or maybe the additional work is a result of a mistake you made? If so, man up and do what you promised. That should teach you a lesson. But if you have been honest an forthright with your work estimates throughout the project, and especially if you've done your share of pointing out the potential risks in the project, then it's your project manager that has screwed up, not you. Should you work overtime to cover his ass? Depends. If you do, he owes you big time (and make sure he knows it). If he's the kind that returns favors, then your hard work is worth it. This is how bonds of trust are built. If not, well, sucks for you, but at least you know who not to work with in the future.
  • What if he's pulling rank? Then you have to pull out the big guns as well. Simply say this, "If you want me to do this in X days, I will. But I will not have time to test it and there's a strong possibility that it will be crap. So I will not be able to stand by it. But if you want it in X days, it's the best I can do." If your manager is even half-way competent, he'll either back off or try to find another way to work around it, such as getting you additional help or off loading you some other way. If he insists anyway, then watch out. Not only is he not even half-way competent, he is also lacking integrity and will likely blame you anyway when something goes wrong. Weather the storm and avoid working with the person in the future. If that's not an option, I'd look for another job, but that's just me.
People who stick to their principles will find that life is often harder for them than if they were just to go with the flow. But it's only the people who stick to their principles who can do quality work. Any lesser person will be dragged down by the mediocrity that seemingly surrounds them.