R – Introducing code generators in a project. Could this be a risk

code generationnet

I have made a code review for a .NET project (VS2008/.NET 3.5). I noticed that many business entitities and data access components were created from scratch while not having a business demand for implementing complex rocket-science code.

Many review-issues were related to the data access layer.

Looking at the architecture that is used I recommended to introduce a code generator like CodeSmith in combination with .NetTiers.

The tech lead liked the idea but he said that introducing this would be risky because the team is in the middle of the development stage and the project is too small.

Is it preferable to introduce a codegen at this stage ?

(this topic is not about which code gen tool must be used, but more about timing when to introduce it or about introducing it or not)

Best Answer

There's always a risk when adding new stuff to a project in the middle, especially when the new stuff is replacing old stuff. Basically any code that depended on the old code needs to be tested completely. This is part of the risk and cost of changing.

The risk comes with bugs. Assuming that everything works correctly, then it isn't a problem. But what happens when there's a problem? Then the cost goes up because extra time is needed to go through the debug/test cycle again.

The only time this would make sense in the middle is if you haven't done any of the testing yet. However, if that were the case, then I would be more worried about the overall quality in general because I would prefer such a low-level layer would have been thoroughly tested throughout the process.