CS24353 • MODULE 5

Module 5: Project Estimation, Quality Assurance, CMMI & Maintenance

Topics 56 to 67 • Halstead Metrics, COCOMO I/II, Function Point Analysis, CMMI Levels, SCM & Lehman's Laws

Author: Shaswat Raj (BIT Mesra) Academic Year: 2024–25 (5th Sem CSE) Standard: IEEE & ISO/IEC Standards

Topic 26: Software Cost Estimation & Halstead's Software Science

Accurate software project estimation prevents budget overruns and unrealistic deadlines. Maurice Halstead (1977) developed a formal analytical framework measuring software properties directly from code tokens:

📐 Halstead's Software Science Mathematical Equations

Let $n_1 = \text{Unique operators}, n_2 = \text{Unique operands}, N_1 = \text{Total operators}, N_2 = \text{Total operands}$.

Topic 27: Barry Boehm's COCOMO I & COCOMO II Models

The Constructive Cost Model (COCOMO) uses empirical regressions calibrated against historical project datasets:

Project Mode Team & Complexity Profile Effort Equation ($E$ in PM) Development Time ($T_{\text{dev}}$ in Months)
1. Organic Small, experienced teams working with stable, well-understood requirements in familiar environments. $$\mathbf{E = 2.4 \times (\text{KLOC})^{1.05}}$$ $$\mathbf{T_{\text{dev}} = 2.5 \times (E)^{0.38}}$$
2. Semi-Detached Medium-sized teams with mixed experience levels working with partially fluid requirements. $$\mathbf{E = 3.0 \times (\text{KLOC})^{1.12}}$$ $$\mathbf{T_{\text{dev}} = 2.5 \times (E)^{0.35}}$$
3. Embedded Strict hardware, software, and operational constraints; flight control, medical devices. $$\mathbf{E = 3.6 \times (\text{KLOC})^{1.20}}$$ $$\mathbf{T_{\text{dev}} = 2.5 \times (E)^{0.32}}$$
🏛️ Solved Numerical 5: Complete COCOMO Cost & Staffing Estimation

A software development team is tasked with building a Semi-Detached enterprise billing system estimated at $\text{Size} = \mathbf{50 \text{ KLOC}}$.

Topic 28: Albrecht's Function Point Analysis (FPA)

Function Points (Allan Albrecht, IBM 1979) measure software size based on delivered user functionality, independent of programming language:

Information Domain Function Type Low Complexity Average Complexity High Complexity Technical Description
1. External Inputs (EI) $\times 3$ $\times 4$ $\times 6$ User input screens, transactions updating internal files.
2. External Outputs (EO) $\times 4$ $\times 5$ $\times 7$ Reports, calculation outputs, generated data exports.
3. External Inquiries (EQ) $\times 3$ $\times 4$ $\times 6$ Direct query inputs generating immediate lookup responses.
4. Internal Logical Files (ILF) $\times 7$ $\times 10$ $\times 15$ Major internal logical database tables maintained by system.
5. External Interface Files (EIF) $\times 5$ $\times 7$ $\times 10$ Files/APIs shared with external third-party systems.
📐 Value Adjustment Factor (VAF) & Adjusted Function Points Formula
$$\mathbf{\text{UFP} = \sum_{i=1}^5 \sum_{j=1}^3 W_{ij} X_{ij} \qquad \text{TDI} = \sum_{k=1}^{14} C_k \quad (0 \le C_k \le 5)}$$ $$\mathbf{\text{VAF} = 0.65 + 0.01 \times \text{TDI} \qquad \text{FP} = \text{UFP} \times \text{VAF}}$$

Where $\text{TDI}$ is the Total Degree of Influence across 14 General System Characteristics (data communications, distributed processing, performance, transaction rate, reusability).

🏛️ Solved Numerical 6: Complete Function Point Analysis Calculation

A university portal project has the following functional counts with average complexity:

Topic 29: SEI Capability Maturity Model Integration (CMMI)

The SEI CMMI Framework evaluates an organization's software process maturity across 5 evolutionary levels:

CMMI LevelProcess CharacterizationKey Process Areas (KPAs)
Level 1: InitialAd-hoc, chaotic, heroic efforts. Unpredictable budget and quality.Zero formalized processes.
Level 2: ManagedProject-level discipline. Projects are planned, performed, and controlled.Requirements Management, Project Planning, SCM, QA.
Level 3: DefinedOrganization-wide standardized engineering processes documented across all teams.Organizational Process Definition, Technical Solution, Verification.
Level 4: Quantitatively ManagedSub-processes measured statistically with quantitative quality targets.Quantitative Project Management, Statistical Process Control.
Level 5: OptimizingContinuous process improvement powered by causal defect analysis.Causal Analysis and Resolution, Organizational Innovation.

