Johannes Link
With Contributions by Peter Fr hlich
MORGAN KAUFMANN PUBLISHERS AN IMPRINT OF ELSEVIER SCIENCE
AMSTERDAM BOSTON LONDON NEW YORK OXFORD PARIS SAN DIEGO SAN FRANCISCO SINGAPORE SYDNEY TOKYO
Senior Editor
Tim Cox
Publishing Services Manager
Edward Wade
Editorial Coordinator
Stacie Pierce, Richard Camp
English translation
Angelika Shafir
Project Management
Matrix Productions, Inc.
Cover Design
Frances Baca
Cover Image
Photodisc Collection/Getty Images
Text Design
Rebecca Evans
Composition
Nancy Logan
Illustration
Dartmouth Publishing, Inc.
Copy Editor
Yoni Overton
Proofreader
Dan Young
Indexer
Edwin Durbin
Interior printer
The Maple-Vail Book Manufacturing Group
Cover printer
Phoenix Color Corporation
Designations used by companies to distinguish their products are often claimed as trademarks or registered trademarks. In all instances in which Morgan Kaufmann Publishers is aware of a claim, the product names appear in initial capital or all capital letters. Readers, however, should contact the appropriate companies for more complete information regarding trademarks and registration.
Morgan Kaufmann Publishers
An Imprint of Elsevier Science
340 Pine Street, Sixth Floor
San Francisco, CA 94104-3205
www.mkp.com
Copyright 2002 by dpunkt.verlag GmbH, Heidelberg, Germany.
Title of German original: Unit Tests Mit Java
English translation 2003 by Elsevier Science (USA)
All rights reserved.
Printed in the United States of America
07 06 05 04 03 5 4 3 2 1
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, or otherwise—without the prior written permission of the publisher.
Library of Congress Cataloging-in-Publication Data
Link, Johannes. Unit testing in Java : how tests drive the code / by Johannes Link ; with contribu- tions by Peter Fr hlich. p. cm. Includes bibliographical references and index.ISBN 1-55860-868-0
1. Computer software—Testing. 2. Java (Computer program language) I. Fr hlich, Peter. II. Title.
QA76.76.T48L55 2003
005.1'4—dc21
Morgan Kaufmann ISBN: 1-55860-868-0
dPunkt ISBN: 3-89864-150-3
This book is printed on acid-free paper.
Johannes Link has been project manager and software developer for four years 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 an M.S. 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.