XNSIO
  About   Slides   Home  

 
Managed Chaos
Naresh Jain's Random Thoughts on Software Development and Adventure Sports
     
`
 
RSS Feed
Recent Thoughts
Tags
Recent Comments

Another Project Rescue Report

Monday, February 9th, 2009

Some time back, I spent 1 Week helping a project (Server written in Java) clear its Technical Debt. The code base is tiny because it leverages lot of existing server framework to do its job. This server handles extremely high volumes of data & request and is a very important part of our server infrastructure. Here are some results:

Topic Before After
Project Size Production Code

  • Package =1
  • Classes =4
  • Methods = 15 (average 3.75/class)
  • LOC = 172 (average 11.47/method and 43/class)
  • Average Cyclomatic Complexity/Method = 3.27

Test Code

  • Package =0
  • Classes = 0
  • Methods = 0
  • LOC = 0
Production Code

  • Package = 4
  • Classes =13
  • Methods = 68 (average 5.23/class)
  • LOC = 394 (average 5.79/method and 30.31/class)
  • Average Cyclomatic Complexity/Method = 1.58

Test Code

  • Package = 6
  • Classes = 11
  • Methods = 90
  • LOC =458
Code Coverage
  • Line Coverage: 0%
  • Block Coverage: 0%

Old Code Coverage Report

  • Line Coverage: 96%
  • Block Coverage: 97%

New Code Coverage Report

Cyclomatic Complexity Cyclomatic Complexity report before Refactoring Cyclomatic Complexity report after Refactoring
Obvious Dead Code Following public methods:

  • class DatabaseLayer: releasePool()

Total: 1 method in 1 class

Following public methods:

  • class DFService: overloaded constructor

Total: 1 method in 1 class

Note: This method is required by the tests.

Automation
Version Control Usage
  • Average Commits Per Day = 0
  • Average # of Files Changed Per Commit = 12
  • Average Commits Per Day = 7
  • Average # of Files Changed Per Commit = 4
Coding Convention Violation 96 0

Another similar report.

Project Automation

Wednesday, October 8th, 2008

Concerned about your team’s performance? Looking for ways to enhance your team’s productivity and getting rid of all those mundane tasks? Years of consulting and building products have thought me that Automation is the key to improving team’s productivity and bringing joy back to software development.

If your team is seriously looking at automating as much as possible on their projects, you must consider some items like:

  • Setting up an automated build for your project. You must explore tools like Ant, NAnt, Maven, GAnt, Rake, etc
  • Creating automated unit, acceptance and UI tests for your project. Have a look at xUnit frameworks, FitNesse, Selenium, Watir, Abbot, etc
  • Setting up a Continuous Integration (CI) process for your team. Configuring a CI server with Version Control System for your project
  • Setting up developer work-stations with all the necessary tools and framework to be able to independently build the project from developer desk in a predictable and repeatable way
  • Setting up an evolutionary database design and data migration process using tools like Migrations, Liquibase, etc
  • Enabling the automated build to switch between Development, CI, Staging and Live environment using simple properties
  • Setting up coding standards for the team and using tools like CheckStyle and other Static analysis tools to automatically validate code format and other aspects with each build
  • Adding code coverage or test coverage frameworks like Cobertura, Jester, etc to your build
  • Setting up an integrated project dashboard on CI server with various project metrics like BurnUp/BurnDown chart, test coverage trends, test counts, etc. This Dashboard is visible to everyone on the team and all the stakeholders
  • Setting up a build promotion process
  • Setting up a team wiki which is versioned along with the whole project

The general rule of thumb I use when is comes to automation is:

If you need to do something more than once a day, it got to be automated. Period!

    Licensed under
Creative Commons License