• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to get practice in TDD / Code (first) testing ?  RSS feed

 
sid smith
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have skimmed some books on TDD and I don't find any of them good, except Pragmatic unit testing in java with junit. Unfortunately, this book is introductory and does not have enough examples to get skilled and also build some memory. I also read a bit of "Practical Unit Testing with JUnit and Mockito" which was good, but had too many unrelated examples and no project.

I am confused and I am looking for ways to learn TDD. Are there any project ideas or open source projects where I can practice TDD ? I want to become a better developer, but I am unable to find ways to get there sooner. Please suggest something for me.
 
Stephan van Hulst
Saloon Keeper
Posts: 7993
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you should probably think of something for yourself to work on, preferably complex enough that you need to write your own interfaces, or even an entire API library. However, you can do TDD on small projects.

For instance, you could program a game of FreeCell, and start out by creating skeletons for the cards, the cascades, the game, etc. When you have determined that the contract for a cascade should be that you can build cards that are one smaller than and have a different color from the last card on the cascade, you can write a test for that requirement.

When you've convinced yourself that all the contracts you've written are sufficient and sensible (for the time being), and you've written all the tests that check these contracts, you can start implementing.
 
Junilu Lacar
Sheriff
Posts: 11494
180
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
TDD tutorials by experts like James Shore and J B Rainsberger: james shore tdd j b rainsberger tdd
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!