Mô tả:
Douglas Bell
A Programming Approach
fourth edition
for Students
Engineering
for Students
Software
Software
“Bell covers the main areas of software engineering with
accuracy and authority, and without getting bogged down
in superfluous detail. My students actually like this book;
it's very readable.”
Engineering
Software Engineering
Martin Bush, South Bank University
●
Pragmatic, non-mathematical approach
●
Self-test questions within each chapter help the reader to fully understand the concepts
●
Numerous exercises are provided at the end of each chapter
●
Consistent use of the UML as a design notation
●
Software
Engineering
for Students
for Students
A Programming Approach
fourth edition
Case studies used throughout
●
fourth edition
Features
A Programming Approach
This fully revised version of Douglas Bell’s Software Engineering: A Programming Approach continues to use
the successful formula of the previous editions. The author’s approach is to present the main principles,
techniques and tools used in software engineering, one by one, chapter by chapter. He provides the reader
with the knowledge to select the appropriate techniques for the project in hand. He builds on the reader’s
experience of coding small-scale applications, and examines everything they will need to begin programming
large-scale software systems. This book is a unique introduction to software engineering for all students of
computer science and its related disciplines. It is also ideal for practitioners wishing to remain current with
new developments in the area.
Douglas Bell
An accompanying website with even more teaching and learning resources
Douglas Bell is a lecturer at Sheffield Hallam University in the UK. He has authored and co-authored
a number of texts, including the best-selling Java for Students.
Douglas Bell
an imprint of
www.pearson-books.com
www.it-ebooks.info
BELL_A01.QXD 2/2/05 3:20 PM Page i
Software Engineering
for Students
www.it-ebooks.info
BELL_A01.QXD 2/2/05 3:20 PM Page ii
We work with leading authors to develop the
strongest educational materials in computing,
bringing cutting-edge thinking and best learning
practice to a global market.
Under a range of well-known imprints, including
Addison-Wesley, we craft high quality print and
electronic publications which help readers to
understand and apply their content, whether
studying or at work.
To find out more about the complete range of our
publishing, please visit us on the World Wide Web
at: www.pearsoned.co.uk
www.it-ebooks.info
BELL_A01.QXD 2/2/05 3:20 PM Page iii
Software Engineering
for Students
A Programming Approach
Fourth Edition
DOUGLAS BELL
www.it-ebooks.info
BELL_A01.QXD 2/2/05 3:20 PM Page iv
Pearson Education Limited
Edinburgh Gate
Harlow
Essex CM20 2JE
England
and Associated Companies throughout the world
Visit us on the World Wide Web at:
www.pearsoned.co.uk
First published under the Prentice Hall imprint 1987
Second edition 1992
Third edition 2000
Fourth edition 2005
© Prentice Hall International 1987, 1992
© Pearson Education Limited 2000, 2005
The right of Douglas Bell to be identified as author of this work has been asserted by him in accordance
with the Copyright, Designs and Patents Act 1988.
All rights reserved. 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 or otherwise,
without either the prior written permission of the publisher or a licence permitting restricted copying in
the United Kingdom issued by the Copyright Licensing Agency Ltd, 90 Tottenham Court Road,
London W1T 4LP.
The programs in this book have been included for their instructional value. They have been tested with
care but are not guaranteed for any particular purpose. The publisher does not offer any warranties or
representations nor does it accept any liabilities with respect to the programs.
All trademarks used herein are the property of their respective owners. The use of any trademark in this
text does not vest in the author or publisher any trademark ownership rights in such trademarks, nor
does the use of such trademarks imply any affiliation with or endorsement of this book by such owners.
ISBN 0 321 26127 5
British Library Cataloguing-in-Publication Data
A catalogue record for this book is available from the British Library
Library of Congress Cataloging-in-Publication Data
Bell, Doug, 1944Software engineering for student/Douglas Bell. -- 4th ed.
p. cm.
Rev. ed. of: Software engineering. 2000.
ISBN 0-321-26127-5
1. Software engineering. 2. Computer programming. I. Bell, Doug, 1944Software engineering. II. Title.
QA76.758.B45 2005
005.1--dc22
2004062346
10 9 8 7 6 5 4 3 2 1
09 08 07 06 05
Typeset in 9.75/12pt Galliard by 71
Printed in Great Britain by Henry Ling Ltd, at the Dorset Press, Dorchester, Dorset
The publisher’s policy is to use paper manufactured from sustainable forests.
www.it-ebooks.info
BELL_A01.QXD 2/2/05 3:20 PM Page v
Contents
Preface
xix
Part A
G
1.
2.
3.
4.
Part B
G
5.
6.
7.
8.
9.
10.
11.
12.
13.
Part C
G
14.
15.
16.
17.
18.
Preliminaries
1
Software – problems and prospects
The tasks of software development
The feasibility study
Requirements engineering
3
22
30
36
Design
51
User interface design
Modularity
Structured programming
Functional decomposition
Data flow design
Data structure design
Object-oriented design
Design patterns
Refactoring
53
67
87
102
111
121
139
151
165
Programming languages
The basics
Object-oriented programming
Programming in the large
Software robustness
Scripting
173
175
200
221
237
259
v
www.it-ebooks.info
BELL_A01.QXD 2/2/05 3:20 PM Page vi
vi
Contents
Part D
G
Verification
265
19. Testing
20. Groups
Part E
G
21.
22.
23.
24.
25.
26.
27.
Part F
G
267
283
Process models
289
The waterfall model
The spiral model
Prototyping
Incremental development
Open source software development
Agile methods and extreme programming
The unified process
Project management
28. Teams
29. Software metrics and quality assurance
30. Project management
Part G
G
Review
291
297
303
314
322
330
337
345
347
357
370
383
31. Assessing methods
32. Conclusion
385
392
Appendices
405
A. Case studies
B. Glossary
C. UML summary
407
411
412
Bibliography
Index
417
419
www.it-ebooks.info
BELL_A01.QXD 2/2/05 3:20 PM Page vii
Detailed contents
Preface
xix
Part A
1
G
1
Software – problems and prospects
1.1
1.2
1.3
1.4
1.5
1.6
1.7
1.8
1.9
1.10
1.11
2
Preliminaries
Introduction
Meeting users’ needs
The cost of software production
Meeting deadlines
Software performance
Portability
Maintenance
Reliability
Human–computer interaction
A software crisis?
A remedy – software engineering?
Summary
Exercises
Answers to self-test questions
Further reading
3
3
4
5
10
10
11
11
13
16
16
17
18
19
20
20
The tasks of software development
22
2.1
2.2
2.3
2.4
2.5
22
23
26
27
28
28
28
29
Introduction
The tasks
Process models
Methodology
Hacking
Summary
Exercises
Answer to self-test question
vii
www.it-ebooks.info
BELL_A01.QXD 2/2/05 3:20 PM Page viii
viii
Detailed contents
3
30
3.1
3.2
3.3
3.4
3.5
3.6
4
The feasibility study
30
31
31
32
32
34
34
34
35
35
Introduction
Technical feasibility
Cost-benefit analysis
Other criteria
Case study
Discussion
Summary
Exercises
Answers to self-test questions
Further reading
Requirements engineering
36
4.1
4.2
4.3
4.4
4.5
4.6
4.7
4.8
36
37
38
40
41
42
45
46
47
47
48
49
Part B
5
G
Introduction
The concept of a requirement
The qualities of a specification
How to elicit requirements
The requirements specification
The structure of a specification
Use cases
Use case diagrams
Summary
Exercises
Answers to self-test questions
Further reading
Design
51
User interface design
53
5.1
5.2
5.3
5.4
5.5
5.6
5.7
5.8
53
54
54
56
57
60
62
63
64
64
Introduction
An inter-disciplinary field
Styles of human–computer interface
Different perspectives on user interface design
Design principles and guidelines
Interface design
Case study
Help systems
Summary
Exercises
www.it-ebooks.info
BELL_A01.QXD 2/2/05 3:20 PM Page ix
Detailed contents
Answers to self-test questions
Further reading
6
ix
65
65
67
6.1
6.2
6.3
6.4
6.5
6.6
6.7
6.8
6.9
6.10
6.11
7
Modularity
67
68
70
70
73
74
76
77
79
82
84
84
85
85
86
Structured programming
7.1
7.2
7.3
7.4
7.5
8
Introduction
Why modularity?
Component types
Component size and complexity
Global data is harmful
Information hiding
Coupling and cohesion
Coupling
Cohesion
Object-oriented programming
Discussion
Summary
Exercises
Answers to self-test questions
Further reading
87
Introduction
Arguments against goto
Arguments in favor of goto
Selecting control structures
What is structured programming?
Summary
Exercises
Answer to self-test question
Further reading
87
89
92
94
96
98
99
100
101
Functional decomposition
102
8.1
8.2
8.3
102
103
107
109
109
110
110
Introduction
Case study
Discussion
Summary
Exercises
Answer to self-test question
Further reading
www.it-ebooks.info
BELL_A01.QXD 2/2/05 3:20 PM Page x
x
Detailed contents
9
111
9.1
9.2
9.3
9.4
10
Data flow design
111
113
115
117
118
119
120
120
Introduction
Identifying data flows
Creation of a structure chart
Discussion
Summary
Exercises
Answers to self-test questions
Further reading
121
10.1
10.2
10.3
10.4
10.5
10.6
11
Data structure design
121
122
126
127
130
134
136
136
138
138
Introduction
A simple example
Processing input files
Multiple input and output streams
Structure clashes
Discussion
Summary
Exercises
Answers to self-test questions
Further reading
139
11.1
11.2
11.3
11.4
11.5
11.6
11.7
12
Object-oriented design
139
140
144
145
145
146
147
147
148
149
149
Introduction
Design
Looking for reuse
Using the library
Class–responsibility–collaborator cards
Iteration
Discussion
Summary
Exercises
Answers to self-test questions
Further reading
Design patterns
151
12.1
12.2
12.3
151
152
153
Introduction
Inheritance
Delegation
www.it-ebooks.info
BELL_A01.QXD 2/2/05 3:20 PM Page xi
Detailed contents
12.4
12.5
12.6
12.7
12.8
12.9
12.10
12.11
12.12
12.13
12.14
13
Singleton
Factory method
Façade
Immutable
Model, view controller (observer, observable)
Mediator
Pipe and Filter
Proxy
Layers
Blob – an anti-pattern
Discussion
Summary
Exercises
Answers to self-test questions
Further reading
154
155
156
157
157
158
158
159
159
161
161
162
163
163
164
Refactoring
165
13.1
13.2
13.3
13.4
13.5
13.6
13.7
13.8
13.9
165
166
167
167
167
167
168
170
171
171
172
172
Part C
14
G
Introduction
Encapsulate data
Move method
Move data
Extract class
Inline class
Identify composition or inheritance
Use polymorphism
Discussion
Summary
Exercises
Answers to self-test questions
Programming languages
173
The basics
175
14.1
14.2
14.3
14.4
14.5
14.6
175
176
176
178
179
180
Introduction
Classifying programming languages and features
Design principles
Language syntax
Control structures
Selection
www.it-ebooks.info
xi
BELL_A01.QXD 2/2/05 3:20 PM Page xii
xii
Detailed contents
14.7
14.8
14.9
14.10
14.11
14.12
14.13
14.14
14.15
15
Repetition
Methods
Parameter-passing mechanisms
Primitive data types
Data typing
Strong versus weak typing
User-defined data types (enumerations)
Arrays
Records (structures)
Summary
Exercises
Answers to self-test questions
Further reading
183
186
188
190
190
191
193
194
195
196
197
198
199
200
15.1
15.2
15.3
15.4
15.5
15.6
15.7
15.8
15.9
16
Object-oriented programming
200
200
206
207
209
212
212
213
215
217
217
218
220
Introduction
Encapsulation
Library classes
Inheritance
Polymorphism
Single versus multiple inheritance
Generics
Dynamic data structures and pointers
Garbage collection
Summary
Exercises
Answers to self-test questions
Further reading
Programming in the large
221
16.1
16.2
16.3
16.4
16.5
16.6
16.7
16.8
16.9
221
223
224
226
226
227
229
230
232
Introduction
Packages
Using packages
Creating packages
Scoping in large programs
Interfaces
Interfaces and interoperability
Multiple interfaces
Separate compilation
www.it-ebooks.info
BELL_A01.QXD 2/2/05 3:20 PM Page xiii
Detailed contents
Summary
Exercises
Answers to self-test questions
Further reading
17
233
233
234
235
237
17.1
17.2
17.3
17.4
17.5
17.6
17.7
17.8
17.9
18
Software robustness
237
239
242
244
245
249
252
253
254
255
255
257
258
Introduction
Fault detection by software
Fault detection by hardware
Dealing with damage
Exceptions and exception handlers
Recovery blocks
n-version programming
Assertions
Discussion
Summary
Exercises
Answers to self-test questions
Further reading
Scripting
259
18.1
18.2
18.3
259
259
262
263
263
263
263
Part D
19
G
Introduction
Unix
Discussion
Summary
Exercises
Answers to self-test questions
Further reading
Verification
265
Testing
19.1
19.2
19.3
19.4
19.5
19.6
267
Introduction
The nature of errors
The problem of testing
Black box (functional) testing
White box (structural) testing
Other testing methods
www.it-ebooks.info
267
268
269
269
272
274
xiii
BELL_A01.QXD 2/2/05 3:20 PM Page xiv
xiv
Detailed contents
19.7
19.8
19.9
20
Groups
20.1
20.2
20.3
20.4
20.5
20.6
Part E
21
Unit testing
System (integration) testing
Discussion
Summary
Exercises
Answers to self-test questions
Further reading
G
276
277
278
278
279
281
282
283
Introduction
The individual and the error
Structured walkthroughs
Inspections
Pair programming
Discussion
Summary
Exercises
Further reading
Process models
283
283
284
286
286
287
287
288
288
289
291
21.1
21.2
21.3
21.4
22
The waterfall model
291
291
293
294
295
295
296
Introduction
Principles of the model
Feedback between stages
Discussion
Summary
Exercises
Answers to self-test questions
The spiral model
297
22.1
22.2
22.3
22.4
297
297
300
301
301
301
302
302
Introduction
The spiral model
Case study
Discussion
Summary
Exercises
Answer to self-test question
Further reading
www.it-ebooks.info
BELL_A01.QXD 2/2/05 3:20 PM Page xv
Detailed contents
23
303
23.1
23.2
23.3
23.4
23.5
23.6
23.7
24
Prototyping
303
303
304
305
307
308
310
312
312
313
Introduction
Definition
Throwaway or evolutionary?
Throwaway prototyping
Evolutionary prototyping
Rapid prototyping techniques
Discussion
Summary
Exercises
Answers to self-test questions
314
24.1
24.2
24.3
24.4
24.5
24.6
24.7
24.8
25
Incremental development
314
315
315
316
317
318
319
319
320
320
321
321
Introduction
Big-bang implementation
Test beds
Top-down implementation
Bottom-up implementation
Middle-out implementation
Use case driven implementation
Discussion
Summary
Exercises
Answers to self-test questions
Further reading
Open source software development
322
25.1
25.2
25.3
25.4
25.5
25.6
322
322
323
324
325
326
327
328
328
328
Introduction
The principles of open source development
The schism within open source development
Techniques of open source development
Case Study: the GNU/Linux operating system
Discussion
Summary
Exercises
Answers to self-test questions
Further reading
www.it-ebooks.info
xv
BELL_A01.QXD 2/2/05 3:20 PM Page xvi
xvi
Detailed contents
26
330
26.1
26.2
26.3
27
Agile methods and extreme programming
330
330
332
335
336
336
336
Introduction
The agile manifesto
Extreme programming
Summary
Exercises
Answers to self-test questions
Further reading
The unified process
337
27.1
27.2
27.3
27.4
27.5
27.6
27.7
337
337
338
339
341
341
343
343
344
344
Part F
28
G
Project management
Teams
28.1
28.2
28.3
28.4
28.5
28.6
28.7
29
Introduction
Overview
Phases of the UP
Techniques
Iteration
Case study
Discussion
Summary
Exercises
Further reading
345
347
Introduction
The principles of teams
The functional team
The project team
The chief programmer team
The object-oriented team
Discussion
Summary
Exercises
Answer To self-test question
Further reading
347
347
351
351
351
353
354
355
355
355
356
Software metrics and quality assurance
357
29.1
29.2
29.3
357
358
358
Introduction
Basic metrics
Complexity metrics
www.it-ebooks.info
BELL_A01.QXD 2/2/05 3:20 PM Page xvii
Detailed contents
29.4
29.5
29.6
29.7
29.8
30
Faults and reliability – estimating bugs
Software quality
Quality assurance
Process improvement
The Capability Maturity Model
Summary
Exercises
Answers to self-test questions
Further Reading
361
362
364
365
366
367
367
368
368
Project management
370
30.1
30.2
30.3
30.4
30.5
30.6
30.7
370
371
372
375
376
377
378
380
380
381
381
Part G
31
G
Introduction
Project inception
Cost estimation
Selecting tools and methods
The project plan
In the heat of the project
Managing people
Summary
Exercises
Answers to self-test questions
Further reading
Review
383
385
31.1
31.2
31.3
31.4
31.5
31.6
32
Assessing methods
385
386
387
388
389
390
390
390
391
Introduction
How to assess methods
Case study – assessing verification techniques
The current state of methods
A single development method?
Introducing new methods
Summary
Exercises
Further reading
Conclusion
392
32.1
32.2
32.3
392
392
393
Introduction
Software tools
The world of programming languages
www.it-ebooks.info
xvii
BELL_A01.QXD 2/2/05 3:20 PM Page xviii
xviii
Detailed contents
32.4
32.5
32.6
32.7
32.8
32.9
Software reuse
The real world of software engineering
Control versus skill
Future methods and tools
History
The future of software engineering
Summary
Exercises
Further reading
Appendices
A
394
395
397
398
400
400
401
402
402
405
Case studies
407
A.1
A.2
A.3
A.4
A.5
407
408
408
409
410
The ATM
The word processor
Computer game
The library
Patient monitoring system
B
Glossary
411
C
UML Summary
412
C.1
C.2
C.3
C.4
412
413
414
414
416
Use case diagrams
Class diagrams
Package diagrams
Activity diagrams
Further reading
Bibliography
Index
417
419
www.it-ebooks.info
BELL_A01.QXD 2/2/05 3:20 PM Page xix
Preface
What is software engineering?
Software engineering is about the creation of large pieces of software that consist of
thousands of lines of code and involve many person months of human effort.
One of the attractions of software engineering is that there is no one single best
method for doing it, but instead a whole variety of different approaches. Consequently
the software engineer needs a knowledge of many different techniques and tools. This
diversity is one of the delights of software engineering, and this book celebrates this by
presenting the range of current techniques and tools.
We shall see that some software engineering methods are well-defined while others
are ill-defined. And the processes of software development are always under debate.
Challenge and creativity
Software engineering is about imagination and creativity – the process of creating something apparently tangible from nothing. Software engineering methods have not yet
been completely analyzed and systematized. Thus there is still great scope for using
imagination and creativity. The exercise of skill and flair is one of the joys of software
engineering.
Who is this book for?
Ideally you, the reader, will have savored the joy of devising an elegant solution to a programming problem. You will also have experienced the intense frustration of trying to find
an elusive bug – and the satisfaction of subsequently tracking it down and eliminating it.
This book is for people who have experienced the pleasures of writing programs and
who want to see how things change in the scale up to large programs and software systems.
This book provides an introduction to software engineering for students in undergraduate programs in Computer Science, Computer Studies, Information Technology,
xix
www.it-ebooks.info
- Xem thêm -