售价: ¥609.00 待定配送费
亚马逊的其他卖家
加入购物车
¥609.00
此商品可以享受免费配送 详情
卖家: 亚马逊
前翻 后翻
正在播放... 已暂停   您正在聆听的 Audible 音频版本的样品。
了解更多信息
查看全部 3 张图片

Growing Object-Oriented Software, Guided by Tests (英语) 平装 – 2009年10月22日

平均4.5 星
5 星
25
4 星
15
3 星
3
2 星
1
1 星
0
平均4.5 星 44条亚马逊美国的评论 us-flag |
| 天天低价·正品质优
|
分享
广告

显示所有 格式和版本 隐藏其他格式和版本
亚马逊价格
全新品最低价 非全新品最低价
平装
"请重试"
¥609.00
¥609.00
促销信息: 优惠 买满 ¥99.00 立减 ¥10.00 共1个促销

全新品2 售价从 ¥609.00

click to open popover

商品促销和特殊优惠
  • 买满 ¥99.00 立减 ¥10.00: 满足条件自动优惠

无需Kindle设备,下载免费Kindle阅读软件,即可在您的手机、电脑及平板电脑上畅享阅读。

  • iPhone/iPad/Mac
  • Android手机或平板电脑

请输入您的手机号码,获取Kindle阅读软件的下载链接。



基本信息

  • 出版社: Addison-Wesley Professional; 1 (2009年10月22日)
  • 丛书名: Addison-Wesley Signature Series (Beck)
  • 平装: 384页
  • 语种: 英语
  • ISBN: 0321503627
  • 条形码: 9780321503626
  • 商品尺寸: 17.8 x 2.3 x 23.1 cm
  • 商品重量: 621 g
  • 品牌: Pearson
  • ASIN: 0321503627
  • 用户评分: 分享我的评价
  • 亚马逊热销商品排名: 图书商品里排第1,396,831名 (查看图书商品销售排行榜)
  •  您想告诉我们您发现了更低的价格?

商品描述

作者简介

Steve Freeman is an independent consultant specializing in Agile software development. A founder member of the London Extreme Tuesday Club, he was chair of the first XPDay and is a frequent organizer and presenter at international conferences. Steve has worked in a variety of organizations, from writing shrink-wrap software for IBM, to prototyping for major research laboratories. Steve has a Ph.D. from Cambridge University, and degrees in statistics and music. Steve is based in London, UK.

 

Nat Pryce has worked as a programmer, architect, trainer, and consultant in a variety of industries, including sports reportage, marketing communications, retail, telecoms, and finance. With a Ph.D. from Imperial College London, he has also worked on research projects and does occasional university teaching. An early adopter of Extreme Programming, he has written or contributed to several open source libraries that support Test Driven Development. He was one of the founding organizers of the London XPDay and regularly presents at international conferences. Nat is based in London, UK.

 

Freeman and Pryce were joint winners of the 2006 Agile Alliance Gordon Pask award.

 

目录

Foreword     xv

Preface     xvii

Acknowledgments     xxi

About the Authors     xxiii

 

PART I: INTRODUCTION     1

 

Chapter 1: What Is the Point of Test-Driven Development?     3

Software Development as a Learning Process     3

Feedback Is the Fundamental Tool     4

Practices That Support Change     5

Test-Driven Development in a Nutshell     6

The Bigger Picture     7

Testing End-to-End     8

Levels of Testing     9

External and Internal Quality     10

 

Chapter 2: Test-Driven Development with Objects     13

A Web of Objects     13

Values and Objects     13

Follow the Messages     14

Tell, Don’t Ask     17

But Sometimes Ask     17

Unit-Testing the Collaborating Objects     18

Support for TDD with Mock     19

 

Chapter 3: An Introduction to the Tools     21

Stop Me If You’ve Heard This One Before     21

A Minimal Introduction to JUnit 4     21

Hamcrest Matchers and assertThat()     24

jMock2: Mock Objects     25

 

PART II: THE PROCESS OF TEST-DRIVEN DEVELOPMENT     29

 

Chapter 4: Kick-Starting the Test-Driven Cycle     31

Introduction     31

First, Test a Walking Skeleton     32

Deciding the Shape of the Walking Skeleton     33

Build Sources of Feedback     35

