You are previewing Professional Test-Driven Development with C#: Developing Real World Applications with TDD.
O'Reilly logo
Professional Test-Driven Development with C#: Developing Real World Applications with TDD

Book Description

Hands-on guidance to creating great test-driven development practice

Test-driven development (TDD) practice helps developers recognize a well-designed application, and encourages writing a test before writing the functionality that needs to be implemented. This hands-on guide provides invaluable insight for creating successful test-driven development processes. With source code and examples featured in both C# and .NET, the book walks you through the TDD methodology and shows how it is applied to a real-world application. You'll witness the application built from scratch and details each step that is involved in the development, as well as any problems that were encountered and the solutions that were applied.

  • Clarifies the motivation behind test-driven development (TDD), what it is, and how it works

  • Reviews the various steps involved in developing an application and the testing that is involved prior to implementing the functionality

  • Discusses unit testing and refactoring

Professional Test-Driven Development with C# shows you how to create great TDD processes right away.

Table of Contents

  1. Cover Page
  2. Title Page
  3. Copyright
  4. Dedication
  5. ABOUT THE AUTHORS
  6. ABOUT THE TECHNICAL EDITOR
  7. CREDITS
  8. ACKNOWLEDGMENTS
  9. PROFESSIONAL TEST-DRIVEN DEVELOPMENT WITH C#
  10. CONTENTS
  11. INTRODUCTION
    1. WHO THIS BOOK IS FOR
    2. WHAT THIS BOOK COVERS
    3. HOW THIS BOOK IS STRUCTURED
    4. WHAT YOU NEED TO USE THIS BOOK
    5. CONVENTIONS
    6. SOURCE CODE
    7. ERRATA
    8. P2P.WROX.COM
  12. PART I: Getting Started
    1. 1: The Road to Test-Driven Development
      1. THE CLASSICAL APPROACH TO SOFTWARE DEVELOPMENT
      2. A QUICK INTRODUCTION TO AGILE METHODOLOGIES
      3. THE CONCEPTS BEHIND TDD
      4. THE BENEFITS OF TDD
      5. A QUICK EXAMPLE OF THE TDD APPROACH
      6. SUMMARY
    2. 2: An Introduction to Unit Testing
      1. WHAT IS A UNIT TEST?
      2. A BRIEF LOOK AT NUNIT
      3. DECOUPLING WITH MOCK OBJECTS
      4. A BRIEF LOOK AT MOQ
      5. SUMMARY
    3. 3: A Quick Review of Refactoring
      1. WHY REFACTOR?
      2. CLEAN CODE PRINCIPLES
      3. CODE SMELLS
      4. TYPICAL REFACTORING
      5. SUMMARY
    4. 4: Test-Driven Development: Let the Tests Be Your Guide
      1. IT STARTS WITH THE TEST
      2. RED, GREEN, REFACTOR
      3. A REFACTORING EXAMPLE
      4. SUMMARY
    5. 5: Mocking External Resources
      1. THE DEPENDENCY INJECTION PATTERN
      2. ABSTRACTING THE DATA ACCESS LAYER
      3. SUMMARY
  13. PART II: Putting Basics into Action
    1. 6: Starting the Sample Application
      1. DEFINING THE PROJECT
      2. DEFINING THE USER STORIES
      3. THE AGILE DEVELOPMENT PROCESS
      4. CREATING THE PROJECT
      5. SUMMARY
    2. 7: Implementing the First User Story
      1. THE FIRST TEST
      2. IMPLEMENTING THE FUNCTIONALITY
      3. IMPROVING THE CODE BY REFACTORING
      4. TRIANGULATION OF TESTS
      5. SUMMARY
    3. 8: Integration Testing
      1. INTEGRATE EARLY; INTEGRATE OFTEN
      2. WRITING INTEGRATION TESTS
      3. WHEN AND HOW TO RUN INTEGRATION TESTS
      4. SUMMARY
  14. PART III: TDD Scenarios
    1. 9: TDD on the Web
      1. ASP.NET WEB FORMS
      2. WORKING WITH THE ASP.NET MVC
      3. WORKING WITH JAVASCRIPT
      4. SUMMARY
    2. 10: Testing Windows Communication Foundation Services
      1. WCF SERVICES IN YOUR APPLICATION
      2. TESTING WCF SERVICES
      3. SUMMARY
    3. 11: Testing WPF and Silverlight Applications
      1. THE PROBLEM WITH TESTING THE USER INTERFACE
      2. SUMMARY
  15. PART IV: Requirements and Tools
    1. 12: Dealing with Defects and New Requirements
      1. HANDLING CHANGE
      2. SUMMARY
    2. 13: The Great Tool Debate
      1. TEST RUNNERS
      2. UNIT TESTING FRAMEWORKS
      3. MOCKING FRAMEWORKS
      4. DEPENDENCY INJECTION FRAMEWORKS
      5. MISCELLANEOUS USEFUL TOOLS
      6. HOW TO INTRODUCE TDD TO YOUR TEAM
      7. SUMMARY
    3. 14: Conclusions
      1. WHAT YOU HAVE LEARNED
      2. TDD BEST PRACTICES
      3. THE BENEFITS OF TDD
      4. HOW TO INTRODUCE TDD IN YOUR TEAM
      5. SUMMARY
    4. APPENDIX: TDD Katas
      1. WORKING WITH TDD KATAS
      2. SHARE YOUR WORK
      3. OSIM USER STORIES
  16. INDEX