Our development cycle is usually very fast, such that often people are using tomorrow what I develop today. This is possible through an automated build script.
Now the problem:
It happens, that despite all the care, things break. And myself or the end users will notice it once the application update is published. Of course a testing framework (or mabe two, one for php and one for js) would be the solution. But this looks to me just as an unsurmountable barrier, because of these points:
- I never used a testing framework, and lack necessary knowledge
- A testing framework puts constraints on the way code is written (and I cannot judge for now, if my code fits any particular framework). I therefore fear that I had to refactor my code to be able to use a testing framework.
- I fear that writing the tests is likely to take more time than to write the code.
- Much of the code depends on the data present in different databases. How to make up mock data that can be used for testing.
Can someone give me advice on how to introduce a testing framework in a setting where proficiency and time are scarce ? I know this question is really broad, but I hope I will get nonetheless some precious advices.
It took me several months before I dared to dive into Unit testing, and it took me just one hour to get up und testing. It will take me some hours more to include this permanently into the build process.
I really feared too much !!
Unit testing is not more work (or just slightly more) than testing with
var_dump's. The advantage is that it is permanent. Once you change some code, and the test still works your done. There's no need any more to retest manually.