TDD for a new Java application - Where should I start? <p><strong>Goal</strong> : testing TDD in a typical enterprise Java environment.</p> <p><strong>Context :</strong></p> <p>Frameworks used (even if it's overkill, I practice <a href="http://www.scotthyoung.com/blog/2008/05/05/use-projects-to-educate-yourself-for-free/" rel="nofollow">project based learning</a>) :</p> <ul> <li>DAO : Hibernate</li> <li>Spring IoC</li> <li>Front : Spring MVC + Twitter Boostrap (if possible)</li> <li>TDD : JUnit</li> <li>DB : PostgreSQL</li> </ul> <p>My project is a simple billing system which would help freelancers create, edit and print/send bills to customers.</p> <p>Once my project is created and configured, I don't know where to start. Let's say my first my first feature is to create a bill with a unique number and a title.</p> <p><strong>Question</strong> : What should I test first ?</p> <ul> <li>the Domain layer with a createBill(String title) method which would generate a unique Serial Number ? I'd mock the DB layer.</li> <li>the UI first, mocking the service layer ? I don't know how to do it.</li> </ul> <p>Thanks in advance for your answers,</p> <p>Cheers</p>