2 ms·
I find I can do ITDD effectively with integration test times of < 30 seconds. I've even done it with tests of up to 5 minutes. What makes it work is pairing it
by pydry 5y ago
I find I can do ITDD effectively with integration test times of < 30 seconds. I've even done it with tests of up to 5 minutes.
What makes it work is pairing it with a REPL. That way I can have an "outer" loop that triggers the REPL and then an "inner" loop where I can experiment in the area where I'm writing the code and get feedback quickly.
I might run the outer loop just a few times:
* At the beginning of the ticket
* When I messed up the state with the REPL and when I want a fresh slate.
* When I've pasted code I think will hypothetically make the test pass from the REPL and I want final verification.
* One or two more times after that coz I missed something stupid.
Often the waiting times are a good time to get up and go for a walk/make a coffee/check my messages.
>I'm experimenting with sociable test
What's this? I'm unfamiliar with the term.
- EdSharkey 5y agoI don't have easy REPL opportunities for speeding up my cycles in the language/environment I have to work with. :/ Martin Fowler discussed it recently, note the section that discusses about sociable vs solitary tests: https://martinfowler.com/articles/2021-test-shapes.html https://martinfowler.com/articles/2021-test-shapes.html My team is oriented towards solitary. For unit tests, mocks stand-in for collaborators with the system under test. For integration tests, databases and queues are realistically simulated with locally running instances and downstream services we call are wiremocked with local configs pointing service clients to those mocks. It's an incredibly effective way to produce reliable, fully tested code. It's also incredibly costly execution time-wise. James Shore has a nice take on sociable tests; I interpret what he's produced is like a mishmash of unit and integration tests. I have trouble making my brain work that way, but I am intrigued given his impressively low test run times. There is something special there, I feel it just needs a sexy paint job for people to take notice. https://www.youtube.com/watch?v=jwbKSiqG0DI https://www.youtube.com/watch?v=jwbKSiqG0DI I liked this blog post on the topic as well: https://merge-conflict.com/post/sociable-unit-testing/ https://merge-conflict.com/post/sociable-unit-testing/