28,99 €
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.
Sie lesen das E-Book in den Legimi-Apps auf:
Seitenzahl: 503
Veröffentlichungsjahr: 2011
CONTENTS
Part I : Getting Started
Chapter 1 : The Road to Test-Driven Development
The Classical Approach to Software Development
A Quick Introduction to Agile Methodologies
The Concepts Behind TDD
The Benefits of TDD
A Quick Example of the TDD Approach
Summary
Chapter 2 : An Introduction to Unit Testing
What is a Unit Test?
A Brief Look at NUnit
Decoupling with Mock Objects
A Brief Look at Moq
Summary
Chapter 3 : A Quick Review of Refactoring
Why Refactor?
Clean Code Principles
Code Smells
Typical Refactoring
Summary
Chapter 4 : Test-Driven Development: Let the Tests Be Your Guide
It Starts with the Test
Red, Green, Refactor
A Refactoring Example
Summary
Chapter 5 : Mocking External Resources
The Dependency Injection Pattern
Abstracting the Data Access Layer
Summary
Part II : Putting Basics into Action
Chapter 6 : Starting the Sample Application
Defining the Project
Defining the User Stories
The Agile Development Process
Creating the Project
Summary
Chapter 7 : Implementing the First User Story
The First Test
Implementing the Functionality
Improving the Code by Refactoring
Triangulation of Tests
Summary
Chapter 8 : Integration Testing
Integrate Early; Integrate Often
Writing Integration Tests
When and How to Run Integration Tests
Summary
Part III : TDD Scenarios
Chapter 9 : TDD on the Web
ASP.NET Web Forms
Working with the ASP.NET MVC
Working with JavaScript
Summary
Chapter 10 : Testing Windows Communication Foundation Services
WCF Services in Your Application
Testing WCF Services
Summary
Chapter 11 : Testing WPF and Silverlight Applications
The Problem with Testing the User Interface
Summary
Part IV : Requirements and Tools
Chapter 12 : Dealing with Defects and New Requirements
Handling Change
Summary
Chapter 13 : The Great Tool Debate
Test Runners
Unit Testing Frameworks
Mocking Frameworks
Dependency Injection Frameworks
Miscellaneous Useful Tools
How to Introduce TDD to Your Team
Summary
Chapter 14 : Conclusions
What You Have Learned
TDD Best Practices
The Benefits of TDD
How to Introduce TDD in Your Team
Summary
Appendix : TDD Katas
Introduction
PART I
Getting Started
CHAPTER 1: The Road to Test-Driven DevelopmentCHAPTER 2: An Introduction to Unit TestingCHAPTER 3: A Quick Review of RefactoringCHAPTER 4: Test-Driven Development: Let the Tests Be Your GuideCHAPTER 5: Mocking External ResourcesChapter 2
An Introduction to Unit Testing
WHAT’S IN THIS CHAPTER?
What a unit test isHow unit testing differs from other types of testsHow unit testing frameworks can help you write unit tests quickly and easilyWhy mocking external resources in your test is important when practicing TDDA brief overview of the NUnit unit testing framework and the Moq mocking framework, two very popular TDD tools in the .NET worldUnit testing (UT) is the cornerstone of test-driven development (TDD). When your unit tests are properly aligned with and correctly reflect your business requirements, they almost become a living design document — one that can validate the code you’ve written with the push of a button. Unit tests are not difficult to write, although they do require a minor change to how you usually approach writing software. They also represent a few new concepts to master, such as code isolation and the idea of having stand-in or mock objects to enable your tests to focus on only the code that is being tested. These new concepts are integral to TDD. The ability to write isolated, repeatable, and focused tests allows you to ensure that your code is meeting the business’s needs and can continue to evolve without those changes disrupting the code’s fidelity to the business’s needs. To help you with these concepts, tools and frameworks such as NUnit and Moq can make your development process easier, faster, and more rewarding.
WHAT IS A UNIT TEST?
Over the years, many different and mutually exclusive definitions of the term unit test have arisen. Many people say “unit test” when they really mean component test, integration test, or even user acceptance test (UAT). This can lead to a lot of confusion in software development in general. In TDD that confusion takes on a whole new dimension when you consider just how central to the practice of TDD unit tests are. It’s important for the sake of communicating with our fellow developers that we maintain a consistent definition of the term “unit test.”
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
Lesen Sie weiter in der vollständigen Ausgabe!
