Home > .NET, Extreme Programming, Test Driven Development > Maintenance Complexity leads to more methods?

Maintenance Complexity leads to more methods?

Mark Miller talks about a new metric he is calling Maintenance Complexity. The system assigns operators and constructs a point score representing their contributing complexity. A method is then analyzed and all the points add up to yield the Maintenance Complexity score. I like the concept but tackling a report of complex methods would probably just result in breaking them apart into more methods. Many might argue that this is a Good Thing although it really depends on how the methods are split.

This would seem to be completely against Kent Beck‘s Rule 4 for achieving theSimplestCode“Minimizes number of classes and methods”.

It also seems that determining the complexity of a method should also take into account the parameters to the method especially if any of the parameters are out since that could indicate greater coupling and more possible side effects of the code in general.

Automated tools and reports provide a great way to home in on problems area in code (Just look at the marvels a coverage report can do for statement coverage!) – but once you find the problem areas … how do you fix them? How does the tool/metric naturally select for simpler logic and less complexity?

Mark – Thanks for your thoughts and ideas!

  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: