Information Technology Reference
In-Depth Information
Solution
Add automated inspection tools to assess adherence to the project's
architectural standards. For instance, you could add a rule that control-
ler classes should never make direct calls to the data access objects.
You can use dependency analysis tools such as JDepend 6 or NDepend
to create reports for architectural adherence. You can run a tool such as
this with every integration build.
Scenario: Duplicate Code
Duplicate code, which makes code more difficult to maintain,
increases costs. Code that has been copied and pasted has been a risk
on virtually every project we have seen. In fact, there are many well-
known software development kits and tools where over 25% of the
code has been duplicated. We analyzed all the software development
projects at one company and found an average 45% of duplicated
code. This can present problems when you have multiple copies of
similar code that you need to maintain. For example, one system had
five copies of similar code in different subsystems. Now, let's say you
have some code that checks the authorization of a user who is cur-
rently logged in. Instead of writing a single method, the developer
chooses to copy and paste the code everywhere he needs to authorize
this user. You'll find another variation of code duplication when devel-
opers create their own logic rather than using a common utility. The
code is not literally copied and pasted, but it still produces the same
effect as explicit code duplication.
Mary (Developer): Do you know how I can iterate over a collection of
User objects?
Adam (Developer): Yes, I wrote some code for that last week. You
can find it in the User package.
Mary: Great! I will copy it out of there and use it. Thanks.
6. JDepend is a tool to determine the architecture and design of your source code.
It is available at www.clarkware.com/software/JDepend.html.
Search WWH ::




Custom Search