Skip to Content
Growing Object-Oriented Software, Guided by Tests
book

Growing Object-Oriented Software, Guided by Tests

by Steve Freeman, Nat Pryce
October 2009
Intermediate to advanced
384 pages
8h 54m
English
Addison-Wesley Professional
Content preview from Growing Object-Oriented Software, Guided by Tests

Chapter 13. The Sniper Makes a Bid

In which we extract an AuctionSniper class and tease out its dependencies. We plug our new class into the rest of the application, using an empty implementation of auction until we’re ready to start sending commands. We close the loop back to the auction house with an XMPPAuction class. We continue to carve new types out of the code.

Introducing AuctionSniper

A New Class, with Dependencies

Our application accepts Price events from the auction, but cannot interpret them yet. We need code that will perform two actions when the currentPrice() method is called: send a higher bid to the auction and update the status in the user interface. We could extend Main, but that class is looking rather messy—it’s already ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Test Driven Development: By Example

Test Driven Development: By Example

Kent Beck
Coding with AI: The End of Software Development as We Know It

Coding with AI: The End of Software Development as We Know It

Tim O'Reilly, Addy Osmani, Gergely Orosz, Kent Beck, Camille Fournier, Avi Flombaum, Maxi Ferreira, Harper Reed, Jay Parikh, Birgitta Böckeler, Angie Jones, Craig McLuckie, Patty O’Callaghan, Chip Huyen, swyx, Andrew Stellman, Phillip Carter, Nikola Balic, Brett Smith, Chelsea Troy, Lili Jiang

Publisher Resources

ISBN: 9780321574442Purchase book