Growing object-oriented software review

.........................................................

from Gior­gio Sironi’s Blog

Growing Object-Oriented Software, Guided by TestsGrow­ing object-oriented soft­ware, guided by tests is a mas­ter­piece on Test-Driven Devel­op­ment, a valid guide for the begin­ner in this field and for the almost expert as well. This book guides the reader through a world where TDD is not only always applied, but it is kept in its pure form.
The title describes exactly the pur­pose of the prac­tices pre­sented in the book: start­ing an ambi­tious project from scratch, and expand the prod­uct from an empty skele­ton to a fully-featured appli­ca­tion. Unit, inte­gra­tion and accep­tance tests are the spec­i­fi­ca­tions which are writ­ten before the pro­duc­tion code, and that drive the devel­op­ment in an agile way towards a the end of an iter­a­tion or a release.

Struc­ture
The book is divided in five parts:

  • Intro­duc­tion to Test-Driven Devel­op­ment and design prin­ci­ples for object-oriented appli­ca­tions. This part bridges the begin­ner with the rest of the book, writ­ten for a pro­gram­mer at an inter­me­di­ate level.
  • The process of Test-Driven Devel­op­ment: TDD in a dou­ble cycle, mock­ing, third-party code, and every bit of the­ory you need to know about Red-Green-Refactor.
  • A worked exam­ple: 150 pages where the authors build from scratch an appli­ca­tion which inter­faces with the web and a user inter­face, by adding one test at the time and jus­ti­fy­ing every sin­gle step. The code is avail­able in dif­fer­ent pro­gram­ming lan­guages on the offi­cial web site.
  • Sus­tain­able Test-Driven Devel­op­ment: TDD is often aban­doned when issues arise due to its incor­rect usage. Man­ag­ing the test suite is the most impor­tant part of long-term main­tain­abil­ity and read­abil­ity, expres­sive­ness and con­sis­tency are taught here.
  • Advanced top­ics: per­sis­tence, thread­ing and asyn­chro­nous calls are often a dif­fi­cult field for test-driven appli­ca­tions, enhanc­ing the omnipresent dan­ger of intro­duc­ing brit­tle and slow tests. Though, it is not impos­si­ble to extend test­ing in these areas by tweak­ing the orig­i­nal approach. Remem­ber that if you code test-first, noth­ing can stop you from writ­ing testable code.

As you can see from the Advanced top­ics part, the book is ori­ented to a Java audi­ence, but if you exclude the last two chap­ters every prac­tice and prin­ci­ple is just tied to real object-oriented pro­gram­ming and not to par­tic­u­lar pro­gram­ming lan­guages. For exam­ples, PHP 5 has a com­plete object par­a­digm and the nec­es­sary tools (PHPUnit, Zend_Test) to prac­tice the tech­niques described in the book.
A basic knowl­edge of Java helps, though, because the code sam­ples are writ­ten in Java and make use of frame­works such as Swing; of course JUnit-based tests are instead per­fectly equiv­a­lent to test writ­ten with any other xUnit test­ing framework.

Some con­cepts explained by this book — such as the Walk­ing Skele­ton and Accep­tance TDD — were very enlight­en­ing. I guess there is a rea­son why Misko Hev­ery rec­om­mends this book:

Read­ing the book I some­times felt that I was lis­ten­ing to myself, espe­cially when the authors warned about global state, sin­gle­tons, overus­ing mocks, and doing work in con­struc­tors among other things. But unlike myself, who draws sharp lines between right and wrong, the authors did a good job of pre­sent­ing things on the gray scale of ben­e­fits and draw­backs. The book shows what a typ­i­cal code most peo­ple will write, and then show how tests point a way towards refactoring.

Also Robert C. Mar­tin, also known as Uncle Bob, has words of praise for Grow­ing object-oriented soft­ware:

At last a book, suf­fused with code, that exposes the deep sym­bio­sis between TDD and OOD. The authors, pio­neers in test-driven devel­op­ment, have packed it with prin­ci­ples, prac­tices, heuris­tics, and (best of all) anec­dotes drawn from their decades of pro­fes­sional expe­ri­ence. Every soft­ware crafts­man will want to pore over the chap­ters of worked exam­ples and study the advanced test­ing and design prin­ci­ples. This one’s a keeper.

I am glad I have fin­ished read­ing it before start­ing my the­sis on a large project. If you do not trust me, trust them. :)

See more here:
Grow­ing object-oriented soft­ware review

~ End Article and Begin Conversation ~

There are no comments yet...

~ Now It's Your Turn ~

Feel free to use <strong>, <em>, and <a href="">

[]

The Blogroll

Search this Site


[]