1. Trang chủ
  2. » Công Nghệ Thông Tin

Tài liệu Growing Object-Oriented Software, Guided by Tests- P1 pptx

50 531 3

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 50
Dung lượng 690,77 KB

Nội dung

ptg From the Library of Lee Bogdanoff Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. ptg Praise for Growing Object-Oriented Software, Guided by Tests “The authors of this book have led a revolution in the craft of programming by controlling the environment in which software grows. Their Petri dish is the mock object, and their microscope is the unit test. This book can show you how these tools introduce a repeatability to your work that would be the envy of any scientist.” —Ward Cunningham “At last a book, suffused with code, that exposes the deep symbiosis between TDD and OOD. The authors, pioneers in test-driven development, have packed it with principles, practices, heuristics, and (best of all) anecdotes drawn from their decades of professional experience. Every software craftsman will want to pore over the chapters of worked examples and study the advanced testing and design principles. This one’s a keeper.” —Robert C. Martin “Design is often discussed in depth, but without empiricism. Testing is often promoted, but within the narrow definition of quality that relates only to the presence or absence of defects. Both of these perspectives are valuable, but each on its own offers little more than the sound of one hand clapping. Steve and Nat bring the two hands together in what deserves—and can best be described as—applause. With clarity, reason, and humour, their tour de force reveals a view of design, testing, code, objects, practice, and process that is compelling, practical, and overflowing with insight.” —Kevlin Henney, co-author of Pattern-Oriented Software Architecture and 97 Things Every Programmer Should Know “Steve and Nat have written a wonderful book that shares their software craftsmanship with the rest of the world. This is a book that should be studied rather than read, and those who invest sufficient time and energy into this effort will be rewarded with superior development skills.” —David Vydra, publisher, testdriven.com “This book presents a unique vision of test-driven development. It describes the mature form of an alternative strain of TDD that sprang up in London in the early 2000s, characterized by a totally end-to-end approach and a deep emphasis on the messaging aspect of objects. If you want to be an expert in the state of the art in TDD, you need to understand the ideas in this book.” —Michael Feathers “With this book you’ll learn the rhythms, nuances in thinking, and effective programming practices for growing tested, well-designed object-oriented applications from the masters.” —Rebecca Wirfs-Brock From the Library of Lee Bogdanoff Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. ptg This page intentionally left blank From the Library of Lee Bogdanoff Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. ptg Growing Object-Oriented Software, Guided by Tests From the Library of Lee Bogdanoff Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. ptg T he Addison-Wesley Signature Series provides readers with practical and authoritative information on the latest trends in modern technology for computer professionals. The series is based on one simple premise: Great books come from great authors. Books in the series are personally chosen by expert advisors, world-class authors in their own right. These experts are proud to put their signatures on the covers, and their signatures ensure that these thought leaders have worked closely with authors to define topic coverage, book scope, critical content, and overall uniqueness. The expert signatures also symbolize a promise to our readers: You are reading a future classic. Visit informit.com/awss for a complete list of available products. The Addison-Wesley Signature Series Kent Beck, Mike Cohn, and Martin Fowler, Consulting Editors From the Library of Lee Bogdanoff Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. ptg Growing Object-Oriented Software, Guided by Tests Steve Freeman and Nat Pryce Upper Saddle River, NJ • Boston • Indianapolis • San Francisco New York • Toronto • Montreal • London • Munich • Paris • Madrid Cape Town • Sydney • Tokyo • Singapore • Mexico City From the Library of Lee Bogdanoff Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. ptg 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 authors 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 omissions. 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. The publisher offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales, which may include electronic versions and/or custom covers and content particular to your business, training goals, marketing focus, and branding interests. For more information, please contact: U.S. Corporate and Government Sales (800) 382–3419 corpsales@pearsontechgroup.com For sales outside the United States please contact: International Sales international@pearson.com Visit us on the Web: informit.com/aw Library of Congress Cataloging-in-Publication Data: Freeman, Steve, 1958- Growing object-oriented software, guided by tests / Steve Freeman and Nat Pryce. p. cm. ISBN 978-0-321-50362-6 (pbk. : alk. paper) 1. Object-oriented programming (Computer science) 2. Computer software--Testing. I. Pryce, Nat. II. Title. QA76.64.F747 2010 005.1'17--dc22 2009035239 Copyright © 2010 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 permissions, write to: Pearson Education, Inc Rights and Contracts Department 501 Boylston Street, Suite 900 Boston, MA 02116 Fax (617) 671 3447 ISBN-13: 978–0–321–50362–6 ISBN-10: 0–321–50362–7 Text printed in the United States on recycled paper at RR Donnelley in Crawfordsville, Indiana. First printing October 2009 From the Library of Lee Bogdanoff Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. ptg To Paola, for all her support; to Philip, who sometimes missed out —Steve To Lamaan who put up with me spending time writing this book, and Oliver Tarek who did not —Nat From the Library of Lee Bogdanoff Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. ptg This page intentionally left blank From the Library of Lee Bogdanoff Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. ptg Contents xvForeword xviiPreface xxiAcknowledgments . xxiiiAbout the Authors 1Part I: Introduction . 3Chapter 1: What Is the Point of Test-Driven Development? . 3Software Development as a Learning Process . 4Feedback Is the Fundamental Tool 5Practices That Support Change 6Test-Driven Development in a Nutshell . 7The Bigger Picture . 8Testing End-to-End 9Levels of Testing 10External and Internal Quality 13Chapter 2: Test-Driven Development with Objects 13A Web of Objects 13Values and Objects 14Follow the Messages 17Tell, Don’t Ask 17But Sometimes Ask 18Unit-Testing the Collaborating Objects . 19Support for TDD with Mock Objects ix From the Library of Lee Bogdanoff Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. [...]... diversity of dialects has given me a new source of ideas to further refine my own development Growing Object-Oriented Software, Guided by Tests, presents a coherent, consistent system of development, where different techniques support each other I invite you to read Growing Object-Oriented Software, Guided by Tests, to follow along with the examples, to learn how the authors think about programming... Bogdanoff this watermark Foreword Kent Beck One of the dilemmas posed by the move to shorter and shorter release cycles is how to release more software in less time—and continue releasing indefinitely A new perspective is necessary to resolve this dilemma More than a shift in techniques is needed Growing Object-Oriented Software, Guided by Tests presents such a new perspective What if software wasn’t “made,”... seen teams that can do the raw practices (writing and running tests) but struggle with the result because they haven’t also adopted the deeper processes that lie behind it Why Growing Object-Oriented Software? We used the term growing because it gives a sense of how we develop incrementally We have something working at all times, making sure that the code is always as well-structured as possible and... to understand The programmer makes sure that the system is still working after each refactoring step, minimizing the risk of getting stranded by a change; in test-driven code, we can do that by running the tests Refactoring is a “microtechnique” that is driven by finding small-scale improvements Our experience is that, applied rigorously and consistently, its many small steps can lead to significant structural... the system end-to-end without directly calling its internal code An end-to-end test interacts with the system only from the outside: through its user interface, by sending messages as if from third-party systems, by invoking its web services, by parsing reports, and so on As we discuss in Chapter 10, the whole behavior of the system includes its interaction with its external environment This is often... effective at delivering systems that work As John Gall wrote in [Gall03], “A complex system that works is invariably found to have evolved from a simple system that works.” Growing also hints at the biological quality we see in good software, the sense of coherence at every level of structure It ties into our approach to object xvii Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark... remove this watermark From the Library of Lee Bogdanoff xviii Preface orientation which follows Alan Kay’s1 concept of objects being similar to biological cells that send each other messages Why Guided by Tests? We write tests first because we find that it helps us write better code Writing a test first forces us to clarify our intentions, and we don’t start the next piece of work until we have an unambiguous... fits into the TDD process and how it makes sense in the context of object-oriented development Who Is This Book For? We wrote this book for the “informed reader.” It’s intended for developers with professional experience who probably have at least looked at test-driven 1 Alan Kay was one of the authors of Smalltalk and coined the term object-oriented. ” 2 Mock objects are substitute implementations for... least to understand the examples That said, the book is really about a set of techniques that are applicable to any object-oriented environment If you’re not using Java, there are equivalents of testing and mocking libraries we use (JUnit and jMock) in many other languages, including C#, Ruby, Python, Smalltalk, Objective-C, and (impressively) C++ There are even versions for more distant languages such... During that time, we have used TDD in a wide range of projects: large message-oriented enterprise-integration systems with an interactive web front-end backed by multiprocessor compute grids; tiny embedded systems that must run in tens of kilobytes of memory; free games used as advertising for business-critical systems; and back-end middleware and network services to highly interactive graphical desktop . ptg Praise for Growing Object-Oriented Software, Guided by Tests “The authors of this book have led a revolution in the craft of programming by controlling. Steve, 1958- Growing object-oriented software, guided by tests / Steve Freeman and Nat Pryce. p. cm. ISBN 978-0-321-50362-6 (pbk. : alk. paper) 1. Object-oriented

Ngày đăng: 14/12/2013, 21:15

TỪ KHÓA LIÊN QUAN

w