Expose Uncertainty Early     36

 

Chapter 5: Maintaining the Test-Driven Cycle     39

Introduction     39

Start Each Feature with an Acceptance Test     39

Separate Tests That Measure Progress from Those That Catch Regressions     40

Start Testing with the Simplest Success Case     41

Write the Test That You’d Want to Read     42

Watch the Test Fail     42

Develop from the Inputs to the Outputs     43

Unit-Test Behavior, Not Methods     43

Listen to the Tests     44

Tuning the Cycle     45

 

Chapter 6: Object-Oriented Style     47

Introduction     47

Designing for Maintainability     47

Internals vs. Peers     50

No And’s, Or’s, or But’s     51

Object Peer Stereotypes     52

Composite Simpler Than the Sum of Its Parts     53

Context Independence     54

Hiding the Right Information     55

An Opinionated View     56

 

Chapter 7: Achieving Object-Oriented Design     57

How Writing a Test First Helps the Design     57

Communication over Classification     58

Value Types     59

Where Do Objects Come From?     60

Identify Relationships with Interfaces     63

Refactor Interfaces Too     63

Compose Objects to Describe System Behavior     64

Building Up to Higher-Level Programming     65

And What about Classes?     67

 

Chapter 8: Building on Third-Party Code     69

Introduction     69

Only Mock Types That You Own     69

Mock Application Objects in Integration Tests     71

 

PART III: A WORKED EXAMPLE     73

 

Chapter 9: Commissioning an Auction Sniper     75

To Begin at the Beginning     75

Communicating with an Auction     78

Getting There Safely     79

This Isn’t Real     81

 

Chapter 10: The Walking Skeleton     83

Get the Skeleton out of the Closet     83

Our Very First Test     84

Some Initial Choices     86

 

Chapter 11: Passing the First Test     89

Building the Test Rig     89

Failing and Passing the Test     95

The Necessary Minimum     102

 

Chapter 12: Getting Ready to Bid     105

An Introduction to the Market     105

A Test for Bidding     106

The AuctionMessageTranslator     112

Unpacking a Price Message     118

Finish the Job     121

 

Chapter 13: The Sniper Makes a Bid     123

Introducing AuctionSniper     123

Sending a Bid     126

Tidying Up the Implementation     131

Defer Decisions     136

Emergent Design     137

 

Chapter 14: The Sniper Wins the Auction     139

First, a Failing Test     139

Who Knows about Bidders?     140

The Sniper Has More to Say     143

The Sniper Acquires Some State     144

The Sniper Wins     146

Making Steady Progress     148

 

Chapter 15: Towards a Real User Interface     149

A More Realistic Implementation     149

Displaying Price Details     152

Simplifying Sniper Events     159

Follow Through     164

Final Polish     168

Observations     171

 

Chapter 16: Sniping for Multiple Items     175

Testing for Multiple Items     175

Adding Items through the User Interface     183

Observations     189

 

Chapter 17: Teasing Apart Main     191

Finding a Role     191

Extracting the Chat     192

Extracting the Connection     195

Extracting the SnipersTableModel     197

Observations     201

 

Chapter 18: Filling In the Details     205

A More Useful Application     205

Stop When We’ve Had Enough     205

Observations     212

 

Chapter 19: Handling Failure     215

What If It Doesn’t Work?     215

Detecting the Failure     217

Displaying the Failure     218

Disconnecting the Sniper     219

Recording the Failure     221

Observations     225

 

PART IV: SUSTAINABLE TEST-DRIVEN DEVELOPMENT     227

 

Chapter 20: Listening to the Tests     229

Introduction     229

I Need to Mock an Object I Can’t Replace (without Magic)     230

Logging Is a Feature     233

Mocking Concrete Classes     235

Don’t Mock Values     237

Bloated Constructor     238

Confused Object     240

Too Many Dependencies     241

Too Many Expectations     242

What the Tests Will Tell Us (If We’re Listening)     244

 

Chapter 21: Test Readability     247

Introduction     247

Test Names Describe Features     248

Canonical Test Structure     251

Streamline the Test Code     252

Assertions and Expectations     254

Literals and Variables     255

 

Chapter 22: Constructing Complex Test Data     257

Introduction     257

Test Data Builders     258

