开发者

Is it possible to calculate the complexity of software using fractal?

Any idea or anything concrete in .net or java ? Fractal dimension represents complexity. A fractal is composed of other fractal. If software modules could be viewed as fractal somehow it would be possible ?

Update: found this but don't have access to it. Someone does ?

Computing the Fractal Dimension - A Global Metrics for Large Software Systems http://ieeexplore.ieee.org/articleSale/Sarticle.jsp?reload=true&arnumber=5676891

sure it's brand new paradigm so my question: how would you do it ?

Finally there have been a few interesting suggestions. Intuitively I think fractal dimension can be a better mesure of complexity that is closer to human feelings than other metrics like cycloblahblahblah which is too close to low开发者_开发技巧 level machine operations.


The idea of a fractal dimension is in bad common english (AFAIK): If I make the basic length of an object twice as big, how much bigger does the fractal get. The trivial cases dot, line, circle, sphere result in the factors 1, 2, 4, 8 which translates (using mathematical pixie dust of the second order) into the dimensions 0, 1, 2, 3.

For fractal like objects (sponges, coastlines ...) you get rational numbers as a result.

If you want to apply this to software you have to define three things:

  • what is the 'basic length'
  • what is the size of source code.
  • how do you 'make the basic length twice as big'

I think there are tons of options that might make sense:

My personal favorite currently is this combination - number of class files - LOC - wait until the project grows as desired or use the version control system to see the system in different stages

An alternative would be to use different projects in order to get 'measures' at different sizes. So you could compare the dimension of java projects to those implemented in C.

BTW: the article isn't realy that expensive.

------------------ update ------------------------- different idea

There is a method called "box counting" (http://en.wikipedia.org/wiki/Box-counting_dimension). You could interpret the source code as a tree. Nodes being for example methods+classes+field. Edges being relations like 'references'. Apply a a graph layout algorithm on this graph. On the result use a the box counting algorithm.

No idea if this is stable (doesn't change much when you change the code a little) or has any usefull property at all. But is sure be a fun experiment.


You want to calculate a quadtree with the fractal dimension. A quadtree can be seen as a space-filling-curve recursively subdivide the surface into smaller tiles. There are sfc with a fractal dimension of 2 that means it reduce the 2d complexity to a 1d complexity. You want to look for Nick's hilbert curve spatial index quadtree.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