E-Book, Englisch, 376 Seiten
Link Unit Testing in Java
1. Auflage 2003
ISBN: 978-0-08-052017-9
Verlag: Elsevier Science & Techn.
Format: EPUB
Kopierschutz: 6 - ePub Watermark
How Tests Drive the Code
E-Book, Englisch, 376 Seiten
ISBN: 978-0-08-052017-9
Verlag: Elsevier Science & Techn.
Format: EPUB
Kopierschutz: 6 - ePub Watermark
Software testing is indispensable and is one of the most discussed topics in software development today. Many companies address this issue by assigning a dedicated software testing phase towards the end of their development cycle. However, quality cannot be tested into a buggy application. Early and continuous unit testing has been shown to be crucial for high quality software and low defect rates. Yet current books on testing ignore the developer's point of view and give little guidance on how to bring the overwhelming amount of testing theory into practice. Unit Testing in Java represents a practical introduction to unit testing for software developers. It introduces the basic test-first approach and then discusses a large number of special issues and problem cases. The book instructs developers through each step and motivates them to explore further.
*Shows how the discovery and avoidance of software errors is a demanding and creative activity in its own right and can build confidence early in a project.
*Demonstrates how automated tests can detect the unwanted effects of small changes in code within the entire system.
*Discusses how testing works with persistency, concurrency, distribution, and web applications.
*Includes a discussion of testing with C++ and Smalltalk.
Autoren/Hrsg.
Weitere Infos & Material
1;Front Cover;1
2;Unit Testing in Java: How Tests Drive the Code;4
3;Copyright Page;5
4;Contents;10
5;Foreword;6
6;Foreward;8
7;Preface;18
8;Part l: Basic Techniques;20
8.1;Chapter 1. Introduction;22
8.1.1;1.1 Important Terms;24
8.1.2;1.2 XP Testing;25
8.1.3;1.3 Classic Testing;30
8.1.4;1.4 Test-First Development–A Brief Definition;35
8.1.5;1.5 Java Only-Or Other Coffee?;37
8.1.6;1.6 Objectives of This Book;37
8.1.7;1.7 Organization of This Book;38
8.1.8;1.8 Conventions in This Book;39
8.1.9;1.9 Web Site to This Book;40
8.2;Chapter 2. Automating Unit Tests;42
8.2.1;2.1 What Do We Want to Automate?;43
8.2.2;2.2 Requirements for an Automation Framework;44
8.2.3;2.3 JUnit;46
8.2.4;2.4 Summary;56
8.3;Chapter 3. Basic Steps of the Test-First Approach;58
8.3.1;3.1 Step by Step;58
8.3.2;3.2 Dependencies;67
8.3.3;3.3 Organizing and Running Tests;76
8.3.4;3.4 Summary;82
8.4;Chapter 4. Test Ideas and Heuristics;84
8.4.1;4.l Reworking Single Tests;85
8.4.2;4.2 Black and White Boxes;89
8.4.3;4.3 Testing the Typical Functionality;90
8.4.4;4.4 Threshold Values and Equivalence Classes;92
8.4.5;4.5 Error Cases and Exceptions;94
8.4.6;4.6 Object Interactions;100
8.4.7;4.7 Design by Contract;103
8.4.8;4.8 More Ideas to Find Test Cases;105
8.4.9;4.9 Refactoring Code and Tests;106
8.4.10;4.10 Summary;109
8.5;Chapter 5. The Inner Life of a Test Framework;110
8.5.1;5.1 Statics;110
8.5.2;5.2 The Life Cycle of a Test Suite;112
8.5.3;5.3 Project-Specific Expansions;114
8.5.4;5.4 Summary;115
8.6;Chapter 6. Dummy and Mock Objects for Independence;116
8.6.1;6.1 Little Dummies;116
8.6.2;6.2 Weltering in Technical Terms;119
8.6.3;6.3 Big Dummies;119
8.6.4;6.4 Extending Our Mansion;126
8.6.5;6.5 Endoscopic Testing;127
8.6.6;6.6 Mock Objects from the Assembly Line;132
8.6.7;6.7 Testing Threshold Values and Exceptions;135
8.6.8;6.8 How Does the Test Get to the Mock?;138
8.6.9;6.9 Evil Singletons;141
8.6.10;6.10 Lightweight and Heavyweight Mocks;143
8.6.11;6.11 File Dummies;148
8.6.12;6.12 More Typical Mock Objects;152
8.6.13;6.13 External Components;153
8.6.14;6.14 The Pros and Cons;156
8.6.15;6.15 Summary;160
8.7;Chapter 7. Inheritance and Polymorphism ;162
8.7.1;7.1 Inheritance;162
8.7.2;7.2 Polymorphism;174
8.7.3;7.3 Summary;179
8.8;Chapter 8. How Much Is Enough?;180
8.8.1;8.1 The XP Rule;181
8.8.2;8.2 Clear Answers to Clear Questions;182
8.8.3;8.3 Test Coverage;186
8.8.4;8.4 Summary;189
9;Part II: Advanced Topics;190
9.1;Chapter 9. Persistent Objects;192
9.1.1;9.1 Abstract Persistence Interface;194
9.1.2;9.2 Persistent Dummy;197
9.1.3;9.3 Designing a Database Interface;200
9.1.4;9.4 Testing the"Right" Persistence;206
9.1.5;9.5 Interaction between Persistence Layer and Client;215
9.1.6;9.6 Summary ;217
9.2;Chapter 10. Concurrent Programs;220
9.2.1;10.1 Problems Using Threads;221
9.2.2;10.2 Testing Asynchronous Services;223
9.2.3;10.3 Testing for Synchronization;231
9.2.4;10.4 Summary;241
9.3;Chapter 11. Distributed Applications;244
9.3.1;11.1 RMI;246
9.3.2;11.2 Enterprise JavaBeans;255
9.3.3;11.3 Summary;259
9.4;Chapter 12. Web Applications;260
9.4.1;12.1 Functional Tests;261
9.4.2;12.2 Testing on the Server;266
9.4.3;12.3 Testing with Dummies;269
9.4.4;12.4 Separating the Servlet API from the Servlet Logic;275
9.4.5;12.5 Testing the HTML Generation;278
9.4.6;12.6 Summary;280
9.5;Chapter 13. Graphical User Interfaces;282
9.5.1;13.1 The Direct Way;282
9.5.2;13.2 Short Detours;305
9.5.3;13.3 Summary;309
9.6;Chapter 14. The Role of Unit Tests in the Software Process;310
9.6.1;14.1 Activities in the Defined Software Process;311
9.6.2;14.2 Process Types and Testing Strategies;318
9.6.3;14.3 Costs and Benefits of Automated Unit Tests;324
9.6.4;14.4 Commercial Process Models;326
9.6.5;14.5 Will Automated Unit Tests Fit in My Process?;331
9.7;Chapter 15. Loose Ends and Opportunities;332
9.7.1;15.1 Unit Testing for Existing Software;333
9.7.2;15.2 Introducing Unit Tests to the Development Team;336
9.7.3;15.3 What's Missing? ;339
10;Part III: Appendices;342
10.1;Appendix A. Notes to JUnit;344
10.1.1;A.1 Frequently Asked Questions (FAQs);344
10.1.2;A.2 JUnit Expansions;348
10.2;Appendix B. Unit Tests with Other Programming Languages;354
10.2.1;B.1 Smalltalk;354
10.2.2;B.2 C++;357
10.2.3;B.3 The Rest;362
11;Glossary;364
12;Bibliography and List of References;372
12.1;Bibliography;372
12.2;URLs;378
12.3;Further Reading;381
13;Index;384