Test Driven Development With C#
Outline

Test Driven Development with C#

The Test-Driven Development in C# course presents a number of modern practices for developing code based on an iterative and incremental development lifecycle. Agility and predictability are two qualities often missing from software development. A test-driven approach, in which design is grown and code delivered incrementally according to functionality or risk, forms the basis of the construction phase of an iterative and incremental development. The use of unit testing provides confidence in existing code and supports the ability to refactor code as development unfolds. The course can be delivered using NUnit, MSTest or XUnit as the testing frameworks of choice. Mocking is also explored using both Moq and NSubstitute.

Objectives

  • Appreciate the benefits of a continuous and iterative approach to design and delivery
  • Recognise the purpose and practice of refactoring in keeping a system supple and adaptable
  • Know how to build up a set of unit tests
  • Understand the consequences of dependency management on testing and code quality and working with mocks using RhinoMock

Prerequisites

  • Experience in C# programming

Contents

Agile Development Microprocess

  • Traditional versus agile development processes
  • Iterative and incremental development
  • Informal and continuous design
  • The role of refactoring
  • Refactoring versus other code changes
  • Extreme Programming
  • Test-Driven Development

Testing in Principle

  • Traditional view and reality of testing
  • Driving development through testing
  • Testing early, often and automatically
  • Testing versus debugging
  • White-box versus black-box testing
  • Functional versus operational testing

Basic Unit Testing in Practice

  • Test plans versus test code
  • Use of Debug.Assert
  • Testing at the interface
  • Testing the simplest things first
  • Testing incrementally
  • Testing correctness of failure

Overview of NUnit, MSTest and xUnit

  • NUnit and the xUnit family
  • MSTest and the .NET Framework
  • Test fixtures and test methods
  • The role of attributes in NUnit's design
  • Assertion methods
  • Testing correctness of exceptions
  • Defining common fixture code
  • Mocking with Moq and NSubstitute

Test-Writing Techniques

  • Red, green, refactor
  • None to one to many
  • Faking it
  • Telling the truth
  • Isolated and short tests
  • Refactor common fixture code
  • Declare, prepare, assert
  • Test by method, state or scenario
  • Custom assertions

Common Refactorings

  • Renaming variables, methods, classes and packages
  • Restructuring class hierarchies by extracting interfaces, superclasses and subclasses
  • Partitioning classes by extracting classes and methods
  • Changing private representation

Decoupling Techniques

  • Unmanaged dependencies
  • Test-driven decoupling
  • Layering
  • Reorganising packages
  • Eliminating cyclic dependencies
  • Mock objects
  • Eliminating Singletons, statics and other globals
  • Testing I/O

Do You Have a Question?

);

Accreditations:

Our team are AWS Professional Certified Solutions  ArchitectsOur team are AWS Devops Specialty CertifiedAltova Training PartnerAltova Consulting PartnerOur team members are Professional Scrum master certified
Website Design by tinyBox Creative