Re:Async Git-stash workflow enables test test-driven develop...
by onion2k on Tuesday July 16, 2024 @03:18AM
(#40974278)
In TDD, at least as I learned it, you're supposed to write a test, write enough code to get it to pass, then write the next test, and so on. That doesn't require stashes between steps. The only reason the stashes are 'necessary' here is because the author is adding all their tests up front.
Re:Async Git-stash workflow enables test test-driven develop...
by jdlshore on Tuesday July 16, 2024 @03:31AM
(#40974331)
Not exactly. The author’s example is a bit cutesy, which makes it a bit difficult to tell what’s going on.
What’s happening here is the author is doing outside-in development, but doesn’t want to use mocks or spies to test dependencies that don’t exist. So, when they discover the need for a dependency—which might not be immediately obvious—they stash their work so they’re not bothered by a failing test and half-done code while they implement the dependency.
It’s a technique I use pretty often myself, though not quite as heavily nested as here, and only when I’m genuinely surprised by the need to implement something else before I can make my current test pass.
Re:Async Git-stash workflow enables test test-driven develop...
by globalmatador on Tuesday July 16, 2024 @04:58AM
(#40974726)
I like the idea but I'm afraid that this stack of stashes can result in some merge work when doing refactors in one step. I prefer have all the code in my branch the whole time and just stub implementations and set unfinished tests to disabled.
Re:Async Git-stash workflow enables test test-driven develop...
by kkjkj on Friday July 19, 2024 @08:35AM
(#41005817)
The async git-stash workflow for test-driven development sounds intriguing! By stashing changes asynchronously, you can explore dependencies and features without getting tangled in half-baked implementations. It's like having a safety net while diving into complex systems. This approach could really streamline iterative development and improve code quality. Anyone tried this in a large-scale project yet? Curious to hear about any challenges or successes!
Re:Async Git-stash workflow enables test test-driven develop...
by ksoajl on Friday July 19, 2024 @09:52AM
(#41006608)
This async git-stash workflow for TDD is pretty slick! It's like building a Jenga tower where each stash is a crucial piece. The dependencies management reminds me of solving a puzzle, step by step. Curious if anyone else has tried a similar approach? What other tools or tricks do you use to streamline TDD with complex dependencies?
What’s happening here is the author is doing outside-in development, but doesn’t want to use mocks or spies to test dependencies that don’t exist. So, when they discover the need for a dependency—which might not be immediately obvious—they stash their work so they’re not bothered by a failing test and half-done code while they implement the dependency.
It’s a technique I use pretty often myself, though not quite as heavily nested as here, and only when I’m genuinely surprised by the need to implement something else before I can make my current test pass.