views:

134

answers:

4

How would you rate by numbers the efficiency of a certain design?
What will be your variables?
I can think of:

  • Coupling
  • Design Patterns use
  • Language idioms use.
  • Scalability.
  • High-viability.
  • Code Reuse.
  • Flexibility.
  • Robustness to errors.
  • Testability.
  • Design implications on resource use and memory.
  • Portability.
  • Usage of the correct programming paradigm.
  • Design implications on run-time efficiency.
  • Encapsulation.

How would you even calculate such a thing?
I've heard of program metrics as the tool of calculating such a thing but I have no idea what it is and how it's done.

I thank anyone who's willing to help.

EDIT: Here is a blog entery about the subject from my newborn blog.

+2  A: 

I would like to take into account the following metrics either:

  1. Scalability.
  2. Highviability.

And regarding to your suggestions I don't think memory could be the metric for design efficiency, since it's more implementation based.


EDIT: (After a comment regarding analytic formula)
I don't think you can find an ultimate formula for computing design efficiency, since it's very subjective. But you can adopt some statistic techniques, define the metrics which really important for you in the design. Afterward define for each metric its weight. Now find different use cases and check how does your design fit them in each metric and give them a grade. After all this you can normalize and compute the value with V= Sum(W_i*G_i)/Sum(W_i), where W_i is weight and G_i is a grade. This way you can specify whatever is important for you in the design and calculate accordingly.

Artem Barger
Yes but how would you provide a formula that will calculate such rating?
the_drow
Are you looking for analytic formula to calculate efficiency?
Artem Barger
Exactly. That's what I need.
the_drow
This is for a program I am writing.So the user should grade what is more important in this particular design and by that calculate how much the design is efficient?
the_drow
Right, but it totally depend on how complicated you want it to be. For example if you want, that some part somehow correlate with each other you to extend the formula and somehow define relation.
Artem Barger
How exactly would you do such a thing?It needs to be as expressive and extensive as possible.
the_drow
Look, this topic is a good research point. Almost everything you have to do empirically, I mean there are a lot off possible solutions and different definitions you may or may not to take in consideration while implementing such formula for your application. For example you can find code reuse and pattern usage can be considered as correlated one, an easy case is linear dependency, but still you have to find empirically how to define it.
Artem Barger
Ok, forgo the formula for now.I need the most criterias I can find.What about sub categories?If a design uses a pattern but it's the wrong one will this reduce the rating?
the_drow
Do you want to chat via email instead of commenting here?
Artem Barger
no problem.the_drow at walla dot com
the_drow
+1  A: 

There are a couple of tools out there that can do this for you. One I've used is Checkstyle - Metrics.

I can't say really consider these metrics when designing, but use them on slow/lazy afternoons when I'm looking for a bit of code to attack.

CurtainDog
+1  A: 

Code reuse. While you perhaps can't count it as a positive value you can count it's underuse as a negative value and get a cumulative penalty score for bad code reuse.

sharptooth
And how would you say it's important from 1-10.How do you decide that it is more important then coupling for example?
the_drow
+1  A: 

This might be of interest as well:

ATAM (Wikipedia) and ATAM: Method for Architecture Evaluation

eljenso
Thanks, I'll read it
the_drow