Metriche nel software Luca Lista INFN Sezione di

  • Slides: 6
Download presentation
Metriche nel software Luca Lista INFN, Sezione di Napoli Luca Lista - C++

Metriche nel software Luca Lista INFN, Sezione di Napoli Luca Lista - C++

The Dependency Metrics[1] • Responsibility, Independence and Stability of a Package – Ca: Afferent

The Dependency Metrics[1] • Responsibility, Independence and Stability of a Package – Ca: Afferent Couplings • # of dependent external classes – Ce: Efferent Couplings • # internal classes dependent on external – Instability: Ce / (Ca+Ce) [0, 1] • 0 = maximally independent • 1 = dependent but with no dependents [1] R. Martin, www. oma. com Luca Lista - C++

Stability vs. Flexibility • Open Closed Principle – Stable (good) Package • Responsible independent

Stability vs. Flexibility • Open Closed Principle – Stable (good) Package • Responsible independent abstract classes – Unstable (good) Package • Dependent irresponsible concrete classes • Abstractness – # abstract classes / total # of classes [0, 1] Luca Lista - C++

The Main Sequence • Define Stability-Abstractness relationship Maximally stable & abstract (0, 1) Ma

The Main Sequence • Define Stability-Abstractness relationship Maximally stable & abstract (0, 1) Ma in Se qu en ce (1, 0) Luca Lista - C++ Maximally unstable & concrete

…and its statement • The MS textual definition – Packages that are maximally stable

…and its statement • The MS textual definition – Packages that are maximally stable should be maximally abstract. Instable packages should be concrete. The abstraction of a package should be in proportion to its stability • Combined with the Stable Dependencies – Dependency Inversion Principle for classes • dependencies toward abstractions Luca Lista - C++

Example of metrics Main Sequence 100 90 80 Ifr. Geom. Base Abstractness 70 Ifr.

Example of metrics Main Sequence 100 90 80 Ifr. Geom. Base Abstractness 70 Ifr. Data 60 50 Ifr. Pid. Data 40 30 20 Ifr. Reco Ifr. Data. Imp 10 Ifr. Geom. P Ifr. Geom 0 0 10 20 30 40 50 60 70 Ifr. Visitors Ifr. Pid Ifr. Sim Ifr. Env Ifr. Sequence Ifr. Data. P 80 90 100 Instability Luca Lista - C++