A Guided Path to Test-Driven Development - TDD
I do not recall who introduced me to Test-Driven Development (TDD), but I have always been interested in the testing aspect of software development. I vividly remember reading the iconic book Test-Driven Development By Example by Kent Beck on my commute. Every page was a discovery, and I felt a sense of frustration, as the baby steps conflicted with my confidence that my code would work.
However, given the context of my early career, I did not have the opportunity to explore TDD further. The places I worked at unfortunately cared more about delivering tasks quickly than sacrificing time for testing. I share more about my TDD history in a blog post, but I was astonished by the lack of care for testing among practitioners.
My intention here is to share my previous experience with writing tests and resources that I think are helpful. This is not a definitive guide to testing, but rather a structured way to get started.
- Introduction
- Changing your mindset
- Building software with tests X software without tests
- Frameworks available for testing
- PHPUnit
- Jest
- Jasmine
- Testing library
- Junit
- Test doubles
- The history
- Mocks, dummies, spies, fakes - testing your code
- Are true mocks evil?
- Advanced topics
- ARE YOU NOT USING TDD?! - PART 1
- ARE YOU NOT USING TDD?! – PART 2 (Legacy code)
- Is TDD dead ?
- On one hundred percent code coverage - how to approach coverage and void misusing it
- Jest asserts beyond equals - tips for improving assertions
- Jest timers and reactjs - A use case for using jest time-related functions
- Test Driven Development anti-patterns
- TDD anti-patterns - The liar, excessive setup, the giant, slow poke
- TDD anti-patterns - The mockery, the inspector, the generous leftovers and the local hero
- TDD anti-patterns - The nitpicker, the secret catcher, the dodger and the Loudmouth
- TDD anti-patterns - The greedy catcher, The sequencer, Hidden dependency and The enumerator
- TDD anti-patterns - The stranger, The operating system evangelist, Success against all odds and The free ride
- TDD anti-patterns - The One, The Peeping Tom, The Flash and The Jumper
- Outside-in
- Strategies for testing