Lazy Driven Development (LDD) is a philosophy I have molded throughout my (short) career as a software developer. How it works is somewhat self-explanatory, but before I explain what it means and why I still have a job, let me start by describing the commonly known practice of Test Driven Development (TDD), which encompasses many of the ideals I strive to manifest with LDD.
Test Driven Development
TDD is the development of software from a "let's hit this idea with a stick first" methodology.
The basic workflow of TDD is thus:
Reads like common sense, right? What this methodology enforces is modular, testable code. It provides developers a sensitivity for what really makes a stack testable, which allows other developers to better interpret and build upon that stack when future changes are made. What this methodology does not encourage is the methodology itself. The transition is awkward because the path of thinking is awkward, especially if you've been operating from an opposing mindset for the past decade. I can see the pick-up being a minor setback for smaller or younger projects, but when you have a substantial legacy codebase and a host of set-in-their-way developers, you're going to find yourself fighting to keep this flow alive.
- Determine a test for a path of logic that you intend to implement
- Create the necessary objects and methods for the test to run, typically as you write it
- See the test go red, attempt to make it green by filling in the blanks
- Determine more tests and repeat until the path of logic is 'complete'
laptop failing a battery test (let's make it pass!) |
test driven what? |
Now I do understand that this method intends to save time, money, effort, pain, etc. in the long run, but that doesn't mean TDD (or BDD) is the most direct path to make those goals a reality. You can achieve modular, testable code in many different ways and LDD is what I would like to introduce as my means toward that end.
Lazy Driven Development
So what is this, a metaphor for procrastination? I gather that the term lazy is not what managers and leads first look for in an aspiring developer for their team, but let me explain what I mean by lazy. The context here is that I only want to develop in a fashion that provides me the least amount of present work and follow-up work to achieve the goals I set forth. Put another way, I want to get things done as efficiently and efficaciously as I can. Of course this also means no cutting corners and mincing functionality, because such actions allocate technical debt and produce gaps in testing coverage that both in turn provide for a much more painful experience down the road.
done? done done. |
Easy to type, but how does one actually do this? Well let's think back to what TDD teaches us; model your logic in a way that facilitates testing and indicates its purpose clearly and concisely. You don't need TDD to achieve that, just do it! I see TDD as a means to a means toward proper coding. You're forced into a modular, testable coding mindset because that is really the only sane path forward when working from that perspective. It's almost difficult not to write clean code. But once you have those ideals under your thumb, take off the training wheels and let loose.
one does not simply write obfuscated code either |
Now I'm not saying that TDD is tedious and wrong, I believe it does serve an important purpose as an educational tool. But once you have learned and mastered the bullet points I don't see much benefit toward straddling your focus to an outward-looking-in point of view. Personally, I find that perspective more important when determining acceptance criteria for a story, but I generally don't find it conducive toward writing clean code quickly to complete that story.
Conclusion