Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
That sounds interesting ive yet t9 use unit tests or tests in general in my programm since im still a beginner. Would u mind givinf an example of how much easier it was and what ? :)
-
61601207y@Kubernatural basically i've implemented tests to cover all the use cases for a particular module, in order to ensure that my code works as expected.
then i've started refactoring that module (rewriting functions, splitting functionalities in different files, etc) and just by running the test i was sure that every change i've made wasn't breaking anything in my new module.
it's much faster, you don't need to check every time that your data is processed the right way or check what the code was doing before the refactor in order to ensure that the two modules (old and new) are doing the same thing. -
unmarked5517yI do TDD at work, so I'd challenge you when you refactor to change the tests first, watch them fail, and you get led right to the code changes :)
Related Rants
a little confession: i've rarely used test suites in my projects (due to laziness and lack of time).
i've started a new project and now i HAD to write tests in order to make my PM happy.
Then i had to refactor a lot of code.
IT WAS SO EASY WITH TESTS.
I WAS A FOOL.
STUPID PAST ME, STUPID!
rant
tdd
tests