Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Just like we can measure complexity of code and algorithm, are there any metrics for measuring architecture/design/solution space complexity.

share|improve this question

closed as too broad by gnat, MichaelT, Dan Pichelman, GlenH7, Kilian Foth Sep 25 '13 at 10:59

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

Team turnover? :) –  user2567 Dec 5 '10 at 6:25
Intuitively speaking, architecture complexity can be measured from two perspectives: the developer's and the user's. In each perspective, complexity is measured as the level of nonintuitiveness and unexpectedness. The two perspectives guage how difficult it is to develop and to use the software. –  rwong Dec 5 '10 at 8:03
@rwong: Note that something complex does not have to be complicated. What you call complexity I would call complicatedness. –  EOL Dec 5 '10 at 11:21

3 Answers 3

up vote 3 down vote accepted

Take a look at the Dependency Structure Matrix. There are a few good metrics that can come from this.

share|improve this answer

Here is an intuitive solution: the complexity of a program is the size of the shortest well-written (i.e. readable) code that implements it. This is not full quantitative, but this is something that I believe a good programmer may judge by experience.

Rejecting non-readable code means that you get a measure of the conceptual complexity, which would disappear if hyper-optimized, obfuscated code was taken into account.

Thus, some tasks just require a certain number of concepts. I almost always embody these concept in a certain number of classes, class methods, and functions. The minimum number of such classes, methods and functions in a well-written, understandable program says something about the complexity of a program.

share|improve this answer
The difficulty I have with the some tasks just require... argument, is that view is entirely dependent on the solution used to solve it. –  Ptolemy Dec 5 '10 at 11:32
@Ptolemy: Could you elaborate on this? I'm not sure I know what your mean by "dependent on the solution", and whether the idea of "the shortest" code that I put forward addresses your point… :) –  EOL Dec 5 '10 at 16:35
I suspect that a lot of people would consider that 1-click from Amazon is the simplest minimal step needed to sell a book on the internet. Now consider the same concept, but marketed as a book club. Members receive the editors recommended book each month, UNLESS they click to say no. Hey presto, a simpler model. –  Ptolemy Dec 5 '10 at 18:32
@Ptolemy: … which shows that, in your example, getting the recommended book is not at all complex, which is correct. –  EOL Dec 5 '10 at 21:50
The point is, that unless you could think of the membership business model, you would have swore blind that the 1-click was that you make a purchase you have to accept an offer to sell you something, and that a click is the simplest possble way to do this. –  Ptolemy Dec 6 '10 at 10:20

Actually, we can't measure complexity of code and algorithm. Every single such metric proposed has been shown, when applied to real programs written by real programmers, to be strongly correlated to SLOC - and SLOC is a lot easier to measure: just count carriage returns.

(Yes, I know SLOC can be gamed. The games, and the game-player's job, generally don't survive past the first code review. Or at least they shouldn't.)

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.