Tuesday, April 22, 2008

Is Checkstyle Agile?

The sprint review meeting was going on. Some developers expressed their discontent over checkstyle enforcement in continuous integration. They were unhappy because sometimes checkstyle prevented them from delivering builds to QA on time. To support their claim, one developer said - "I don' t think checkstyle is agile".

Let's first understand what is meant by the word "agile". The agile manifesto mentions following principals:
1. Welcome changing requirements
2. Deliver working software frequently
3. Collaboration between business and engineers
4. Sustainable development
5. Continuous attention to technical excellence and good design
What is the motive behind coming up with such a manifesto? - More efficient and cost effective software development. Why this process innovation? - To develop software in the least amount of time with the best possible quality a. k. a. saving money.

Now let's examine what checkstyle accomplishes. It enforces the coding conventions there by producing maintainable, consistent and more readable code. Sun's website for coding convention mentions that 80% of the lifetime cost of a piece of software goes to maintenance. Coding conventions play a big part in improving maintainability and readability of the software when you have multiple developers working on the same code base. Other developers can quickly understand a piece of code if it adheres to a standard.

Everything mentioned above is in line with the principals of agility. Enforcing coding conventions will allow self organizing teams to develop software more quickly and cost effectively. A readable piece of code can be easily worked upon by multiple people. Adhering to industry's best practices is in line with continuous attention to technical excellence. Furthermore, adhering to a standard will make the development process more sustainable.

Developers will always try to come up with reasons to avoid such enforcements. Some developers will also argue that agility means flexibility and hence they should be allowed to break the rules. Flexibility in agility implies the flexibility of changing requirements and not the flexibility of breaking engineering best practices. It's the responsibility of senior team members and sometimes even scrum master to make sure that the team is adhering to engineering best practices. Using right tools such as, AnyEdit plugin for eclipse, checkstyle plugin for your IDE will allow developers to avoid build failures due to this reason. The Scrum Master should intervene at such occasions and help senior team members in making their junior colleagues understand the importance of engineering best practices.