Wednesday, August 15, 2007

Code refactoring

Continuuous improvement of the quality is a process which is one of the ways Agile developments really depends on. However within Agile or outside agile improving code quality is a common problem to address. Now what are the common reasons of having a code to be refatored:
a) Partial business knowledge
b) Lack of understanding of the intended architecture on the programmers part
c) Deadline pressure: Programmers end up coding something which just meets the deadline needs.

Common mechanisms of solving this problem:
a) Manual Code reviews: These are of two type - peer led reviews- where one programmer does the review of other progarmmers. Also Architect driven reviews where the technical architect performs the code review of solution being developed.
b) Automatted Code reviews: Tools like PMD performs automated code reviews.
c) Pair programming: This is a principle used in Agile and XP style development where two people looks at the computer at the same time. This does not exactly helps refactor but while development it can achieve higher quality.

IDEs like Eclipse and Idea has support for wide varieties of code cleanup and refactoring. Jboss IDE 2.0 has the feature of code cleanup which is pretty neat. Much of these refatorings are borrowed from Intellj though Eclipse has gor quite some attention.

No comments: