Sunday, December 16, 2007

Agile Development

I've been using Agile techniques for years and trying to get others to use them as well. I've read books on Agile techniques, read blogs, and written code. For people interested in exploring these techiques, I would suggest the following techniques to try out:
  1. TDD - Test Driven Development
    • Write unit tests before or as soon as you write a new class or add methods
    • Design for easy testing, limit and break dependencies
    • Make sure all your test past before moving on to develop more code
    • Use a testing framework like JUnit.
    • Use mock objects. A mock object framework like jMock or EasyMock will help.
  2. Refactoring
    • Use an IDE which supports refactoring, such as Eclipse.
    • Read Martin Fowler's book and blog.
    • Refactor frequently, don't be afraid of refactoring. If you have good set of unit tests they will quickly pickup any mistakes that might be introduced by refactoring.
  3. Break Dependencies
    • By breaking dependencies using a technique like dependency injection, you can make writing Unit tests easier and make refactoring safer.
    • During testing, inject by hand, during production use a framework such as Spring or Guice.
This should get you started, I'll add more techniques and go into depth on each technique during future posts.

No comments: