# Presentation: 666287

## Software Architecture Metrics

**Hany Ammar, Mark Shereshevsky, Ali Mili,****Walid Rabie and Nicholay Gradetsky**
** **Lane Department of Computer Science & Electrical Engineering
- hammar@wvu.edu; (smark, amili, rabie, grani)@csee.wvu.edu

## Initiative Title: Architectural Level Software Metrics '01 

**FY2001 University SOFTWARE INITIATIVE PROPOSAL****for the****NASA SOFTWARE IV&V FACILITY**** **** **

## Outline

- Project Overview
- Hub Control Software (HCS) case study
- Definition of the entropy based metrics
- Definition of the Quantitative Factors
- Informational Integrity Coefficient (IIC)
- Conclusions (achievements)
- Papers submitted
- Work In Progress
- Future work (2nd year plans)

## Project Overview

- Developing a class of architectural metrics that quantify information flow in the architecture. Different metrics reflect:
- Coupling vs. cohesion;
- Data flow vs. control flow;
- Static measurement vs. dynamic measurement;
- Introducing a group of *quantitative factors*: mathematically defined functions, that are relevant with respect to qualitative attributes of the architecture
- Establishing analytical relationship between the metrics and the quantitative factors
- Automating computation of the metrics

## Project Overview

- McCall's model of software quality [McCall 1977],
- 	 Three-level hierarchy of software attributes

- Project Overview

## Project Overview  McCall's model of software quality in UML

## Hub Control Software (HCS) Case StudyInternational Space Station

## General HCS-ITCS scheme

## HCS case study: Hierarchical Architecture 

## Definition of entropy based metrics

**Definition 1**:
- _Coupling_: *The coupling from A to B, denoted Coupling(A,B), is the entropy of random variable V**A****B**.*
- _Cohesion_:* The cohesion of A* is defined as coupling from *A* to *A*.

- _E_nsemble
-  CNTL , DATA  *E*
*p* is the probability distribution of E.
*V**A****B** *is a random variable defined by *E* and *p*

## HCS case study :ITCS Static Control Matrix 

## HCS case study :HCS Static Control Matrix (LEVEL 1) 

## Information Theoretic metrics 

|         Method of  data collection
Aspect of
inform. exchange | Static
(syntactic analysis,
Comprehensive statistics) | Dynamic
(running actual instances of the architecture) |
| --- | --- | --- |
| Control | Entropy of set of methods, with statically computed
probabilities  | Entropy of set of methods, with dynamically computed
probabilities |
| Data | Entropy of set of parameter values, with statically computed
probabilities | Entropy of set of parameter values, with dynamically computed
probabilities |

## HCS case study :ITCS Dynamic Control Matrix 

## HCS case study : HCS Dynamic Control Matrix (LEVEL 1) 

## Definition of the Quantitative Factors 

- Quantitative Factors bridge the gap between *qualitative attributes* (which we want to assess) and *computable metrics* (which we can measure).
- Some Quantitative Factors:
- Error Propagation
- Change Propagation
- Requirements propagation

## Definition of the Quantitative Factors: error propagation

**B**(*x*) is the state of *B* resulting from invoking *B *on input *x*. Suppose, due to a fault in *A*, the information transmitted from *A* to *B* is corrupted from the expected *x* to some erroneous *x`*.
- The *error propagation* (EP) is a measure of the likelihood that an error in the message sent by A will propagate into B.

- Error

## Definition of the Quantitative Factors: error propagation			 Continued

** ****Definition 2**:
- _Error Propagation_:
*The error propagation from A to B is defined as the following conditional probability:*
*EP*(*A*,*B*) = *Prob*(**B**(*x*)   **B** (*x’*) | *x*   *x’*).
-  This equation can be reduced to:
*EP(A,B) = *1 – exp( – Coupling(*A*, *B*)) + exp( – Cohesion(*B*)).

## Definition of the Quantitative Factors: error propagation			 	Continued

-  From the analysis of the above equation:
- The higher the coupling from *A* to *B* – the higher is the error propagation from *A* to *B*.
- The lower the cohesion of component *B* – the higher is the error propagation from *A* to *B*.
-  These observations, consistent with intuition, provide an analytical validation of our metrics. Our equation gives these relationships (which are not surprising by themselves) precise analytical form.

## Informational Integrity Coefficient (IIC)

- One of architecture quality guidelines is *to maximize cohesion and minimize coupling* of components.
- We introduce a quantitative characteristic, which we call the *informational* *integrity coefficient* of an architecture which assesses its conformance to this guideline.
-  The coefficient is computed based on the information flow matrix.

*IIC* =

## HCS case study :HCS-ITCS (flattened) Static Control Matrix 

-  IIC =  0.749

## HCS case study :ITCS Static Control Matrix 

-  IIC =  0.795

## HCS case study :HCS Static Control Matrix (LEVEL 1) 

-  IIC =  0.861

## HCS case study :HCS-ITCS (flattened) Dynamic Control Matrix 

- HCS case study :HCS-ITCS (flattened) Dynamic Control Matrix

## HCS case study :ITCS Dynamic Control Matrix 

-  IIC =  0.884

## HCS case study : HCS Dynamic Control Matrix (LEVEL 1) 

-  IIC =  0.887

## HCS case study : IIC ComparisonFlattened Architecture Vs Hierarchical Architecture

| Architecture | Static | Dynamic |
| --- | --- | --- |
| HCS-ITCS (flattened) | 0.749 | 0.773 |
| HCS_ITCS (Level 1) | 0.861 | 0.887 |
| ITCS (Level 0) | 0. 795 | 0.844 |
| N3 (Level 0) | 1 | 1 |
| Queues (Level 0) | 1 | 1 |

- The flattened architecture shows a lower IIC than the hierarchical architecture, this proves that the hierarchical architecture is more cohesive and less coupled

## Conclusions (achievements)

- We defined coupling and cohesion metrics for hierarchical architectures based on the information theory.
- We introduced a normalized measure,  the *informational integrity coefficient (IIC)* of an architecture based on the computed metrics
- We derived the relationship between the coupling/cohesion metrics and the *error propagation factor *between components.

## Papers submitted

**Conferences**
*Annual International Computer Software and Applications* Conference (COMPSAC 2001)Title: "Information-Theoretic Metrics for Software Architectures“
- 	– Status: Accepted for publication
*Automated Software Engineering* Conference (ASE 2001)
- 	Title: "Quantifying Architectural Attributes of UML Specifications: A Framework and Its Automation" – Status: Submitted June 29, 2001
**Journals**
*Automated Software Engineering* JournalTitle: "Quantifying Software Architectures: Definitions and Automation Plans“ – Status: submitted: May 11, 2001
*Transactions on Software Engineering* JournalTitle: "Information Theoretic Metrics for Software Architectures" – Status: submitted: April, 2001

## Future Work 

- Deriving a relationship between our coupling/cohesion metrics and the *change propagation,*
- Developing an automation methodology for computing the metrics given a UML description of the architecture,
- Validating the metrics using a NASA CASE Study

## Automation support for metrics computation

- Software System

*Conceptual view* (RoseRT-UML)

- Static Metrics

- Quantitative factors
-  (EP, CP)

- Dynamic Metrics

*Transformation*

- Information Integrity Coefficient