Skip to content

Code samples for the book Practical Test-Driven Development with C# 7

License

Notifications You must be signed in to change notification settings

rw-nowakpiotr/Code-Samples

 
 

Repository files navigation

Code-Samples

Code samples for the book Practical Test Driven Development

What this book covers

Chapter 1 - Why TDD is Important, what is Test Driven Development and why should you care? In this chapter learn what TDD is and why it matters. A compelling argument for TDD will be made and the benefits and more importantly the execution will be shown.

Chapter 2 - Setting up the .NET Test Environment, setup your IDE and configure the testing framework so that you can easily run your tests in C# and .NET. More detail and provide many more examples of growing complexity in the Speaker Meet API.

Chapter 3 - Setting up the JavaScript Environment, configure the JavaScript testing framework so that you can easily run your tests in your IDE. More detail and provide many more examples of growing complexity in the Speaker Meet React application.

Chapter 4 - What to Know Before Getting Started, dive deeper into the Why and How of TDD. Learn the importance of defining and testing boundaries and abstracting away 3rd party code (including the .NET Framework). Discover more advanced concepts such as spies, mocks, and fakes, and how to avoid pitfalls along the way.

Chapter 5 - Tabula Rasa - Approaching an Application with TDD in Mind, how do you get started with a new application? Apply what you've learned in the previous chapters and take the same approach with a full-sized application using Speaker Meet as an example.

Chapter 6 - Approaching the Problem, take the broader problem of the overall application and break it into meaningful chunks that can be developed independently. Learn different approaches to developing an application such as front to back, back to front, and inside out.

Chapter 7 - Test Driving C# Applications, take requirements and assembled user stories and turn them into working software using Test Driven Development. Utilize all the skills you’ve assembled so far to test the boundaries, testing small, individual units.

Chapter 8 - Abstract Away Problems, abstract away 3rd party libraries, including the .NET Framework. Remove dependencies on things such as DateTime and Entity Framework. Learn ways to decouple your application from specific implementations to not only allow your application to be testable but much more flexible and easy to modify in the future.

Chapter 9 - Testing JavaScript Applications, Now that you have a working API it's time to focus on creating a Single Page Application in JavaScript using React. Focus on test driving actions and reducers and any functionality within the application.

Chapter 10 - Exploring Integrations, discover how to write integration tests to ensure your application is functioning properly.

Chapter 11 - Changes in Requirements, what happens when the requirements change? What happens if a bug is discovered? No problem, change a test or write a new one to cover the new requirement or to defend against the discovered bug. Now, write some new code or change some existing code to make all of our new/modified tests pass. If you do everything correctly we should feel safe to make these changes as our existing test suite will cover you from introducing new bugs.

Chapter 12 - The Legacy Problem, there are a lot of applications out there without sufficient (any?) test coverage. Even fewer were written test-first. Discover some of the major problems with legacy applications that weren’t written with testability in mind will be identified and how to best to recover.

Chapter 13 - Unraveling a Mess, how do you go about safely modifying a legacy application that wasn’t written with testing in mind? How can you add tests to minimize the potential for introducing new bugs when modifying existing code? An extreme example will be used to explore these topics and more.

Chapter 14 - A Better Foot Forward, remember, TDD is a personal choice. You don't need anyone's permission to do good work. Advice on how to continue a successful journey of TDD, how to introduce TDD to your team, and how to rejoin the world as a TDD expert.

About

Code samples for the book Practical Test-Driven Development with C# 7

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 61.7%
  • JavaScript 36.9%
  • Other 1.4%