▲ | troupo 6 days ago | ||||||||||||||||
Unit tests test units in isolation. Integration tests test that your system works. Testing how a system works covers the absolute vast majority of functionality you'd test with unit tests because you will hit the same code paths, and test the same behaviours you'd do with unit tests, and not in isolation. This is a joke, but it's not: https://i.sstatic.net/yHGn1.gif | |||||||||||||||||
▲ | yakshaving_jgt 6 days ago | parent [-] | ||||||||||||||||
I have been doing TDD for over a decade, and I don’t know why you’re trying to explain the basics to me. Yes, you can exercise the same code paths with integrated tests as you might with unit tests. There are multiple approaches to driving integrated tests, from the relatively inexpensive approach of emulating a HTTP env, to something more expensive and brittle like Selenium. You could also just test everything with manual QA. Literally pay some humans to click through your application following a defined path and asserting outcomes. Every time you make a change. Obviously all of these have different costs. And obviously, testing a pure function with unit tests (whether example based or property based) is going to be cheaper than testing the behaviour of that same function while incidentally testing how it integrates with its collaborators. | |||||||||||||||||
|