WHAT YOU HAVE LEARNED

In addition to some pointers about incidental frameworks and patterns such as Fluent NHibernate and the repository, this book has given you a solid foundation in TDD principles. You've learned some core patterns and techniques needed for the successful practice of TDD, such as dependency injection. You've also seen how adhering to the SOLID Principles and development using an agile methodology can support TDD developers in their work. This chapter offers a few last pointers to help you in the practice of TDD.

You Are the Client of Your Code

As a developer, you consume services and components when constructing your software. These pieces come together to form a whole greater than the sum of their parts. Usually, these services and components are things that you or a member of your development team has written. This means that the primary consumers of these services and components you develop are you and your development team. These services and components should be simple to understand and easy to use. A new member of your development team should quickly and easily be able to determine the function and usage of these services and components by their names and method signatures.

In TDD you are the first client of any service or component you create. By writing a test for the service or component you are creating, you are the first one to consume that service or component. Is the service or component easy to use? Do the naming and method signatures give you a ...

Get Professional Test-Driven Development with C#: Developing Real World Applications with TDD now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.