# Software Engineering: COCOMO, Function Points, Cyclomatic Complexity & Cohesion
Exam: UGC NET Computer Science & Applications (Code 87) (UGC NET CS)
Subject: Unit 6: Software Engineering
Canonical URL: https://gateandnet.com/exams/ugc-net-cs/net-software-engineering/cocomo-cyclomatic-and-cohesion-coupling

> Guaranteed 6–8 marks in UGC NET CS: Basic COCOMO coefficients, McCabe V(G) formulas, and exact Cohesion/Coupling rankings.

## Cohesion & Coupling Order (Asked Almost Every UGC NET Cycle!)

Good modular design demands **HIGH Cohesion** and **LOW Coupling**:

1. **Cohesion (Best $\to$ Worst):**
   $$\text{Functional (Best)} > \text{Sequential} > \text{Communicational} > \text{Procedural} > \text{Temporal} > \text{Logical} > \text{Coincidental (Worst)}$$
2. **Coupling (Best/Loosest $\to$ Worst/Tightest):**
   $$\text{Data (Best)} < \text{Stamp} < \text{Control} < \text{External} < \text{Common} < \text{Content (Worst)}$$

> [!TRAP]
> **Content Coupling** occurs when one module directly modifies or branches into the internal data/code of another module — it is the **worst** form of coupling! **Functional Cohesion** is the **best** form of cohesion.


## Solved Practice Questions & PYQs

### [UGC NET CS Dec 2023 | MCQ]
A control flow graph $G$ of a software module has $14$ edges, $10$ nodes, and $1$ connected component. What is McCabe’s **Cyclomatic Complexity** $V(G)$?
**Correct Answer:** C
**Solution:** Using $V(G) = E - N + 2P = 14 - 10 + 2(1) = \mathbf{6}$.

### [UGC NET CS SE | MCQ]
In modular software design, which combination of **Cohesion** and **Coupling** produces the highest quality, most maintainable architecture?
**Correct Answer:** B
**Solution:** Good modular design maximizes intra-module focus (**High / Functional Cohesion**) and minimizes inter-module dependency (**Low / Data Coupling**). Content coupling and coincidental cohesion are the worst forms.

### [UGC NET / GATE SE | MCQ]
A module’s Control Flow Graph (CFG) has $N = 11$ nodes and $E = 14$ directed edges (single connected component). What is McCabe’s **Cyclomatic Complexity $V(G)$**?
**Correct Answer:** C
**Solution:** For a single connected component ($P = 1$), McCabe’s Cyclomatic Complexity is $V(G) = E - N + 2P = 14 - 11 + 2(1) = \mathbf{5}$ linearly independent basis paths.