Creating Similar Objects     259

Combining Builders     261

Emphasizing the Domain Model with Factory Methods     261

Removing Duplication at the Point of Use     262

Communication First     264

 

Chapter 23: Test Diagnostics     267

Design to Fail     267

Small, Focused, Well-Named Tests     268

Explanatory Assertion Messages     268

Highlight Detail with Matchers     268

Self-Describing Value     269

Obviously Canned Value     270

Tracer Object     270

Explicitly Assert That Expectations Were Satisfied     271

Diagnostics Are a First-Class Feature     271

 

Chapter 24: Test Flexibility     273

Introduction     273

Test for Information, Not Representation     274

Precise Assertions     275

Precise Expectations     277

“Guinea Pig” Objects     284

 

PART V: ADVANCED TOPICS     287

 

Chapter 25: Testing Persistence     289

Introduction     289

Isolate Tests That Affect Persistent State     290

Make Tests Transaction Boundaries Explicit     292

Testing an Object That Performs Persistence Operations     294

Testing That Objects Can Be Persisted     297

But Database Tests Are S-l-o-w!     300

 

Chapter 26: Unit Testing and Threads     301

Introduction     301

Separating Functionality and Concurrency Policy     302

Unit-Testing Synchronization     306

Stress-Testing Passive Objects     311

Synchronizing the Test Thread with Background Threads     312

The Limitations of Unit Stress Tests     313

 

Chapter 27: Testing Asynchronous Code     315

Introduction     315

Sampling or Listening     316

Two Implementations     318

Runaway Tests     322

Lost Updates     323

Testing That an Action Has No Effect     325

Distinguish Synchronizations and Assertions     326

Externalize Event Sources     326

 

Afterword: A Brief History of Mock Objects     329

Appendix A: jMock2 Cheat Sheet     335

Appendix B: Writing a Hamcrest Matcher     343

Bibliography     347

Index     349

 

商品评论

在亚马逊中国上尚未有买家评论。
5 星
4 星
3 星
2 星
1 星

此商品在美国亚马逊上最有用的商品评论 (beta)

美国亚马逊: 平均4.5 星 44 条评论
4/4 人认为此评论有用
平均5.0 星 test your program, not your api 2013年2月23日
评论者 Jeff Davis - 已在美国亚马逊上发表
版本: 平装 已确认购买
I spent the first part of my career doing computational work, primarily in FORTRAN and C, before jumping into traditional "application development" about 18 months ago. My academic work consisted of applied math and statistical work; I knew precious little of being a quality "engineer" beyond proper syntax then. This book was a game changer for me.

What I discovered was that I was thinking about tests the wrong way. In my current shop, I often got frustrated at what was, I was thrilled to discover, a completely pointless test that felt like coding pablum to make the CI server happy with "test coverage". Genuine testing is much, much more. A dev that genuinely embraces TDD, and doesn't use it as a mere add on on his/her resume, won't be doing "Test Driven Development" but really "Test Driven Design". Some of the important higher level concepts this includes are:

1.) Listening to tests to create a more supple architecture.
2.) How to avoid "gold plating" features ( a big one for me )
3.) Using tests to describe the action of the object.
4.) Using syntactic sugar to make your exposed API far more readable to a future reader
5.) Spectacularly compact APIs
6.) If you've done XP, "ping pong" development is a real pleasure ( one writes the test, the other is forced to implement the feature to make the test pass, then they switch roles ).
7.) Focusing on the "message" an object passes to its peers or its delegators, which puts OOP in an entirely new light to me.

The standard "implementation tools" are also covered in depth to give you the ability to do the things listed above. Can't recommend it strongly enough.
48/50 人认为此评论有用
平均5.0 星 Excellent TDD book for actual practitioners 2010年1月14日
评论者 Bas Vodde - 已在美国亚马逊上发表
版本: 平装 已确认购买
This book has been in my Amazon pre-ordered list for quite a while and I was looking forward to this. I found the title alone already excellent. Steven and Nat (authors of jMock) are well known expert TDD practitioners, so I was looking forward to what they had to say. The book was better than I had expected.

The book consists of 5 parts. The first part of a very quick introduction to TDD and jMock. The second part discusses the tdd cycle in more detail. The third part (150 pages) is a very large example of growing a piece of software. The fourth part discusses topics on how to sustain TDD and the last part covers some advanced topics.