Topic 30: Software Maintenance, Lehman's Laws & SCM

Lientz & Swanson Maintenance Taxonomy

Lehman's Laws of Software Evolution

  1. I. Continuing Change: A system used in an environment must continually adapt or become progressively less useful.
  2. II. Increasing Complexity: As software evolves, its complexity increases unless active work is done to maintain its structure.
  3. VI. Continuing Growth: The functional capability of software must continually increase over its lifetime to maintain customer satisfaction.

Topic 31: University Exam Problem Bank & Model Answers

Q10. Explain Software Configuration Management (SCM) and the Role of the Change Control Board (CCB). (8 Marks)
SCM controls evolution across all software artifacts (code, SRS, design, test cases):
1. Software Configuration Items (SCIs): Documented baselined components under formal version control.
2. Change Control Board (CCB): Cross-functional steering committee that reviews all formal Change Requests (CRs), analyzes business/cost impact, and issues approvals/rejections.
3. SCM Audits: Functional Configuration Audits (verifies SCI passes all functional tests) vs. Physical Configuration Audits (verifies code and documentation match exact build release versions).
Q11. Explain Software Re-engineering and Compare Reverse Engineering with Forward Engineering. (8 Marks)
Re-engineering modernizes aging legacy systems without changing external business functionality:
• Reverse Engineering: Analyzing existing legacy binary/source code to extract higher-level design models, data schemas, and business rules.
• Restructuring: Transforming spaghetti code and obsolete database schemas into modular, clean architectures.
• Forward Engineering: Applying modern software engineering practices to rebuild the system on modern cloud/microservices stacks, completely eliminating technical debt!

Topic 54: Intermediate COCOMO & The 15 Effort Multipliers

Intermediate COCOMO refines nominal effort by multiplying by an Effort Adjustment Factor (EAF) derived from 15 cost drivers rated from Very Low to Extra High:

$$\mathbf{E = a \times (\text{KLOC})^b \times \text{EAF} \qquad \text{where } \text{EAF} = \prod_{i=1}^{15} \text{EM}_i}$$
Cost Driver CategorySpecific Effort Multipliers ($\text{EM}_i$)Impact Range on Project Effort
Product AttributesRequired Software Reliability (`RELY`), Database Size (`DATA`), Product Complexity (`CPLX`).$0.75 \text{ (Low)} \leftrightarrow 1.40 \text{ (Extra High)}$
Computer AttributesExecution Time Constraint (`TIME`), Memory Constraint (`STOR`), Platform Volatility (`VIRT`).$1.00 \text{ (Nominal)} \leftrightarrow 1.66 \text{ (Severe limit)}$
Personnel AttributesAnalyst Capability (`ACAP`), Programmer Capability (`PCAP`), Language Experience (`LEXP`).$1.46 \text{ (Very Low)} \leftrightarrow 0.70 \text{ (Expert team)}$
Project AttributesModern Programming Practices (`MODP`), Software Tools (`TOOL`), Required Schedule (`SCED`).$1.24 \text{ (No tools)} \leftrightarrow 0.83 \text{ (Advanced CI/CD)}$
🏛️ Solved Numerical 10: Complete Halstead Software Science Metric Trace

A C++ function contains $n_1 = 4$ unique operators, $n_2 = 8$ unique operands, $N_1 = 12$ total operators, and $N_2 = 16$ total operands:

Topic 55: The 8 Laws of Software Evolution (Meir Lehman)

LawFormal Law NameEngineering Law Axiom
IContinuing ChangeAn E-type system must be continually adapted else it becomes progressively less satisfactory.
IIIncreasing ComplexityAs a system evolves, its complexity increases unless work is done to maintain or reduce it.
IIISelf RegulationEvolution processes are self-regulating with statistically determinable distributions of product measures.
IVConservation of Organizational StabilityThe average effective global activity rate in an evolving system is invariant over product lifetime.
VConservation of FamiliarityThe incremental growth of an evolving system declines with each release to preserve team familiarity.
VIContinuing GrowthThe functional capability of a system must continually increase to maintain user satisfaction.
VIIDeclining QualityQuality will appear to decline unless rigorously maintained and adapted to operational environment changes.
VIIIFeedback SystemEvolution processes constitute multi-loop, multi-agent feedback systems that must be managed.

Topic 56: University Exam Problem Bank (Part II)

