Monday 22 August 2016

App Developer


There's yet another believed that I’d prefer to add, but let’s first take a look at some statistics. This is a histogram from the Coupling metrics:

What's interesting relating to this picture is the amount of classes with low CA (-2). Classes with CA  are generally not used whatsoever or are top level services. These represent API endpoints, so app developer fine we have many of them. But classes with CA 1 are the type which are directly utilized by the endpoints so we have greater number of these classes than endpoints. Exactly what does this suggest from architecture / design perspective?

Generally, this means we have a type of script oriented approach - we script watch situation individually (we can’t really reuse the code as business cases are extremely diverse). If that's the situation, then it’s certainly a code smell and we have to do refactoring. Otherwise, this means the cohesion in our product is low, by which situation we need refactoring, but architectural refactoring this time around.

Additional helpful information we are able to achieve with a home histogram above is the fact that we are able to completely remove classes with low coupling (CA in ) in the listing of the classes qualified for coverage with unit tests. Exactly the same classes, though, are great candidates for that integration / functional tests.

You'll find all of the scripts and sources that I have tried personally within this GitHub repository: ashalitkin/code-base-stats.

Will It Always Work?

Not always. To begin with it’s about static analysis, not runtime. If your class is related from a number of other classes it's really a sign that app developer is heavily used, but it isn't always true. For instance, we have no idea if the functionality is actually heavily utilized by finish customers. Second, when the design and the caliber of the machine is a good example, then probably various parts / layers from it are decoupled via connects so static research into the CA won't provide us with a real picture. I suppose it’s among the primary explanations why CA isn't that popular in tools like Sonar. Fortunately, it’s totally acceptable for us since, should you remember, we are curious about using this particularly to old ugly code bases.

Generally, I’d state that runtime analysis will give far better results, but regrettably it’s a lot more pricey, time intensive, and sophisticated, so our approach is really a potentially helpful minimizing cost alternative

No comments:

Post a Comment