I haven't seen anything out there, and I suspect the difficulty with defining "n" since for generally for analyzing a complex function there'd be more than just one or two variables for defining.
There are analysis tools for cyclomatic complexity but are there ones for time (and/or space) complexity? If so which ones, if not, why not? Is it infeasible? Impossible? Someone just hasn't gotten around to it?
Ideally there'd be something like overall complexity for the application (defining different possible "n"s) as well as for each method in the app
Edit: So it seems like an exact solution is impossible because of the Halting Problem however, is some kind of heuristic approximation possible? I realize that for practical purposes a good profiler will give much more useful information, but it seems like an interesting problem.
Also, how about one that calculates for a certain subset of programs?
Big O notation is used to describe the complexity of an algorithm when measuring its efficiency, which in this case means how well the algorithm scales with the size of the dataset.
This is done by directly measuring the number of paths through the code. Say a program is a graph of all possible operations. Then, complexity measures the number of unique paths through that graph.
Unfortunately there is this problem called the Halting problem...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With