Thư viện tri thức trực tuyến
Kho tài liệu với 50,000+ tài liệu học thuật
© 2023 Siêu thị PDF - Kho tài liệu học thuật hàng đầu Việt Nam

Software measurement and estimation
Nội dung xem thử
Mô tả chi tiết
Software
Measurement
and Estimation
A Practical Approach
Linda M. Laird
M. Carol Brennan
A John Wiley & Sons, Inc., Publication
Software
Measurement
and Estimation
Press Operating Committee
Chair Editor-in-Chief
Roger U. Fujii, Donald F. Shafer
Vice President Chief Technology Officer
Northrop Grumman Mission Systems Athens Group, Inc.
Board Members
Mark J. Christensen, Independent Consultant
Herb Krasner, President, Krasner Consulting
Ted Lewis, Professor Computer Science, Naval Postgraduate School
Hal Berghel, Professor and Director School of Computer Science, University of Nevada
Phillip Laplante, Associate Professor Software Engineering, Penn State University
Richard Thayer, Professor Emeritus, California State University, Sacramento
Linda Shafer, Professor Emeritus University of Texas at Austin
James Conrad, Associate Professor UNC- Charlotte
Deborah Plummer, Manager- Authored books
IEEE Computer Society Executive Staff
David Hennage, Executive Director
Angela Burgess, Publisher
IEEE Computer Society Publications
The world-renowned IEEE Computer Society publishes, promotes, and distributes a wide variety of
authoritative computer science and engineering texts. These books are available from most retail
outlets. Visit the CS Store at http://computer.org/cspress for a list of products.
IEEE Computer Society / Wiley Partnership
The IEEE Computer Society and Wiley partnership allows the CS Press authored book program to
produce a number of exciting new titles in areas of computer science, computing and networking with
a special focus on software engineering. IEEE Computer Society members continue to receive a 15%
discount on these titles when purchased through Wiley or at wiley.com/ieeecs
To submit questions about the program or send proposals please e-mail [email protected] or
write to Books, IEEE Computer Society, 100662 Los Vaqueros Circle, Los Alamitos, CA 90720-1314.
Telephone 1 1-714-821-8380.
Additional information regarding the Computer Society authored book program can also be
accessed from our web site at http://computer.org/cspress
Software
Measurement
and Estimation
A Practical Approach
Linda M. Laird
M. Carol Brennan
A John Wiley & Sons, Inc., Publication
Copyright # 2006 by the IEEE Computer Society. All rights reserved.
Published by John Wiley & Sons, Inc., Hoboken, New Jersey.
Published simultaneously in Canada.
No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or
by any means, electronic, mechanical, photocopying, recording, scanning, or otherwise, except as permitted under Section 107 or 108 of the 1976 United States Copyright Act, without either the prior
written permission of the Publisher, or authorization through payment of the appropriate per-copy fee
to the Copyright Clearance Center, Inc., 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400,
fax (978) 750-4470, or on the web at www.copyright.com. Requests to the Publisher for permission
should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street,
Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/
permission.
Limit of Liability/Disclaimer of Warranty: While the publisher and author have used their best efforts in
preparing this book, they make no representations or warranties with respect to the accuracy or completeness of the contents of this book and specifically disclaim any implied warranties of merchantability or
fitness for a particular purpose. No warranty may be created or extended by sales representatives or
written sales materials. The advice and strategies contained herein may not be suitable for your situation.
You should consult with a professional where appropriate. Neither the publisher nor author shall be liable
for any loss of profit or any other commercial damages, including but not limited to special, incidental,
consequential, or other damages.
For general information on our other products and services or for technical support, please contact our
Customer Care Department within the United States at (800) 762-2974, outside the United States at
(317) 572-3993 or fax (317) 572-4002.
Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may
not be available in electronic formats. For more information about Wiley products, visit our web site at
www.wiley.com.
Library of Congress Cataloging-in-Publication Data:
Laird, Linda M., 1952-
Software measurement and estimation: a practical approach / Linda M. Laird, M. Carol Brennan.
p.cm
Includes bibliographical references and index.
ISBN 0-471-67622-5 (cloth)
1. Software measurement. 2. Software engineering. I. Brennan, M. Carol, 1954- II. Title.
QA76.76.S65L35 2006
005.10
4- -dc22 2005028945
Printed in the United States of America
10 9 8 7 6 5 4 3 2 1
For my Mom and Dad—LML
To my family, JB, Jackie, Colleen, Claire, and Spikey—your support has always
been beyond measure. And to my mother, who I’m sure is smiling down at her
“mathematical” daughter.—MCB
Contents
Acknowledgments xv
1. Introduction 1
1.1 Objective / 1
1.2 Approach / 2
1.3 Motivation / 3
1.4 Summary / 5
References / 6
2. What to Measure 7
2.1 Method 1: The Goal Question Metrics Approach / 9
2.2 Method 2: Decision Maker Model / 10
2.3 Method 3: Standards Driven Metrics / 10
2.4 Extension to GQM: Metrics Mechanism / 11
2.5 What to Measure Is a Function of Time / 12
2.6 Summary / 12
Problems / 13
Project / 13
References / 13
vii
3. Measurement Fundamentals 15
3.1 Initial Measurement Exercise / 15
3.2 The Challenge of Measurement / 16
3.3 Measurement Models / 16
3.3.1 Text Models / 16
3.3.2 Diagrammatic Models / 18
3.3.3 Algorithmic Models / 18
3.3.4 Model Examples: Response Time / 18
3.3.5 The Pantometric Paradigm: How to
Measure Anything / 19
3.4 Meta-Model for Metrics / 20
3.5 The Power of Measurement / 21
3.6 Measurement Theory / 22
3.6.1 Introduction to Measurement Theory / 22
3.6.2 Measurement Scales / 23
3.6.3 Measures of Central Tendency and Variability / 24
3.6.3.1 Measures of Central Tendency / 25
3.6.3.2 Measures of Variability / 25
3.6.4 Validity and Reliability of Measurement / 27
3.6.5 Measurement Error / 28
3.7 Accuracy Versus Precision and the Limits of
Software Metrics / 30
3.8 Summary / 31
Problems / 31
Projects / 33
References / 33
4. Measuring Size 34
4.1 Physical Measurements of Software / 34
4.1.1 Measuring Lines of Code / 35
4.1.2 Language Productivity Factor / 35
4.1.3 Counting Reused and Refactored Code / 37
4.1.4 Counting Nonprocedural Code Length / 39
4.1.5 Measuring the Length of Specifications and Design / 39
4.2 Measuring Functionality / 40
4.2.1 Function Points / 41
4.2.1.1 Counting Function Points / 41
4.2.1.2 Function Point Example / 45
viii CONTENTS
4.2.1.3 Converting Function Points to Physical Size / 47
4.2.1.4 Converting Function Points to Effort / 47
4.2.1.5 Other Function Point Engineering Rules / 48
4.2.1.6 Function Point Pros and Cons / 49
4.2.2 Feature Points / 50
4.3 Summary / 51
Problems / 51
Project / 52
References / 53
5. Measuring Complexity 54
5.1 Structural Complexity / 55
5.1.1 Size as a Complexity Measure / 55
5.1.1.1 System Size and Complexity / 55
5.1.1.2 Module Size and Complexity / 56
5.1.2 Cyclomatic Complexity / 58
5.1.3 Halstead’s Metrics / 63
5.1.4 Information Flow Metrics / 65
5.1.5 System Complexity / 67
5.1.5.1 Maintainability Index / 67
5.1.5.2 The Agresti –Card System
Complexity Metric / 69
5.1.6 Object-Oriented Design Metrics / 71
5.1.7 Structural Complexity Summary / 73
5.2 Conceptual Complexity / 73
5.3 Computational Complexity / 74
5.4 Summary / 75
Problems / 75
Projects / 77
References / 78
6. Estimating Effort 79
6.1 Effort Estimation: Where Are We? / 80
6.2 Software Estimation Methodologies and Models / 81
6.2.1 Expert Estimation / 82
6.2.1.1 Work and Activity Decomposition / 82
6.2.1.2 System Decomposition / 83
6.2.1.3 The Delphi Methods / 84
CONTENTS ix
6.2.2 Using Benchmark Size Data / 85
6.2.2.1 Lines of Code Benchmark Data / 85
6.2.2.2 Function Point Benchmark Data / 87
6.2.3 Estimation by Analogy / 88
6.2.3.1 Traditional Analogy Approach / 89
6.2.3.2 Analogy Summary / 91
6.2.4 Proxy Point Estimation Methods / 91
6.2.4.1 Meta-Model for Effort Estimation / 91
6.2.4.2 Function Points / 92
6.2.4.3 Object Points / 94
6.2.4.4 Use Case Sizing Methodologies / 95
6.2.5 Custom Models / 101
6.2.6 Algorithmic Models / 103
6.2.6.1 Manual Models / 103
6.2.6.2 Estimating Project Duration / 105
6.2.6.3 Tool-Based Models / 105
6.3 Combining Estimates / 107
6.4 Estimating Issues / 108
6.4.1 Targets Versus Estimates / 108
6.4.2 The Limitations of Estimation: Why? / 109
6.4.3 Estimate Uncertainties / 109
6.5 Estimating Early and Often / 112
6.6 Summary / 113
Problems / 114
Projects / 116
References / 116
7. In Praise of Defects: Defects and Defect Metrics 118
7.1 Why Study and Measure Defects? / 118
7.2 Faults Versus Failures / 119
7.3 Defect Dynamics and Behaviors / 120
7.3.1 Defect Arrival Rates / 120
7.3.2 Defects Versus Effort / 120
7.3.3 Defects Versus Staffing / 120
7.3.4 Defect Arrival Rates Versus Code
Production Rate / 121
7.3.5 Defect Density Versus Module Complexity / 122
7.3.6 Defect Density Versus System Size / 122
x CONTENTS
7.4 Defect Projection Techniques and Models / 123
7.4.1 Dynamic Defect Models / 123
7.4.1.1 Rayleigh Models / 124
7.4.1.2 Exponential and S-Curves Arrival
Distribution Models / 127
7.4.1.3 Empirical Data and Recommendations for
Dynamic Models / 128
7.4.2 Static Defect Models / 129
7.4.2.1 Defect Insertion and Removal Model / 129
7.4.2.2 Defect Removal Efficiency:
A Key Metric / 130
7.4.2.3 Static Defect Model Tools / 132
7.5 Additional Defect Benchmark Data / 133
7.5.1 Defect Data by Application Domain / 133
7.5.2 Cumulative Defect Removal Efficiency
(DRE) Benchmark / 134
7.5.3 SEI Levels and Defect Relationships / 134
7.5.4 Latent Defects / 135
7.5.5 A Few Recommendations / 135
7.6 Cost Effectiveness of Defect Removal by Phase / 136
7.7 Defining and Using Simple Defect Metrics:
An Example / 136
7.8 Some Paradoxical Patterns for Customer
Reported Defects / 139
7.9 Answers to the Initial Questions / 140
7.10 Summary / 140
Problems / 141
Projects / 142
References / 142
8. Software Reliability Measurement and Prediction 144
8.1 Why Study and Measure Software Reliability? / 144
8.2 What Is Reliability? / 144
8.3 Faults and Failures / 145
8.4 Failure Severity Classes / 145
8.5 Failure Intensity / 146
8.6 The Cost of Reliability / 147
8.7 Software Reliability Theory / 148
8.7.1 Uniform and Random Distributions / 148
CONTENTS xi
8.7.2 The Probability of Failure During
a Time Interval / 150
8.7.3 F(t): The Probability of Failure by Time T / 151
8.7.4 R(t): The Reliability Function / 151
8.7.5 Reliability Theory Summarized / 152
8.8 Reliability Models / 152
8.8.1 Types of Models / 152
8.8.2 Predicting Number of Defects Remaining / 154
8.9 Failure Arrival Rates / 155
8.9.1 Predicting Failure Arrival Rates Using
Historical Data / 155
8.9.2 Engineering Rules for MTTF / 156
8.9.3 Musa’s Algorithm / 157
8.9.4 Operational Profile Testing / 158
8.9.5 Predicting Reliability Summary / 161
8.10 But When Do I Ship? / 161
8.11 System Configurations: Probability and Reliability / 161
8.12 Answers to Initial Question / 163
8.13 Summary / 164
Problems / 164
Project / 165
References / 166
9. Response Time and Availability 167
9.1 Response Time Measurements / 168
9.2 Availability / 170
9.2.1 Availability Factors / 172
9.2.2 Outage Scope / 173
9.2.3 Complexities in Measuring Availability / 173
9.2.4 Software Rejuvenation / 174
9.2.4.1 Software Aging / 175
9.2.4.2 Classification of Faults / 175
9.2.4.3 Software Rejuvenation Techniques / 175
9.2.4.4 Impact of Rejuvenation on Availability / 176
9.3 Summary / 177
Problems / 178
Project / 179
References / 180
xii CONTENTS
10. Measuring Progress 181
10.1 Project Milestones / 182
10.2 Code Integration / 185
10.3 Testing Progress / 187
10.4 Defects Discovery and Closure / 188
10.4.1 Defect Discovery / 189
10.4.2 Defect Closure / 190
10.5 Process Effectiveness / 192
10.6 Summary / 194
Problems / 195
Project / 196
References / 196
11. Outsourcing 197
11.1 The “O” Word / 197
11.2 Defining Outsourcing / 198
11.3 Risk Management and Outsourcing / 201
11.4 Metrics and the Contract / 203
11.5 Summary / 206
Problems / 206
Projects / 207
References / 207
12. Financial Measures for the Software Engineer 208
12.1 It’s All About the Green / 208
12.2 Financial Concepts / 209
12.3 Building the Business Case / 209
12.3.1 Understanding Costs / 210
12.3.1.1 Salaries / 210
12.3.1.2 Overhead costs / 210
12.3.1.3 Risk Costs / 211
12.3.1.4 Capital Versus Expense / 213
12.3.2 Understanding Benefits / 216
12.3.3 Business Case Metrics / 218
12.3.3.1 Return on Investment / 218
12.3.3.2 Payback Period / 219
12.3.3.3 Cost/Benefit Ratio / 220
12.3.3.4 Profit and Loss Statement / 221
CONTENTS xiii