I attended a number of excellent sessions at the Agile 2007 conference in Washington D.C. this year. One of the most thought provoking for me was the session by Bob Martin on Developer Professionalism and Craftsmanship.
I have worked as both a developer and as a manager of developers for many years. As time goes by, it is very easy to lapse into bad habits, to forget that my profession is as defined as any other craft and deserves to be treated as such. As with any defined craft, consistent high quality relies very much on two things - good quality teaching, and large amounts of discipline by every one of its practitioners.
Bob listed a lot of attributes that he believes makes a "professional" developer. Many of the items were related to Agile development practices; short iterations, feedback loops, deferring decisions etc. Of the rest, I wanted to highlight some that resonated with me, because I have seen many teams (and definitely myself!) fall short in these areas.
Progressive Widening and Deepening
For progressive widening, start small and get wider. For example, when coding a login screen, simply show the username box and a button and allow a login with just the username typed (no checking). Then add a password box and still allow the login with no checking. Then have the user enter a username that is checked. Then a password.
For progressive deepening, develop your features in layers - ensure a feature completely works in each layer (e.g. the UI) before moving to the next. This will help with decoupling your application layers from each other.
Don't Write Bad Code(!)
Go fast by going well; ensure your code is clean at all times. Bob gives a good analogy with a kitchen; if you wash up as you go when preparing food, next time you cook everything is already prepared. If you never wash up, you are always surrounded by food stained plates and pots and pans, and it gets worse over time. At this point Bob said, quote, "using Test Driven Development is a matter of minimum professionalism".
Test/QA "Should" Find Nothing
This should be the default expectation for every single team member, and developers (more than anyone else) should be driven by this expectation. The goal for TDD should be 100% code coverage, which in turn will contribute to this expectation.
Debugging Should Not Be Necessary
When writing your code, debugging should not be necessary because you are writing such small amounts of code to pass your tests (which you wrote first!). Worst case, debugging should be in code you *just wrote*, in which case you could even delete the code and write it again!
"Manual Test Scripts Are Immoral"
Manual test scripts are essentially programs, and people shouldn't execute programs. Running manual test scripts is high-stress and tedious and therefore error prone; . Testers should invest their time in exploratory testing, because, and again I quote, "testers are creative people with diabolical minds".
Definition Of Done
I blogged about the importance of "Defining Done" before. Done is when all acceptance tests pass. Bob's tips included:
- ALWAYS automate "done".
- Have end-to-end tests for every definition of "end-to-end".
- An important tactical point he made was that all acceptance tests should be done by the mid-point of the iteration at latest to ensure they can be built in to the build process for at least half of the iteration.
[Note: I do have a small issue with the ideologies above. I work predominantly in the Web space, and automating the UI part of what we do is a tough problem - multiple browser and OS combinations gives us tough challenges when automating. It is definitely possible to do, but the cost can be quite high when creating and maintaining your test suites. I'd love to hear from anyone who is having success with TDD and automated testing in the Web development area.]
Finally, Bob talked about the concept of an Apprenticeship in software engineering - something I think is a fantastic idea. I have a new developer on my team, and I am going to spend time with him over the next year or so helping him become the best developer he can be. I am also going to challenge the other developers on my team to reflect on the areas where they could be more disciplined, and support them in becoming better developers.
Let's not settle for being reasonable engineers, lets become master craftsmen and create masterpieces of coding beauty, solutions that we can be proud of...
[Bob Martin gave this talk at another conference this year, and Julien Delhomme has written up Bob's full list here: http://juliendelhomme.com/?p=18]