43 lines
961 B
Markdown
43 lines
961 B
Markdown
# TCC *vs* LCC
|
|
|
|
Explain under which circumstances *Tight Class Cohesion* (TCC) and *Loose Class Cohesion* (LCC) metrics produce the same value for a given Java class. Build an example of such as class and include the code below or find one example in an open-source project from Github and include the link to the class below. Could LCC be lower than TCC for any given class? Explain.
|
|
|
|
A refresher on TCC and LCC is available in the [course notes](https://oscarlvp.github.io/vandv-classes/#cohesion-graph).
|
|
|
|
## Answer
|
|
|
|
pour que TCC et LCC soit égaux il faut que toutes les pair soit direct.
|
|
|
|
Ainsi :
|
|
```
|
|
A(){
|
|
x;
|
|
y;
|
|
}
|
|
B(){
|
|
x;
|
|
y;
|
|
}
|
|
C(){
|
|
y;
|
|
}
|
|
D(){
|
|
z;
|
|
}
|
|
E(){
|
|
z;
|
|
}
|
|
```
|
|
```mermaid
|
|
flowchart
|
|
|
|
A --- B
|
|
B --- C
|
|
C --- A
|
|
|
|
D --- E
|
|
```
|
|
Ici, on a donc un total de 10 paires possibles, 4 liaison directes, et aucun pair uniquement possible par une liaison indirecte.
|
|
TCC = 4/10
|
|
LCC = 4/10
|