DEV Community

Discussion on: What made you interested in learning how to write tests or how to TDD?

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt • Edited

In a complex enough library, testing with edge cases is just inevitable, and has to be done every time you change the library code. Sometimes there are collaborators, and sometimes you just forgot how it works. This is just needed if you maintain the code long enough.

As you might forgot to test before publish or commit, automated testing, as well as Git hooks and CI are needed.

As UI / JavaScript is getting more complex. This is inevitable for the frontend too.

Pure functions (purely functional programming) and dependency inversions are also moving in this direction, testing for cases you cannot guess they will occur, in production; where you have to be responsible for everything, even wild cases.

I might not go as far as religiously test from day one with null hypothesis; but I don't really think it is that bad either.