Growing Object-Oriented Software, Guided by Tests - Steve Freeman, Nat Pryce

Growing Object-Oriented Software, Guided by Tests

Steve Freeman, Nat Pryce

出版时间

2009-10-22

ISBN

9780321503626

评分

★★★★★
书籍介绍
Foreword by Kent Beck "The authors of this book have led a revolution in the craft of programming by controlling the environment in which software grows." --Ward Cunningham "At last, a book suffused with code that exposes the deep symbiosis between TDD and OOD. This one's a keeper." --Robert C. Martin "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 Test-Driven Development (TDD) is now an established technique for delivering better software faster. TDD is based on a simple idea: Write tests for your code before you write the code itself. However, this "simple" idea takes skill and judgment to do well. Now there's a practical guide to TDD that takes you beyond the basic concepts. Drawing on a decade of experience building real-world systems, two TDD pioneers show how to let tests guide your development and "grow" software that is coherent, reliable, and maintainable. Steve Freeman and Nat Pryce describe the processes they use, the design principles they strive to achieve, and some of the tools that help them get the job done. Through an extended worked example, you'll learn how TDD works at multiple levels, using tests to drive the features and the object-oriented structure of the code, and using Mock Objects to discover and then describe relationships between objects. Along the way, the book systematically addresses challenges that development teams encounter with TDD--from integrating TDD into your processes to testing your most difficult features. Coverage includes * Implementing TDD effectively: getting started, and maintaining your momentum throughout the project * Creating cleaner, more expressive, more sustainable code * Using tests to stay relentlessly focused on sustaining quality * Understanding how TDD, Mock Objects, and Object-Oriented Design come together in the context of a real software development project * Using Mock Objects to guide object-oriented designs * Succeeding where TDD is difficult: managing complex test data, and testing persistence and concurrency
AI导读
核心看点
  • 深入解析TDD与面向对象设计的共生关系
  • 提供从测试驱动到渐进式开发的实战指南
  • 强调通过测试反馈来塑造清晰的对象边界
适合谁读
  • 希望精通TDD并提升代码质量的开发者
  • 具备基础OO素养的软件工程师
  • 对迭代式开发和重构感兴趣的程序员
读前提醒
  • 书中示例较复杂,建议耐心跟随代码实践
  • 部分技术栈如Swing已显过时,重在学思想
  • 需结合SOLID原则理解测试对设计的引导
读者共识
  • TDD领域的经典之作,思想深刻且实用
  • 不仅是测试指南,更是OO设计思维的升华
  • 虽推进缓慢且无源码,但值得反复研读

本导读基于书籍简介、目录、原文摘录、短评和书评生成,不等同于全文精读。

精彩摘录
  • "我们发现,让对象容易测试的那些品质,也让代码更容易响应变化。 单例是依赖关系。 面向对象作为一种组织代码的技术,它的一个目标就是让对象的边界清晰可见。 如果单元测试工具让程序员绕过了设计中糟糕的依赖关系管理,那就丧失了宝贵的反馈关系。"
  • "依赖关系:对象向它的同级请求服务,这样对象就能实现它的职责。没有这些服务,对象就不能工作。 通知关系:同级对象需要及时了解对象的活动。 调整关系:同级对象会调整该对象的行为,以适应系统更多的需求。 我们坚持依赖关系要在构造方法中传入,但通知关系和调整关系可以设为默认值,以后再做调整。"
  • "当把一些对象组合成一个新类型时,我们希望新的类型所表现出来的行为比所有组成部分的行为之和更简单。 组合对象的 API 不应该比它的组件的 API 更复杂。"
用户评论
TDD深入讲解,挺不错的
TDD很有影响力的一本大部头
好吧。终于看完了。方法是好的,原则是对的,大家不照着做,那不还是白搭!!
后边就直接读中文版了
不仅仅是TDD,对于语言,对于重构,和OO编程都是本非常好的书
几年前看过,TDD 和迭代式开发的入门视作。虽然书里用的是 java 做例子, 但是 TDD 这种思维模式能够应用到所有语言
可以快速的看一遍
收藏