What is Test Driven Development (TDD)?
TDD is a software development approach in which a test is written before writing the code. Once t...
For further actions, you may consider blocking this person and/or reporting abuse
There are some interesting thoughts here.
I think immediately "breaking" rule 1 is sometimes necessary. For example, if I am writing unit tests in Java, most of the time I'll need to create some POJO / model classes to be able to write and compile the unit tests in the first place.
Also, I think you should be careful with this approach to TDD. While what you did made sense, because there is a connection to a database, this becomes more integration testing as opposed to unit testing. Mocks come into play here so that integrations can be mocked and therefore unit tests stay de-coupled.
Greatly appreciate the tip regarding mocking my connection to the database, I'll have to look more into it.
I recently wrote about a tdd workflow that goes beyond simple exercises. You might be interested georgemauer.net/2019/12/02/tdd-wit...
You broke it down very well, thank you for sharing the article :)
Thank you for the link :), I'll have to read it.
Just curious, what testing framework are you using?
For a suggestion, I recommend Jest. It's maintained by Facebook.
I'm using Mocha + Chai on the backend and Enzyme on the frontend. I've been thinking of using Jest on the frontend. I'll be refactoring my frontend as well so I will be giving Jest a try.
I've tried Mocha + Chai too.
What I like about Jest is it's simplicity of use... no setup or configs required...
I'll have to look into it a bit closer, thank you for the suggestion :)
Great article, thanks for sharing! I've been doing TDD for many years and I shared some useful tips in this article: dev.to/ngarbezza/6-tips-for-a-powe...
Thank you for sharing that with me, I'll have to read it :)
Loved those 6 tips, thank you :).