In this review, I'll skip part 1 as it was short and nothing special. Part two covers the TDD cycle and the link to evolutionary design. Steve and Nat have a design style that focuses almost purely on the interactions between classes which are most frequently tested using expectations on mock objects (which, as authors of jMock, they have lots of experience with). Most notable from part 2, for me, were the classifications of objects that they used, the strong focus on interaction and mocking (more than I usually have when test-driving) and their lack of focus on classes but focus on roles and responsibilities. Nat and Steve clarify their thinking exceptionally well which makes it all easy to understand.

Part 3 takes the largest part of the book, which is where they test-drive an AuctionSniper application. It is a small application, but large for a book example. The authors show how they gradually build up the application by adding one test at the time and how they gained insights during this process which made them adjust their design. I had mixed feelings about this part as a book didn't seem like the best medium for doing this, but still I appreciate the insights they had and also their attempt to make it as close to "real world" as possible.

Writing tests is one thing, maintaining them in another. Part 4 discusses how to make the tests maintainable and the tdd cycle sustainable. Personally, I found this part very insightful and the authors discipline exemplar. The authors start of with different test smells and what to do about it. They then discuss readability of the tests and of the error messages and spend some time of test object creation. Most notable from that part (for me) was their focus on using builders for creating test data, rather than object mothers.

The final part covers three (or actually two!) advanced topics. First is testing persistence where most interesting was how the authors seemed to prefer to "go all the way" whereas the common advise (for test speed) is to rollback and mock more. (this was actually a common theme in their book). The last two chapters deal with multi-threading and async code. I was unclear why these were separated in two chapters and they they were in this particular order. The content was excellent though, except that I missed some typical design guidelines related to multi-threading design. It almost felt they were in a hurry to write the last two chapters...

Anyways, in conclusion, this will definitively be one of my favorite (if not the favorite) TDD books and general design books. Steven and Nat did a wonderful job on this one. Though the book is not perfect, I enjoyed it thoroughly. A definite recommendation for anyone interested in modern design and TDD.
28/30 人认为此评论有用
平均3.0 星 This GREAT book deserves a better kindle version 2012年11月26日
评论者 Bigodines - 已在美国亚马逊上发表
版本: Kindle电子书 已确认购买
This is a GREAT book... one of those you don't wanna stop reading. But the kindle version sux so bad that I gave up when I saw the first code samples...

A programming book with code samples that are almost impossible to read is a huge drawback. 70% of the value is lost in the kindle version.. I am sure that sooner or later this will be fixed but until then... stick to the printed version.
3/3 人认为此评论有用
平均5.0 星 A must read for all OO developers 2010年5月20日
评论者 Wojciech Buras - 已在美国亚马逊上发表
版本: 平装 已确认购买
This book deserves its place among the most important writings in the TDD and OOD field in the recent years. Its greatest advantage is the presentation of the continuous evolution of high-quality software guided by tests (as the title says it). While reading the third chapter, the audience may clearly see, how Steve Freeman and Nat Pryce really worked on their example project - sometimes making necessary tradeoffs, sometimes taking a step back and so on. From their experience with the example project comes a clear message to the reader about the deep synergy between pragmatic and to-the-point object oriented design and test driven development: if you make good OO analysis and design, your code is more testable - if you drive your code with tests, it will probably also positively influence your design. The authors not only describe this synergy, they also give some very valuable advice about how not to lose it in the long run of your project in the fourth chapter. Last but not least, the authors give a short theoretical introduction about TDD and some hints related to testing corner cases like persistence or concurrency. All in all, I highly recommend this book to anyone interested in Test Driven Development and Object Oriented Design.
平均4.0 星 Good guidance of best practices 2012年4月18日
评论者 Tyler Fitch - 已在美国亚马逊上发表
版本: Kindle电子书 已确认购买
My co-workers and I read this as part of a technical book group.

It is written in a voice that is easily to follow and kinda entertaining.

The book slows down in Part 3 when it gets in to the nuts and bolts of the code, but all other sections explaining theory and "how to do it" are easy and quick to read.

It's still up to the reader to do follow through on the best practices described in the book, but the ideas presented in the book can make you a better developer.