Is it realistic to start using unit testing when you're almost done?

I have been working for 2 months and a half in the project, and it is almost complete. However, I continue to see some errors that I corrected in the past that come back to annoy me. Then I correct them, and the other bothers me.

I know, I know that I was mistaken at first not using phpunit and selenium, but is it viable or realistic to use it at this moment (even if the project ends in 1 week, and I still have some parts for finishing)?

Thank you in advance

+4
source share
3 answers

Testing always adds time to your development time if you don't have a team to do this. In my experience, a project is never completed. Even when you passed it. The user always finds interesting ways to use your product.

I would suggest that it is always good to have unit testing in a project. This gives a good start to any new developer who needs to earn money with the project in a few months, including himself.

I highly recommend you add testing if you can. However, in the long run, this will make life easier, if you plan to deliver the project and not touch it again or that you will not work on it in the near future, you can leave it. Depends on the benefits you are looking for. Unit testing is almost always good for long-term projects and support contracts.

+3
source

It's never too late to write some unit tests.

You have a great opportunity to add unit testing - and show its meaning - as you have the fixes. So write a test showing the error, correct the error, and then repeat the test. You have a green light and confidence that you will immediately notice if the problem recurs.

You will not have full coverage of your application, but if you continue to add tests as you discover and fix bugs, and then add tests for new developments, coverage will increase.

+10
source

Better late than never. Nevertheless, I saw that a significant proportion of projects go live, both with testing coverage and without it (a solid unit of measurement), and I can’t say that well-tested ones showed a lower rate of defects in the wild. They simply tend to break in somewhat more unexpected ways.

But if you have recurring errors that continue to occur, adding a quick test for them can save you quite a lot of time, since you will immediately find out when the problem arose, instead of remembering to manually search each (or, even worse) , plays them and misses the cracks). When testing coverage is completely absent, you can win big by adding a few simple tests for the most chronic problems in terms of time spent versus common sense.

+2
source

All Articles