All Projects → stemmlerjs → solidbook-tdd-examples

stemmlerjs / solidbook-tdd-examples

Licence: other
TDD examples and solutions from solidbook.io - The Software Design and Architecture Handbook

solidbook-tdd-examples

Coding katas/TDD examples from solidbook.io.

About this (learning TDD)

TDD is such an important technique, but it's one of the most challenging software design techniques to master. There's a lot of confusion, misdirection, and partial explanations. Many of us have tried TDD but gave up because it was too hard or felt like it took too much time. I believe that's a symptom of not fully grasping how TDD is to be used in the real world.

In Part III - Phronesis, we start over. We start from scratch. Specifically, we:

  1. Understand the nature of complexity and features
  2. Understand how to identify behavior in features
  3. Fix our understanding of object-oriented programming
  4. Understand the difference between core code and infrastructure code
  5. Understand how object-oriented architectures work

With this foundation, in Part IV - Test-Driven Development Basics, Part V - Object-Oriented Design (With Tests), and Part X - Advanced Test-Driven Development we continue with:

  1. Practicing the Classic TDD school of thought on many katas
  2. Practicing the Mockist TDD school of thought on many katas

At this point, you'll have an understanding of how and to what extent to use TDD in a variety of contexts (ie: the front-end, in the back-end, with E2E tests, as unit tests, and so on).

Finally, the path to master involves one step:

  1. Practice. And lots of it (hundreds).

Let's begin. Make sure you've read Part III - Phronesis first.

Classic TDD examples/katas

Classic TDD, created originally by Kent Beck, is also known as the Detroit/Chicago school of thought for TDD. What makes Classic TDD classic is the absence of mocking (found in the Mockist/London-style form of TDD). In Classic TDD, we verify our classes or functions by testing them exactly as they occur without mocking out dependencies. This means that if some class we wish to test relied on the use of a database, we'd be testing that class with the database connection as well. While this gives you a greater level of confidence that your code is working correctly, for code involving infrastructure code, it makes test setup and teardown harder (specifically with respect to unit tests) and it makes them run slower as well slower.

To start our TDD journey, we focus on mastering the Classic TDD school of thought. We are solely focused on solving problems that exclusively involve core code (no infrastructure).

Part IV: Test-Driven Development Basics

29. Getting Started with Classic Test-Driven Development

30. Working Backwards using Arrange-Act-Assert

31. Avoiding Impasses with the Transformation Priority Premise

Mockist TDD examples/katas

Coming soon

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].