Better Software - December 2007 - (Page 37) also exercises all of these built-in assertions that look for additional invariants that derive indirectly from the requirements. The developers thought that it would be a good idea to leave the assertions in the code in the field, either to drive recovery action or to print out a message that the customer should contact customer service to report a bug. But the boss was uncomfortable with this and told the developers not to do it. We don’t want our code failing in the field; it should continue to run. Even when admonished that continued operation in light of a failed invariant renders the program’s results invalid and that it would be better to stop the program than to silently corrupt the client data, the boss stood his ground. The overtaking company’s management discovered his reaction and re-assigned him to staff a telephone in customer service. Exhaustive testing is impossible, and you cannot test quality into a product. Forward-engineered spot checks do not constitute adequate testing; in fact, their value is very low. Instead: • Use invariants and assertions that formally tie to the user needs as they are understood. While total formal program proving is a long way off, it is better to get the broader coverage that invariants and assertions can give you than to use the spot-checking of a unit test. • Don’t forget code inspections—one of the most cost-effective bug-spotting techniques we’ve got. • As noted by Laurie Williams, if you’re pairing, you already have four eyes looking at every line of code, and that will help your quality immensely. Change pairings frequently so you don’t get into mind-lock with each other. And remember that even pair programming is no substitute for good design. We know that this story has been about TDD and that TDD is not a testing method, but a design method—that it is the main testing focus on many projects to the contrary notwithstanding. But just in case you were interested in testing . . . improved usability in the final product. Gertrud has published Patterns for the Role of Use Cases, and she is a founder of the Danish Agile User Group. Email Gertrud at gertrud@gertrudandcope.com. Jim Coplien (http://users.rcn.com/jcoplien) has been a software professional for more than thirty years and is currently senior agile coach and systems architect at Nordija A/S in Copenhagen, Denmark. He is author of pioneering software design books including Advanced C++, Multiparadigm Design, and Organizational Patterns of Agile Software Development. He is a founding member and Member Emeritus of the Hillside Group, the group that launched the software pattern discipline. When he grows up, he wants to be an anthropologist. Email Jim at JOCoplien@cs.com. Neil Harrison is an assistant professor of computer science at Utah Valley State College in Orem, Utah. Before that, Neil developed software professionally for more than twenty years. He is the co-author of Organizational Patterns of Agile Software Development. Neil is acknowledged as the world's leading expert on pattern shepherding. The pattern conference (PLoP) shepherding award is named after him. Email Neil at harrisne@uvsc.edu. The authors thank Stine Laforce, Rex Black, Jeff Sutherland, Håkan Reis, and Magnus Mårtensson for comments, criticisms, and encouragement. Don’t Neglect System Testing Unit testing can help, and tests can play a role in sharpening one’s thinking—but not as most people practice TDD. There is hope. Those who live at the leading edge of the curve with healthy skepticism and long hindsight are offering healthy alternatives. Many of the recommendations from above can be found embodied in behavior-driven development (BDD) as advocated by Dan North. BDD is a more sober and sane approach that integrates testing and development—not as a way to supplant careful structuring, but as an audit on how the system meets end-user needs. We are seeing other sound ideas that return to solid principles of quality-oriented development, such as Bertrand Meyer’s contract-driven development. The kneejerk reactions that took place in response to overly heavyweight interpretation of their principles are extreme but are done absent responsible reasoning. Instead, follow the proven practices as described in these articles. They can be summarized as follows: Testing is an integral part of software development and requires the same careful attention to systematic design as writing the code itself. Just like the code, the tests must be designed; however, test design is essentially different from code design. One cannot simply augment cowboy coding with cowboy testing and expect to produce a quality product. {end} Gertrud Bjørnvig is an independent consultant focusing on agile software development. During her twenty years in software development, she has been working at Scandinavian companies such as TietoEnator and Navision. As a use case expert, she has worked closely with test specialists and usability specialists to find a common ground in use cases that can support improved quality as well as www.StickyMinds.com Sticky Notes For more on the following topics go to www.StickyMinds.com/bettersoftware. I I References Kent Beck DECEMBER 2007 BETTER SOFTWARE 37 http://users.rcn.com/jcoplien http://www.StickyMinds.com/bettersoftware http://www.StickyMinds.com
Table of Contents Feed for the Digital Edition of Better Software - December 2007 Better Software - December 2007 Contents Mark Your Calendar What's Happening @ StickyMinds.com Technically Speaking Code Craft Test Connection Management Chronicles Man and Machine Let Your Values be Your Guide A Story About User Stories and Test-driven Development Product Announcements The Last Word Ad Index Better Software - December 2007 Better Software - December 2007 - Better Software - December 2007 (Page cover1) Better Software - December 2007 - Better Software - December 2007 (Page cover2) Better Software - December 2007 - Better Software - December 2007 (Page 1) Better Software - December 2007 - Better Software - December 2007 (Page 2) Better Software - December 2007 - Contents (Page 3) Better Software - December 2007 - Mark Your Calendar (Page 4) Better Software - December 2007 - Mark Your Calendar (Page 5) Better Software - December 2007 - Mark Your Calendar (Page 6) Better Software - December 2007 - Technically Speaking (Page 7) Better Software - December 2007 - Technically Speaking (Page 8) Better Software - December 2007 - What's Happening @ StickyMinds.com (Page 9) Better Software - December 2007 - Code Craft (Page 10) Better Software - December 2007 - Code Craft (Page 11) Better Software - December 2007 - Code Craft (Page 12) Better Software - December 2007 - Code Craft (Page 13) Better Software - December 2007 - Test Connection (Page 14) Better Software - December 2007 - Test Connection (Page 15) Better Software - December 2007 - Management Chronicles (Page 16) Better Software - December 2007 - Management Chronicles (Page 17) Better Software - December 2007 - Management Chronicles (Page 18) Better Software - December 2007 - Management Chronicles (Page 19) Better Software - December 2007 - Man and Machine (Page 20) Better Software - December 2007 - Man and Machine (Page 21) Better Software - December 2007 - Man and Machine (Page 22) Better Software - December 2007 - Man and Machine (Page 23) Better Software - December 2007 - Man and Machine (Page 24) Better Software - December 2007 - Man and Machine (Page 25) Better Software - December 2007 - Let Your Values be Your Guide (Page 26) Better Software - December 2007 - Let Your Values be Your Guide (Page 27) Better Software - December 2007 - Let Your Values be Your Guide (Page 28) Better Software - December 2007 - Let Your Values be Your Guide (Page 29) Better Software - December 2007 - Let Your Values be Your Guide (Page 30) Better Software - December 2007 - Let Your Values be Your Guide (Page 31) Better Software - December 2007 - A Story About User Stories and Test-driven Development (Page 32) Better Software - December 2007 - A Story About User Stories and Test-driven Development (Page 33) Better Software - December 2007 - A Story About User Stories and Test-driven Development (Page 34) Better Software - December 2007 - A Story About User Stories and Test-driven Development (Page 35) Better Software - December 2007 - A Story About User Stories and Test-driven Development (Page 36) Better Software - December 2007 - A Story About User Stories and Test-driven Development (Page 37) Better Software - December 2007 - A Story About User Stories and Test-driven Development (Page 38) Better Software - December 2007 - A Story About User Stories and Test-driven Development (Page 39) Better Software - December 2007 - A Story About User Stories and Test-driven Development (Page 40) Better Software - December 2007 - A Story About User Stories and Test-driven Development (Page 41) Better Software - December 2007 - A Story About User Stories and Test-driven Development (Page 42) Better Software - December 2007 - Product Announcements (Page 43) Better Software - December 2007 - Product Announcements (Page 44) Better Software - December 2007 - Product Announcements (Page 45) Better Software - December 2007 - Product Announcements (Page 46) Better Software - December 2007 - The Last Word (Page 47) Better Software - December 2007 - Ad Index (Page 48) Better Software - December 2007 - Ad Index (Page cover3) Better Software - December 2007 - Ad Index (Page cover4)
For optimal viewing of this digital publication, please enable JavaScript and then refresh the page. If you would like to try to load the digital publication without using Flash Player detection, please click here.