Practical Test-Driven Development using C# 7

Develop applications for the real world with a thorough software testing approach
Preview in Mapt

Practical Test-Driven Development using C# 7

John Callaway, Clayton Hunt

Develop applications for the real world with a thorough software testing approach
Mapt Subscription
FREE
$29.99/m after trial
eBook
$10.00
RRP $39.99
Save 74%
Print + eBook
$49.99
RRP $49.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$10.00
$49.99
$29.99 p/m after trial
RRP $39.99
RRP $49.99
Subscription
eBook
Print + eBook
Start 14 Day Trial

Frequently bought together


Practical Test-Driven Development using C# 7 Book Cover
Practical Test-Driven Development using C# 7
$ 39.99
$ 10.00
Java EE 8 High Performance Book Cover
Java EE 8 High Performance
$ 39.99
$ 10.00
Buy 2 for $20.00
Save $59.98
Add to Cart

Book Details

ISBN 139781788398787
Paperback403 pages

Book Description

Test-Driven Development (TDD) is a methodology that helps you to write as little as code as possible to satisfy software requirements, and ensures that what you've written does what it's supposed to do. If you're looking for a practical resource on Test-Driven Development this is the book for you. You've found a practical end-to-end guide that will help you implement Test-Driven Techniques for your software development projects.

You will learn from industry standard patterns and practices, and shift from a conventional approach to a modern and efficient software testing approach in C# and JavaScript. This book starts with the basics of TDD and the components of a simple unit test. Then we look at setting up the testing framework so that you can easily run your tests in your development environment. You will then see the importance of defining and testing boundaries, abstracting away third-party code (including the .NET Framework), and working with different types of test double such as spies, mocks, and fakes.

Moving on, you will learn how to think like a TDD developer when it comes to application development. Next, you'll focus on writing tests for new/changing requirements and covering newly discovered bugs, along with how to test JavaScript applications and perform integration testing. You’ll also learn how to identify code that is inherently un-testable, and identify some of the major problems with legacy applications that weren’t written with testability in mind.

By the end of the book, you’ll have all the TDD skills you'll need and you’ll be able to re-enter the world as a TDD expert!

 

Table of Contents

Chapter 1: Why TDD is Important
First, a little background
So, what is TDD?
An approach to TDD 
Arguments against TDD
Arguments in favor of TDD
Different types of test
Why does it matter?
Summary
Chapter 2: Setting Up the .NET Test Environment
Installing the .NET Core SDK
Creating a project in VS Code
Switching to xUnit
What is Speaker Meet?
Summary
Chapter 3: Setting Up a JavaScript Environment
Node.js
A quick introduction to JavaScript IDEs
Summary
Chapter 4: What to Know Before Getting Started
Untestable code
Summary
Chapter 5: Tabula Rasa – Approaching an Application with TDD in Mind
Where to begin
Yak shaving
A clean slate
Test small
Devil's advocate
Test negative cases first
When testing is painful
Breaking down Speaker Meet
Summary
Chapter 6: Approaching the Problem
Defining the problem
Digesting the problem
An N-Tiered hexagonal architecture
Testing direction
Summary
Chapter 7: Test-Driving C# Applications
Reviewing the requirements
Speaker listing
Speaker details
Summary
Chapter 8: Abstract Away Problems
Abstracting away problems
Abstracting the data layer
Genericizing the repository
Summary
Chapter 9: Testing JavaScript Applications
Creating a React app
The plan
Speaker listing
Speaker detail
Summary
Chapter 10: Exploring Integrations
Implementing a real API service
End-to-end integration tests
Configuring the API project
Summary
Chapter 11: Changes in Requirements
Hello World
FizzBuzz
TODO app  
Changes to Speaker Meet
What now?
Summary
Chapter 12: The Legacy Problem
What is legacy code?
Typical issues resulting from legacy code
Issues that prevent adding tests 
Dealing with legacy problems
Moving forward 
Summary
Chapter 13: Unraveling a Mess
Inheriting code
Life sometimes hands you lemons
Summary
Chapter 14: A Better Foot Forward
What we've covered
Moving forward
Introducing TDD to your team
Rejoining the world as a TDD expert
Summary

What You Will Learn

  • The core concepts of TDD
  • Testing in action with a real-world case study in C# and JavaScript using React
  • Writing proper Unit Tests and testable code for your application
  • Using different types of test double such as stubs, spies, and mocks
  • Growing an application guided by tests
  • Exploring new developments on a green-field application
  • Mitigating the problems associated with writing tests for legacy applications
  • Modifying a legacy application to make it testable

Authors

Table of Contents

Chapter 1: Why TDD is Important
First, a little background
So, what is TDD?
An approach to TDD 
Arguments against TDD
Arguments in favor of TDD
Different types of test
Why does it matter?
Summary
Chapter 2: Setting Up the .NET Test Environment
Installing the .NET Core SDK
Creating a project in VS Code
Switching to xUnit
What is Speaker Meet?
Summary
Chapter 3: Setting Up a JavaScript Environment
Node.js
A quick introduction to JavaScript IDEs
Summary
Chapter 4: What to Know Before Getting Started
Untestable code
Summary
Chapter 5: Tabula Rasa – Approaching an Application with TDD in Mind
Where to begin
Yak shaving
A clean slate
Test small
Devil's advocate
Test negative cases first
When testing is painful
Breaking down Speaker Meet
Summary
Chapter 6: Approaching the Problem
Defining the problem
Digesting the problem
An N-Tiered hexagonal architecture
Testing direction
Summary
Chapter 7: Test-Driving C# Applications
Reviewing the requirements
Speaker listing
Speaker details
Summary
Chapter 8: Abstract Away Problems
Abstracting away problems
Abstracting the data layer
Genericizing the repository
Summary
Chapter 9: Testing JavaScript Applications
Creating a React app
The plan
Speaker listing
Speaker detail
Summary
Chapter 10: Exploring Integrations
Implementing a real API service
End-to-end integration tests
Configuring the API project
Summary
Chapter 11: Changes in Requirements
Hello World
FizzBuzz
TODO app  
Changes to Speaker Meet
What now?
Summary
Chapter 12: The Legacy Problem
What is legacy code?
Typical issues resulting from legacy code
Issues that prevent adding tests 
Dealing with legacy problems
Moving forward 
Summary
Chapter 13: Unraveling a Mess
Inheriting code
Life sometimes hands you lemons
Summary
Chapter 14: A Better Foot Forward
What we've covered
Moving forward
Introducing TDD to your team
Rejoining the world as a TDD expert
Summary

Book Details

ISBN 139781788398787
Paperback403 pages
Read More

Read More Reviews

Recommended for You

Java EE 8 High Performance Book Cover
Java EE 8 High Performance
$ 39.99
$ 10.00
Cloud Native Development Patterns and Best Practices Book Cover
Cloud Native Development Patterns and Best Practices
$ 35.99
$ 10.00
Microservice Patterns and Best Practices Book Cover
Microservice Patterns and Best Practices
$ 35.99
$ 10.00
Introducing Test Driven Development in C# [Video] Book Cover
Introducing Test Driven Development in C# [Video]
$ 124.99
$ 10.00
Test-Driven Java Development - Second Edition Book Cover
Test-Driven Java Development - Second Edition
$ 39.99
$ 10.00
C# 7 and .NET Core 2.0 High Performance Book Cover
C# 7 and .NET Core 2.0 High Performance
$ 35.99
$ 10.00