News for hackers. Stuff that matters.
Re:Dependency Inversion in C Using Function Pointers by qznc on Monday July 09, 2012 @10:15AM (#4218256)
This article makes me doubt this Arqua tool. Using a callback does not remove coupling. It just makes it dynamic, so static analysis cannot find a direct link.

Arqua would have to find out that what value the global gNotifier variable could contain. An exact points-to-analysis should find out that it is clientNotify an insert the dependency. A less-powerful analysis might approximate that it could be anything. In this case there should be a dependency to every other compilation unit. Since Arqua reports "no dependency" it seems to do a non-conservative approximation, which means it does not report safe results.

That is not really a good quality metric. So why should one optimize against it?

Re:Dependency Inversion in C Using Function Pointers by ernstsson on Monday July 09, 2012 @10:33AM (#4218358)
As previously mentioned in one of the other comments; to "facilitate run-time configuration and testing.". Removing the static coupling has a value in itself, making the component isolated to facilitate unit-testing.