Table of Contents


unit testing in java: how tests drive the code
Unit Testing in Java: How Tests Drive the Code
by Johannes Link and Peter Frohlich  ISBN:1558608680
Morgan Kaufmann Publishers © 2003 (325 pages)

This is a practical introduction to using automated unit tests and the test-first approach in your day-to-day software development. The author gives clear guidance on how to make tests work for you, and shows how test-driven development works in practice.

Table of Contents
Unit Testing in Java—How Tests Drive the Code
Foreword
Foreword
Preface
Part I - Basic Techniques
Chapter 1 - Introduction
Chapter 2 - Automating Unit Tests
Chapter 3 - Basic Steps of the Test-First Approach
Chapter 4 - Test Ideas and Heuristics
Chapter 5 - The Inner Life of a Test Framework
Chapter 6 - Dummy and Mock Objects for Independence
Chapter 7 - Inheritance and Polymorphism
Chapter 8 - How Much is Enough?
Part II - Advanced Topics
Chapter 9 - Persistent Objects
Chapter 10 - Concurrent Programs
Chapter 11 - Distributed Applications
Chapter 12 - Web Applications
Chapter 13 - Graphical User Interfaces
Chapter 14 - The Role of Unit Tests in the Software Process
Chapter 15 - Loose Ends and Opportunities
Part III - Appendices
Appendix A - Notes to JUnit
Appendix B - Unit Tests with Other Programming Languages
Glossary
Bibliography and List of References
Index
List of Figures
List of Tables


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.

About the Authors

For 4 years Johannes Link has been project manager and software developer at andrena objects ag in Karlsruhe, Germany. He came to andrena after years of practical software engineering research at the German Cancer Research Center and the German ABB Corporate Research Center. Johannes is responsible for andrena's internal and external training activities and has published articles on software testing and software development. He holds a diploma degree in medical computer science from Heidelberg University.

Peter Fröhlich holds a MSc in computer science from the University of Aachen and a Ph.D. in electrical engineering from the University of Hannover. From 1998 to 2002, he worked for ABB Corporate Research as a developer, process improvement consultant, project manager, and manager of a research group. Since 2002 he has worked for Robert Bosch GmbH as a software architect. His research interests include process improvement, conceptual modeling, software architecture, and testing.