Reuse of measurement code

I am trying to measure how much code produced in our organization is actually being reused, and I would like to establish some recommendations. I would like to have a link to the outside world:

How much code is usually reused in one application? More specifically, if we look at all the code for a complete end-user product (and ultimately exclude third-party libraries), how many functions and methods are called from more than one place?

What metrics are used to measure code reuse? Are there numbers or studies available for open source and / or closed source software?

+3
source share
3 answers

How much code is usually reused in one application?

IMO there is no "typical" application, especially in this regard. Applications have completely different architectures and threads that lead to different "reuse" patterns.

Consider a batch processing application that reads data from a file in a specific format, converts it to another format, and then saves it. It practically has one execution path, so not many methods are called from more than one place.

OTOH considers the structure of a plug-in with several independent plug-ins that use the same level of infrastructure, so the functions in this layer are called from different places.

, , ( ).

, : , , . , , .

: . . , .

, , (, , PMD Java-). , .

+2

, " ", , ; (. this , C, Java COBOL), , , , , .

, . , ( - ) , . , , .

. , , , langauge, 20% , (- > 10% ). 55%.

+2

If you are running the .NET platform, consider using NDepend to provide you with many metrics for your software. "Code Reuse" may not be available directly as a metric (perhaps for reasons that other posters have already mentioned), but you might be interested in things like communication and cohesion.

Even if you are not using .net, perhaps defining metrics .

0
source

Source: https://habr.com/ru/post/1753262/


All Articles