logo资料库

Developer.Testing.Building.Quality.into.Software.pdf

第1页 / 共342页
第2页 / 共342页
第3页 / 共342页
第4页 / 共342页
第5页 / 共342页
第6页 / 共342页
第7页 / 共342页
第8页 / 共342页
资料共342页,剩余部分请下载后查看
Cover
Title Page
Copyright Page
第 iv 页
Contents
Foreword by Jeff Langr
Foreword by Lisa Crispin
Preface
Acknowledgments
About the Author
Chapter 1 Developer Testing
Developers Test
Developer Testing Activities
What Developers Usually Don’t Do
Defining Developer Testing
Developer Testing and the Development Process
Summary
Chapter 2 Testing Objectives, Styles, and Roles
Testing and Checking
Testing Objectives
Testing Styles
Your Quality Assurance and Developer Testing
Summary
Chapter 3 The Testing Vocabulary
Errors, Defects, Failures
White Box and Black Box Testing
Classifying Tests
The Agile Testing Quadrants
Some Other Types of Testing
Summary
Chapter 4 Testability from a Developer’s Perspective
Testable Software
Benefits of Testability
Testability Defined
Summary
Chapter 5 Programming by Contract
Contracts Formalize Constraints
Implementing Programming by Contract
Enforcing Contracts
Summary
Chapter 6 Drivers of Testability
Direct Input and Output
Indirect Input and Output
State
Temporal Coupling
Data Types and Testability
Domain-to-Range Ratio
Summary
Chapter 7 Unit Testing
Why Do It?
What Is a Unit Test?
The Life Cycle of a Unit Testing Framework
Naming Tests
Structuring Tests
Assertion Methods
Testing Exceptions
Behavior-driven Development–Style Frameworks
Summary
Chapter 8 Specification-based Testing Techniques
Equivalence Partitioning
Boundary Value Analysis
Edge Cases and Gotchas for Some Data Types
State Transition Testing
Decision Tables
Summary
Chapter 9 Dependencies
Relations between Objects
System Resource Dependencies
Dependencies between Layers
Dependencies across Tiers
Summary
Chapter 10 Data-driven and Combinatorial Testing
Parameterized Tests
Theories
Generative Testing
Combinatorial Testing
Summary
Chapter 11 Almost Unit Tests
Examples
Impact
Summary
Chapter 12 Test Doubles
Stubs
Fakes
Mock Objects
Spies
Dummies
Verify State or Behavior?
Summary
Chapter 13 Mocking Frameworks
Constructing Test Doubles
Setting Expectations
Verifying Interactions
Misuse, Overuse, and Other Pitfalls
Summary
Chapter 14 Test-driven Development—Classic Style
Test-driving a Simple Search Engine
Order of Tests
Red- to Green-bar Strategies
Challenges
Test First or Test Last?
Summary
Chapter 15 Test-driven Development—Mockist Style
A Different Approach
Double-loop TDD
Summary
Chapter 16 Duplication
Why Duplication Is Bad
Taking Advantage of Duplication
Mechanical Duplication
Knowledge Duplication
Summary
Chapter 17 Working with Test Code
Commenting Tests
Deleting Tests
Summary
Chapter 18 Beyond Unit Testing
Tests that Aren’t Unit Tests
Characteristics of Tests that Aren’t Unit Tests
Pointers and Practices
Deciding on a Developer Testing Strategy
Summary
Chapter 19 Test Ideas and Heuristics
High-level Considerations
Low-level Considerations
Summary
Appendix A: Tools and Libraries
Appendix B: Source Code
Test Doubles
Data-driven and Combinatorial Testing
Test-driven Development
Beyond Unit Testing
Bibliography
Index
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Z
ptg18145136
Developer TesTing
This page intentionally left blank ptg18145136
Developer TesTing Building Quality into Software alexander tarlinder Boston • Columbus • Indianapolis • New York • San Francisco • Amsterdam • Cape Town Dubai • London • Madrid • Milan • Munich • Paris • Montreal • Toronto • Delhi • Mexico City São Paulo • Sydney • Hong Kong • Seoul • Singapore • Taipei • Tokyo ptg18145136
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals. The author and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omis- sions. No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein. For information about buying this title in bulk quantities, or for special sales opportunities (which may include electronic versions; custom cover designs; and content particular to your business, training goals, marketing focus, or branding interests), please contact our corporate sales department at corpsales@pearsoned.com or (800) 382-3419. For government sales inquiries, please contact governmentsales@pearsoned.com. For questions about sales outside the U.S., please contact intlcs@pearson.com. Visit us on the Web: informit.com/aw Library of Congress Control Number: 2016944434 Copyright © 2017 Pearson Education, Inc. All rights reserved. Printed in the United States of America. This publication is protected by copyright, and permission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding per- missions, request forms and the appropriate contacts within the Pearson Education Global Rights & Permissions Department, please visit www.pearsoned.com/permissions/. ISBN-13: 978-0-13-429106-2 ISBN-10: 0-13-429106-9 Text printed in the United States on recycled paper at RR Donnelley in Crawfordsville, Indiana. 1 16 ptg18145136
To my grandfather Romuald, who taught me about books. ptg18145136
This page intentionally left blank ptg18145136
Contents Foreword by Jeff Langr Foreword by Lisa Crispin Preface Acknowledgments About the Author Chapter 1 Developer Testing Developers Test Developer Testing Activities What Developers Usually Don’t Do Defining Developer Testing Developer Testing and the Development Process Summary Chapter 2 Testing Objectives, Styles, and Roles Testing and Checking Testing Objectives Testing Styles Your Quality Assurance and Developer Testing Summary Chapter 3 The Testing Vocabulary Errors, Defects, Failures White Box and Black Box Testing Classifying Tests The Agile Testing Quadrants Some Other Types of Testing Summary xiii xv xvii xxiii xxv 1 1 2 5 6 7 8 9 9 10 11 18 19 21 22 22 23 32 33 36 vii ptg18145136
分享到:
收藏