Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I've been working for 2 months and a half in a project and it is practically finished. However I keep seeing some errors I fixed in the past that come back to annoy me. I then fix them again and another one bugs me.

I know, I know, I did a mistake not using phpunit and selenium at first, but is it viable or realistic to start using it at this moment (even if the project ends in 1 week and I still have some parts to finish)?

Thanks in advance

like image 772
Sergi Juanola Avatar asked Dec 06 '22 20:12

Sergi Juanola


1 Answers

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

You have the perfect opportunity to add unit testing - and show it's value - as you have bugs to fix. So write the test that shows the bug occurring, fix the bug and then re-run the test. You have a green light and the confidence that you'll immediately spot if the problem recurs.

You won't have complete coverage of your application, but if you keep adding tests as you find and fix bugs and then add tests for new developments the coverage will increase.

like image 128
ChrisF Avatar answered Dec 09 '22 10:12

ChrisF