O'Reilly logo

Professional Test-Driven Development with C#: Developing Real World Applications with TDD by Jeff McWherter, James Bender

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CONTENTS

INTRODUCTION

PART I: GETTING STARTED

CHAPTER 1: THE ROAD TO TEST-DRIVEN DEVELOPMENT

The Classical Approach to Software Development

A Brief History of Software Engineering

From Waterfall to Iterative and Incremental

A Quick Introduction to Agile Methodologies

A Brief History of Agile Methodologies

The Principles and Practices of Test-Driven Development

The Concepts Behind TDD

TDD as a Design Methodology

TDD as a Development Practice

The Benefits of TDD

A Quick Example of the TDD Approach

Summary

CHAPTER 2: AN INTRODUCTION TO UNIT TESTING

What Is a Unit Test?

Unit Test Definition

What Is Not a Unit Test?

Other Types of Tests

A Brief Look at NUnit

What Is a Unit Test Framework?

The Basics of NUnit

Decoupling with Mock Objects

Why Mocking Is Important

Dummy, Fake, Stub, and Mock

Best and Worst Practices

A Brief Look at Moq

What Does a Mocking Framework Do?

A Bit About Moq

Moq Basics

Summary

CHAPTER 3: A QUICK REVIEW OF REFACTORING

Why Refactor?

A Project's Lifecycle

Maintainability

Code Metrics

Clean Code Principles

OOP Principles

Encapsulation

Inheritance

Polymorphism

The SOLID Principles

The Single Responsibility Principle

The Open/Close Principle

The Liskov Substitution Principle

The Interface Segregation Principle

The Dependency Inversion Principle

Code Smells

What Is a Code Smell?

Duplicate Code and Similar Classes

Big Classes and Big Methods

Comments

Bad Names

Feature Envy

Too Much If/Switch

Try/Catch Bloat

Typical Refactoring

Extract Classes or Interfaces

Extract ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required