Im making a website and trying to learn Test Driven Development (TDD)
I'm doing one of CS50 projects, were we need to make a website to trade stocks. I decided to use this oportunity to learn TDD. I learned how to use the unittest module from python. But now, im taking way more time to write the tests than actually writting the code.
Since Flask has the debug mode, i dont need to close and open the application to test changes manually, so testing with it is a very fast process. But when im writting tests, i dont think on just what i want, i need to think how to make the test actually test what i want.
For example, i took 30 minutes to write the code to test if an component of the HTML was showing up in the website, because i had to write a Regex that matched it. Something that, by the eye, would have taken less than 30 seconds.
Perhaps in a more complex project it would pay off, but in this case i take less time checking every page of the website (30 sec to 1 minute) than to write a single test.
Im not doing unit tests tho (even if im using the unittest module). Im actually doing integration tests, because i dont know how to do unit testing with websites.
So it is worth it to do testing in this kind of code? Where the code is so simple that the whole development process would take less time than writting the testing code