Wow, @davefarley77 explains TDD very well here. https://www.youtube.com/watch?v=-f_HgWbomCI&t=247s
especially the gotchas when you get started.
I am bringing it to the embedded world and I see the different mindsets and challenges.
Thanks for explaining it so well. #TDD
Due to the code signing problems caused by the .NET Foundation switchover to the Microsoft Time Stamping service, we were definitely going to want to ship a 2.5.1 release.
We also expected there to be issues with the overhauled assertion library changes in 2.5.0. We've already fixed a few:
We just shipped new prerelease versions of the core framework, the Visual Studio adapter, and analyzers.
This is primarily a bug fix/performance release, but it does include a new overload for Assert.NotNull when passed Nullable<T> values, returns the unwrapped T value as a result.
I stopped trying to define Unit Tests (I would define it as Feathers defined it) and now exclusively use the terms:
I/O-Based tests: has I/O in the test (accesses clock, database, etc.)
I/O-Free tests: no I/O access in the test (no current date/time, no random numbers, no file access, no network access, etc.)
I'll slip up and use "Unit" when I really mean I/O-Free (and "Integration" when I mean "I/O-Based"), but for the most part I've switched.
There's so much baggage and debate around "what's a unit?", when that isn't always the most important question. I've found it much easier to explain that when doing #TDD, we want to use I/O-Free tests as they'll be sufficiently fast to get feedback in less than a couple of seconds.
"I often jump into the TDD flow when I’m adding a new feature to a product or confirming the existence of a bug. If it’s not clear how I should approach the problem, the best way for me to start is with a test. Tests force me to break down the problem into steps to reach an initial solution, while refactoring gets me to a cleaner solution"
➥ Increment Magazine
I wrote a new parser for Markdown files (in order to run BDD tests off them), and the bugs I find because I didn't think of a specific way to write markdown keeps entertaining me. It's a good, humbling experience that you never can even assume your own ways to use any tool.
Funny how it fails on a blank line in a code block.
But with #TDD the fix is quick to roll out, and I know it wont break anything else.
Why do we look for forms of duplication (exact, similar, partial) when refactoring (especially during a #TDD cycle)?
It's so we can move the code from specific to general.
But that will only happen after you have several examples (tests) implemented. It's dangerous to prematurely generalize (YAGNI), but we want to generalize when we can.
Every journey I recorded for my Software Developer's Journey podcast was a delight to discover. In every story, I learned something useful for myself or my career. I had good laughs in every discussion, was moved by emotional stories, and experienced inspiring moments. But sometimes, one story resonates with me more than the others. This is one of those.
I knew of Emmanuel Gaillot through his work on the Agile Open France conference and the Coding Dojo in Paris. But I finally met him through the NewCrafts Conferences in 2023. I even enjoyed introducing a profound and moving session he facilitated at the conference this year, exploring "coding as a mindfulness practice."
On the show, Emmanuel placed the start of his journey in a computer club in the 80s. He described how he learned GW-BASIC and became hooked. He told about his love for music and how his parents encouraged him to pursue "real studies." He explained how he went to the USA to study Computer Science, music, and Japanese... and became a theater composer. He discussed his first job as a programmer and being bored (and bad at it) until he discovered #eXtremeProgramming. He talked about learning #TDD, exploring what became #CodeKata, and creating a #CodingDojo. He spoke about finding psychotherapy, becoming a psychotherapist, and much more. This was a wild ride worth every minute!
For the next prerelease build of xunit.runner.visualstudio, we are shipping the ability to pass all xUnit.net configuration items via RunSettings (both as an XML file as via dotnet test command line switches).
Idle thought: Indeed, #tdd isn't magic---it doesn't automatically lead to success as a programmer; it does, however, help make learning a core part of everyday practice, which leads more often to more kinds of success. It makes room for improvement in a profession where we're often told to improve on our own damn time.
Let's discuss your concerns & the various common misperceptions about #TDD; & how it helps #Scrum#SoftwareDevelopment teams rapidly deliver quality product iteratively & incrementally over the long term.
Nullables are a novel approach to testing that allow you to create fast, reliable tests without using mocks (or interfaces). They're a way of "turning off" production code so you can have sociable, state-based tests that don't talk to the outside world.
I'm hosting office hours on May 10th at 9am Pacific / 12pm Eastern / 18:00 CEST for anybody who'd like to discuss these ideas. Bring your code! Details and a calendar reminder are available here: https://www.jamesshore.com/v2/calendar/2023-05-10
I have to confess to some hubris. After evaluating the various Node.js testing frameworks, I've decided to write my own instead. In this 🧵, I'll explain why. Mostly so I can remember it for the future.