Q20. Differentiate between ISO 9001 and SEI CMMI across Scope, Focus, and Implementation. (8 Marks)
DimensionISO 9001:2015SEI CMMI Framework
ScopeGeneric quality management across all industries (manufacturing, services).Specialized specifically for software and systems engineering.
ApproachPass/Fail threshold certification (You either meet the standard or you don't).Graded 5-level continuous maturity scale (Level 1 to Level 5).
Primary FocusCustomer satisfaction and compliance to documented processes.Continuous process improvement and statistical defect reduction.
Auditing BodyExternal accredited third-party ISO registrars.Certified SEI Lead Appraisers (SCAMPI appraisal).
Q21. What is Software Configuration Audit? Differentiate between FCA and PCA. (8 Marks)
Configuration Audits verify that software products conform to specifications before release:
• Functional Configuration Audit (FCA): Verifies through formal test execution logs that the configuration item has satisfied all functional and performance requirements specified in the SRS.
• Physical Configuration Audit (PCA): Inspects the physical build artifacts, confirming that the source code, build scripts, user manuals, and release notes match the exact version numbers specified in the baseline documentation!

Topic 57: COCOMO II 5 Scale Factors ($W_i$)

In COCOMO II, project size diseconomy of scale is determined by 5 Scale Factors ($W_i$ rated 0 to 5):

$$\mathbf{B = 0.91 + 0.01 \times \sum_{i=1}^5 W_i \qquad E = A \times (\text{KSLOC})^B \times \prod \text{EM}_i}$$
Scale FactorMeaningImpact on Exponent $B$
1. PREC (Precedentedness)Domain familiarity and team past project experience.High experience lowers $B \rightarrow 0.91$ (Economy of scale).
2. FLEX (Development Flexibility)Relaxation of strict pre-defined requirement specs.High flexibility lowers $B$.
3. RESL (Architecture / Risk Resolution)Percentage of risks resolved prior to development.Early risk resolution lowers $B$.
4. TEAM (Team Cohesion)Team communication and shared vision.High cohesion lowers $B$.
5. PMAT (Process Maturity)SEI CMMI Process maturity rating.CMMI Level 5 drops $W_5 \rightarrow 0.0$.
🏛️ Solved Problem 14: Defect Density & Phase Containment Effectiveness (PCE)

In a $40 \text{ KLOC}$ system, 120 defects were detected during development inspections, and 30 defects were discovered in production:

$$\mathbf{\text{Defect Density} = \frac{\text{Total Defects}}{\text{Size in KLOC}} = \frac{120 + 30}{40} = \frac{150}{40} = \mathbf{3.75 \text{ Defects/KLOC}}}$$ $$\mathbf{\text{Phase Containment Effectiveness (PCE)} = \frac{\text{In-Phase Defects}}{\text{In-Phase} + \text{Escaped Defects}} = \frac{120}{120 + 30} = \frac{120}{150} = \mathbf{0.80 = 80.0\%}}$$

Topic 58: SEI CMMI 5 Maturity Levels & Key Process Areas (KPAs)

CMMI Maturity LevelFocusKey Process Areas (KPAs) Required for Certification
Level 1: InitialCompetent people & heroicsNo KPAs. Unpredictable, poorly controlled, reactive environments.
Level 2: ManagedBasic project managementRequirements Management (REQM), Project Planning (PP), Project Monitoring and Control (PMC), Supplier Agreement Management (SAM), Measurement and Analysis (MA), Process and Product Quality Assurance (PPQA), Configuration Management (CM).
Level 3: DefinedProcess standardizationRequirements Development (RD), Technical Solution (TS), Product Integration (PI), Verification (VER), Validation (VAL), Organizational Process Focus (OPF), Organizational Training (OT), Risk Management (RSKM), Decision Analysis and Resolution (DAR).
Level 4: Quantitatively ManagedQuantitative managementOrganizational Process Performance (OPP), Quantitative Project Management (QPM). (Uses Statistical Process Control charts).
Level 5: OptimizingContinuous improvementOrganizational Performance Management (OPM), Causal Analysis and Resolution (CAR).
🏛️ Solved Numerical 18: Function Point Analysis Gear Factor Code Size Estimation

An enterprise project is estimated at $\text{FP} = 250 \text{ Function Points}$. Estimate source code size across different language stacks:

🏛️ Solved Problem 26: Intermediate COCOMO with Cost Driver Multipliers

A $30 \text{ KLOC}$ embedded system has High Reliability requirement ($\text{EM}_1 = 1.15$), High Execution Constraint ($\text{EM}_2 = 1.11$), and Expert Team ($\text{EM}_3 = 0.82$):

🏛️ Solved Problem 27: Software Science Potential Volume ($V^*$) and Language Level ($L$)

For minimum potential representation with $n_2^* = 4$ input/output parameters: $V^* = (2 + n_2^*)\log_2(2 + n_2^*) = 6 \log_2(6) = \mathbf{15.51 \text{ Bits}}$. Program Level $L = V^* / V = 15.51 / 100.38 \approx \mathbf{0.1545}$.

🏛️ Solved Problem 36: COCOMO II Early Design vs Post-Architecture Models

• Early Design Model: Used during requirements phase when code architecture is emerging; uses 7 aggregated cost drivers.
• Post-Architecture Model: Used during detailed construction; uses all 17 detailed cost drivers and 5 scale factors $W_i$ for high-precision cost prediction!

🏛️ Solved Problem 37: Software Re-engineering Reverse Engineering Metrics

In legacy modernization, Cyclomatic Complexity per Function and Fan-In / Fan-Out Ratios identify high-risk candidate modules for containerized microservice extraction!

🏛️ Solved Problem 46: Halstead Software Science Stroud Number Derivation

Psychologist John Stroud determined that the human brain can process a maximum of $S = 18$ elementary mental discriminations per second. Dividing total programming effort $E$ by $18$ yields exact estimated human cognitive coding time $T = E/18$ seconds!

🏛️ Solved Problem 47: Software Configuration Item (SCI) Baseline Dependency Graph

In enterprise SCM: An approved Release Baseline binds `SRS v2.1`, `Architecture v1.4`, `Commit SHA-7f8a9`, and `Test Run #402`, ensuring reproducible zero-drift deployment across production clusters!

🏛️ Solved Problem 56: COCOMO II Early Design Unadjusted Function Point Sizing

Convert $150 \text{ Function Points}$ to KSLOC in C++ ($53 \text{ SLOC/FP}$): $\text{Size} = 150 \times 53 = 7,950 \text{ SLOC} = \mathbf{7.95 \text{ KSLOC}}$. Compute Effort with scale factor $B = 1.10$: $E = 2.94 \times (7.95)^{1.10} \approx \mathbf{28.7 \text{ Person-Months}}$!

🏛️ Solved Problem 57: Technical Debt Ratio (TDR) Formula

In SonarQube static analysis: $\text{TDR} = \frac{\text{Remediation Cost}}{\text{Development Cost}} \times 100\%$. A TDR $< 5\%$ indicates clean, highly maintainable code!

🏛️ Solved Problem 66: COCOMO II Nominal Effort Multipliers Calibration

Calculate EAF for High Security ($1.15$), High Execution Constraint ($1.11$), and Expert Team ($0.75$): $\text{EAF} = 1.15 \times 1.11 \times 0.75 \approx \mathbf{0.9574}$. Results in a $4.26\%$ net effort reduction!

🏛️ Solved Problem 67: Cyclomatic Complexity vs Maintainability Index (MI)

Maintainability Index $\text{MI} = 171 - 5.2 \ln(V) - 0.23 V(G) - 16.2 \ln(\text{LOC})$. A score $> 85$ indicates highly maintainable code with minimal technical debt!

🏛️ Solved Problem 75: Function Point Analysis General System Characteristics (GSC) Scoring

The 14 GSCs evaluate environmental complexity (data comms, online update, reusability, installation ease). Each is rated 0 (no influence) to 5 (strong influence). The sum $\text{TDI} \in [0, 70]$ shifts the VAF multiplier between $0.65$ and $1.35$!

🏛️ Solved Problem 76: Software Re-engineering Code Smells & Refactoring

Identify common code smells: Long Method (refactor via Extract Method), Large Class (refactor via Extract Class), Feature Envy (refactor via Move Method), and Primitive Obsession (refactor to Value Objects)!

🏛️ Solved Problem 88: SCM Gitflow vs Trunk-Based Development

• Gitflow: Uses long-lived branches (`feature/*`, `develop`, `release/*`, `hotfix/*`, `main`). Suitable for scheduled quarterly enterprise releases.
• Trunk-Based Development: Developers merge short-lived branches directly to `main` daily behind feature flags. Required for high-velocity CI/CD deployments (10+ deploys/day)!

🏛️ Solved Problem 89: Software Maintenance Effort Distribution by Lientz & Swanson

Empirical studies across Fortune 500 companies prove that $\approx 50\%$ of software maintenance expenditure is Perfective (adding new features and user enhancements), debunking the myth that maintenance is just fixing bugs!

🏛️ Solved Problem 90: Software Re-engineering Technical Debt Remediation Lifecycle
$$\text{Code Smell Detection} \rightarrow \text{Automated Unit Testing} \rightarrow \text{Stepwise Refactoring} \rightarrow \text{Regression Verification} \rightarrow \text{Zero Debt Baseline!}$$
🏛️ Solved Problem 102: ISO 9001 vs ISO/IEC 25010 Software Product Quality Model

ISO/IEC 25010 evaluates 8 software quality characteristics: Functional Suitability, Performance Efficiency, Compatibility, Usability, Reliability, Security, Maintainability, Portability!

🏛️ Solved Problem 103: Software Maintenance Ripple Effect Analysis

Using call graphs and dependency matrices to compute the exact reachability set of classes affected when modifying a central database schema column!

🏛️ Solved Problem 104: Software Re-engineering Code Restructuring via Microservices Migration

Using the Strangler Fig Pattern to incrementally replace monolithic legacy components with containerized microservices behind an API gateway with zero system downtime!

🏛️ Solved Problem 116: Software Product Lines (SPL) & Domain Engineering

Maximizes software asset reuse across product variants by defining a shared Core Architecture and Feature Model with explicit variation points!

🏛️ Solved Problem 117: COCOMO II Post-Architecture Cost Drivers Calibration

Calibrating 17 detailed effort multipliers ($\text{EM}_i$) for High Storage Constraints ($1.21$), High Platform Volatility ($1.15$), and High Team Cohesion ($0.86$), generating high-precision cost and staffing estimates!

🏛️ Solved Problem 118: Software Evolution Legacy System Modernization Strategies

The 5 Rs of Legacy Modernization: Rehost (lift and shift), Refactor (code cleanup), Rearchitect (microservices), Rebuild (cloud native), Replace (commercial SaaS)!

🏛️ Solved Problem 127: Software Cost Estimation Machine Learning Regression Models

Training ensemble random forests and neural networks on historical ISBSG benchmark datasets to predict project effort with $< 10\%$ mean absolute relative error!

🏛️ Solved Problem 128: Software Architecture Drift & Technical Debt Governance

Enforcing architectural fitness functions in CI/CD pipelines (ArchUnit) to automatically fail builds when forbidden cross-layer dependencies are introduced!

🏛️ Solved Problem 137: Function Point Analysis for Object-Oriented Software (COSMIC Function Points)

The COSMIC FP Standard (ISO/IEC 19761) measures software size based on 4 fundamental data movements (Entry $E$, Exit $X$, Read $R$, Write $W$), providing a mathematically continuous metric for modern microservices and real-time event systems!

🏛️ Solved Problem 138: Software Technical Debt Valuation via Financial Option Models

Treating refactoring investments as financial call options: Refactoring high-churn modules yields compound interest by slashing future feature addition latency!

🏛️ Solved Problem 142: Software Evolution 8 Lehman Laws Architecture Mapping

Applying Lehman's Second Law (Increasing Complexity) to justify dedicated $20\%$ refactoring sprints in enterprise banking software!

🏛️ Solved Problem 149: COCOMO II Scale Factors Mathematical Proof

Deriving the project size exponent $B = 0.91 + 0.01 \sum W_i$ to quantify the transition from diseconomy of scale ($B > 1.0$) to economy of scale ($B < 1.0$)!

🏛️ Solved Problem 150: Automated Technical Debt Governance in CI Pipelines

Failing CI builds automatically when new code introduces cyclic dependencies or causes test coverage to drop below the $85\%$ quality gate threshold!

🏛️ Solved Problem 157: Software Process Quality Control Charts (Shewhart Control Charts)

Plotting defect discovery rate per inspection against Upper Control Limit (UCL) and Lower Control Limit (LCL) to trigger root-cause corrective action when out of statistical control!

🏛️ Solved Problem 158: Enterprise SCM Configuration Status Accounting (CSA)

Maintaining historical audit logs tracking what was changed, why it was changed, who authorized the change, and when the change was released to production clusters!

🏛️ Solved Problem 165: Function Point Analysis Gear Factor Calibration Across Modern Stacks

Comparing Java ($53 \text{ LOC/FP}$), TypeScript ($42 \text{ LOC/FP}$), and Python ($21 \text{ LOC/FP}$): Quantifying how high-level abstractions cut total codebase volume and maintenance defect surface!

🏛️ Solved Problem 166: Technical Debt Compounding Interest & Refactoring ROI

Mathematical proof: Investing 2 sprints in debt remediation cuts future sprint bug-fixing overhead by $40\%$, paying back the investment within 4 months!