Fortran-FOSS-Programmers / Fortran-FOSS-Programmers/ford

Code metrics: Instability index

Open
#99 6 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
458
Forks
138
PR merge metrics
No merged PRs in 30d

Description

As defined by Martin in [Agile Software Development ...](http://amzn.to/1mVPolj) and cited by Rouson in [Scientific Software Design](http://amzn.to/1Q5zccX) it is possible to quantify coupling in a software package via and instability index, `I`

![tex2png--10 cgi](https://cloud.githubusercontent.com/assets/279612/12797137/70a0db8a-ca90-11e5-9d36-fc9bc58b235d.png)

Here `Ca` is the number of afferent couplings and `Ce` is the number of efferent couplings. (Afferent couplings are things which depend _on_ the thing in question, e.g., number of children, efferent couplings are the number of things upon which the thing it question depends, e.g., number of parents.)

It seems that this principle is most commonly applied to abstract data types (i.e., abstract derived types) but I think it could be applied to modules, and even procedures.

Due to the call graph and module/type dependency graph information, I think FORD already has all the necessary information to compute these code metrics. For abstract derived types: `Ca` is the number of derived types that extend it or list it as a component. `Ca` is the number of abstract types it extends.

For modules, `Ca` is the number of modules, procedures, and programs that `use` the module in question. `Ce` is the number of modules it uses (even indirectly due to the transitive nature of module use association... of course with `private` this is less of an issue, but I still think it would make sense to count all transitive `use`s too. For example A uses B uses C, therefore A uses C).

Just a thought, and if it's not prohibitively a PITA to implement, a feature request.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.