Unit 4: Metrics, maintenance and reengineering
Software Engineering notes · PTU syllabus (PGCA1912)
On this page
- Unit summary
- A framework for product metrics
- Metrics for the requirements model
- Metrics for the design model
- Metrics for source code, testing and maintenance
- Process and project metrics
- Software measurement
- Software maintenance
- Reengineering
- Reverse engineering
- Restructuring
- Forward engineering
- The economics of reengineering
- Key terms
- Quick revision
- Important questions
Unit summary
Measurement guides improvement, and most of a system's life is spent in maintenance. This unit covers the framework for product metrics, metrics for the requirements and design models, process and project metrics, software measurement, software maintenance, reengineering, reverse engineering, restructuring, forward engineering and the economics of reengineering.
After this unit you can
- Explain product, process and project metrics
- Apply metrics to requirements and design models
- Explain software maintenance
- Explain reengineering and its economics
PTU syllabus topics
- Framework for product metrics
- metrics for the requirements and design models
- process and project metrics
- software measurement
- software maintenance
- reengineering
- reverse engineering
- restructuring
- forward engineering
- economics of reengineering
- 1
Inventory analysis
- 2
Document restructuring
- 3
Reverse engineering
- 4
Code restructuring
- 5
Data restructuring
- 6
Forward engineering
Topic 1
A framework for product metrics
- Measure, metric, indicator: a measure gives a quantity; a metric relates measures (errors per KLOC); an indicator combines metrics to give insight.
- 1Formulation
Derive appropriate measures and metrics
- 2Collection
Gather the required data
- 3Analysis
Compute metrics and apply tools
- 4Interpretation
Evaluate results for insight into quality
- 5Feedback
Recommendations to the team
- Attributes of effective metrics: simple and computable, empirically and intuitively persuasive, consistent and objective, consistent in units, programming-language independent, effective feedback.
Topic 2
Metrics for the requirements model
- Function points
- Measure functionality from inputs, outputs, inquiries, files, interfaces
- Specification quality
- Specificity (lack of ambiguity) Q1 = nui ÷ nr, where nui requirements had identical interpretation by all reviewers
- Completeness
- Functional requirements covered
- Use-case points
- Size from actors and use cases
Example
FP = count total × (0.65 + 0.01 × ΣFi). Count total 320 and ΣFi = 46: FP = 320 × 1.11 = 355.
Topic 3
Metrics for the design model
- Architectural design metrics
- Structural complexity S = fan-out², data complexity, system complexity (Card and Glass)
- Morphology metrics
- Size = nodes + arcs; depth, width, arc-to-node ratio
- Object-oriented (CK) metrics
- Weighted methods per class, depth of inheritance tree, number of children, coupling between objects, response for a class, lack of cohesion
- Component-level metrics
- Cohesion, coupling, cyclomatic complexity
- Interface design metrics
- Layout appropriateness
Topic 4
Metrics for source code, testing and maintenance
Metrics measure software quality: analysis model (function points), design model (coupling, cohesion, depth of inheritance), source code (LOC, Halstead metrics), testing (test coverage, defects found) and maintenance (Software Maturity Index).
Topic 5
Process and project metrics
Purpose
Long-term process improvement across projects
Tactical control of the current project
Examples
Defect removal efficiency, errors found before release, effort per phase
Schedule and effort variance, errors per review hour, change requests
Users
Process improvement group, management
Project manager and team
Defect removal efficiency
DRE = E ÷ (E + D), errors before and defects after release
Size-oriented
Errors per KLOC, cost per LOC, pages of documentation per KLOC
Function-oriented
Errors per FP, cost per FP
Topic 6
Software measurement
- Direct measures: cost, effort, LOC, execution speed, defects reported. Indirect measures: functionality, quality, complexity, efficiency, reliability, maintainability.
- Size-oriented metrics normalise by LOC; function-oriented metrics normalise by function points; reconciling them uses average LOC per FP for each language (backfiring). Metrics for quality: correctness (defects per KLOC), maintainability (mean time to change), integrity, usability.
Topic 7
Software maintenance
- Maintenance is all work done after delivery to keep the system running and useful; it often consumes the largest share of total life-cycle cost.
Corrective
Fixing errors found after release
Adaptive
Changing for a new environment — new tax rules, OS or browser
Perfective
Adding features or improving performance on user request
Preventive
Restructuring and documenting to avoid future problems
- Maintenance process: change request → impact analysis → approval → change → testing (regression) → release and documentation update.
- Maintenance problems: poor documentation, original developers gone, code not designed for change, ripple effects. Maintainability depends on modular design, documentation, coding standards and testing.
Topic 8
Reengineering
- Reengineering: examining and altering an existing (legacy) system to reconstitute it in a new form — improving maintainability, moving to new platforms, or adding capability — at lower risk and cost than rewriting from scratch.
- 1. Inventory analysis: List all applications by size, age, business criticality
- 2. Document restructuring: Re-document critical parts
- 3. Reverse engineering: Recover design from code
- 4. Code restructuring: Improve code without changing behaviour
- 5. Data restructuring: Redesign data structures and databases
- 6. Forward engineering: Build the improved system
Topic 9
Reverse engineering
- Reverse engineering: analysing a program to create representations at a higher level of abstraction — recovering design, data structures and processing logic from source code.
- Abstraction level
- From code to program, data flow, ER models
- Completeness
- Detail provided at each level
- Interactivity
- Degree of human involvement with tools
- Directionality
- One-way (for maintenance) or two-way (for restructuring)
- Reverse engineering of data: recover data structures and database schemas; of processing: understand procedural abstractions; of user interfaces: understand screen behaviour before redesign.
Topic 10
Restructuring
Purpose
Easier-to-understand code with the same behaviour
Better data architecture
Activities
Remove spaghetti logic, apply structured constructs, refactor
Data analysis, normalisation, rationalising names, physical redesign
Example
Replacing goto chains with loops; splitting a large function
Moving flat files into a normalised database
- Refactoring is small-scale restructuring done continuously in agile development.
Topic 11
Forward engineering
- Forward engineering: using recovered design information to rebuild the system with modern engineering practices — new architecture, technology and functionality.
- Client–server re-engineering
- Mainframe application split into client and server
- Object-oriented re-engineering
- Procedural code redesigned into classes
- Web and cloud re-engineering
- Desktop application rebuilt as a web or cloud service
- User interface re-engineering
- Text screens replaced by graphical or mobile interfaces
Example
A college's 1990s FoxPro fee system is reverse engineered to recover its tables and rules, its data restructured into MySQL, and forward engineered into a web application with online payments.
Topic 12
The economics of reengineering
- Reengineering costs money and time; the decision compares the cost of continued maintenance with the cost of reengineering (Sneed's model).
Cost of maintenance
Cmaint = [P3 − (P1 + P2)] × L
Cost of reengineering
Creeng = [P6 − (P4 + P5)] × (L − P8) − (P7 × P9)
Benefit
Creeng − Cmaint; reengineer if positive
- Parameters: P1, P2 — current annual maintenance and operation cost; P3 — current annual business value; P4, P5 — annual maintenance and operation cost after reengineering; P6 — annual business value after reengineering; P7 — estimated reengineering cost; P8 — reengineering calendar time; P9 — reengineering risk factor; L — expected life of the system.
Key terms
- Indicator
- Metric combination giving insight into a process or product
- Function point
- Measure of delivered functionality
- Defect removal efficiency
- Share of defects removed before release
- Reengineering
- Transforming a system into an improved form
- Sneed's model
- Cost model comparing maintenance with reengineering
Quick revision
- Measure, metric, indicator; measurement process; attributes of good metrics.
- Function points; specification quality; architectural, OO (CK), component and interface metrics.
- Process vs project metrics; DRE; size- and function-oriented metrics.
- Corrective, adaptive, perfective, preventive maintenance.
- Reengineering process; reverse engineering; restructuring; forward engineering; Sneed's economics.
Important exam questions
Practice questions written to the PTU exam pattern for this unit's syllabus: short answers (Section A style) and long answers (Sections B and C style).
Short-answer questions
- Q1.Distinguish a measure and a metric.
- Q2.Calculate FP for count total 200 and ΣFi = 40.
- Q3.Name three CK metrics.
- Q4.Define defect removal efficiency.
- Q5.What is adaptive maintenance?
- Q6.When is reengineering economically justified?
Long-answer questions
- Q1.Explain the framework for product metrics and metrics for the requirements model.
- Q2.Explain metrics for the design model.
- Q3.Explain process and project metrics and software measurement.
- Q4.Explain software maintenance, reengineering and its economics.
Stuck on this unit?
Message SBS on WhatsApp for help with Software Engineering, or to ask about studying M.Sc IT at Synetic.
