Unit 4 of 4 · M.Sc IT Sem 2

Unit 4: Metrics, maintenance and reengineering

Software Engineering notes · PTU syllabus (PGCA1912)

3 min read12 topics10 exam questions
On this page
  1. Unit summary
  2. A framework for product metrics
  3. Metrics for the requirements model
  4. Metrics for the design model
  5. Metrics for source code, testing and maintenance
  6. Process and project metrics
  7. Software measurement
  8. Software maintenance
  9. Reengineering
  10. Reverse engineering
  11. Restructuring
  12. Forward engineering
  13. The economics of reengineering
  14. Key terms
  15. Quick revision
  16. 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
ProcessSoftware re-engineering
  1. 1

    Inventory analysis

  2. 2

    Document restructuring

  3. 3

    Reverse engineering

  4. 4

    Code restructuring

  5. 5

    Data restructuring

  6. 6

    Forward engineering

1

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.
ProcessMeasurement process
  1. 1Formulation

    Derive appropriate measures and metrics

  2. 2Collection

    Gather the required data

  3. 3Analysis

    Compute metrics and apply tools

  4. 4Interpretation

    Evaluate results for insight into quality

  5. 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.
2

Topic 2

Metrics for the requirements model

Key termsRequirements model metrics
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.

3

Topic 3

Metrics for the design model

Key termsDesign model metrics
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
4

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).

5

Topic 5

Process and project metrics

ComparisonProcess and project metrics
Process metrics
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

Key formulasCommon metrics
  • 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

6

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.
7

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.
FrameworkTypes of maintenance
  • 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.
8

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.
CycleSoftware reengineering process model
Software reengineering process model
1Inventory analysis
2Document restructuring
3Reverse engineering
4Code restructuring
5Data restructuring
6Forward engineering
  1. 1. Inventory analysis: List all applications by size, age, business criticality
  2. 2. Document restructuring: Re-document critical parts
  3. 3. Reverse engineering: Recover design from code
  4. 4. Code restructuring: Improve code without changing behaviour
  5. 5. Data restructuring: Redesign data structures and databases
  6. 6. Forward engineering: Build the improved system
9

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.
Key termsReverse engineering concepts
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.
10

Topic 10

Restructuring

ComparisonCode and data restructuring
Code restructuring
Data 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.
11

Topic 11

Forward engineering

  • Forward engineering: using recovered design information to rebuild the system with modern engineering practices — new architecture, technology and functionality.
Key termsForward engineering examples
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.

12

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).
Key formulasSneed's cost 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

  1. Q1.Distinguish a measure and a metric.
  2. Q2.Calculate FP for count total 200 and ΣFi = 40.
  3. Q3.Name three CK metrics.
  4. Q4.Define defect removal efficiency.
  5. Q5.What is adaptive maintenance?
  6. Q6.When is reengineering economically justified?

Long-answer questions

  1. Q1.Explain the framework for product metrics and metrics for the requirements model.
  2. Q2.Explain metrics for the design model.
  3. Q3.Explain process and project metrics and software measurement.
  4. 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.

WhatsApp us