[TYPO3-core] Add more unit tests to patches

Christian Kuhn lolli at schwarzbu.ch
Wed May 16 20:35:39 CEST 2012


Hey there.


We recently had again some serious regressions in our stable releases.

We talked about that during the latest team meeting and came to the 
conclusion that - next to other things - unit testing can be a tool that 
helps us avoiding regressions.

It would be great if we could add tests to patches, especially if:
- They are bugfixes and targeted to be backported to stable branches
- The code itself is unit testable at all (there are situations in the 
core where it is hardly possible without bigger refactorings)
- The code that is changed proofed to be fragile
- The patch fixes a regression

In some areas of the core I'd go so far to say that unit tests are 
mandatory. This is especially true for those central static classes like 
t3lib_div. For me, I'll not merge a patch in t3lib_div & friends that 
doesn't come with a test (if possible).

I just went through some patches and found several of them to be easily 
unit testable. I voted them down and asked for tests now.

 From my experience I can say that writing unit tests often improves the 
code quality, makes code more easy to maintain and avoids bugs when 
writing and refactoring things.

At the moment, we have already plenty of tests in the core and they can 
be used as examples on how to solve own problems. There are examples for 
nifty mocking, for callbacks, for accessible proxies and so on. We also 
have some guys with a high addiction to tests, so please ask if you are 
unsure on how to solve things.


Regards
Christian


[1] 
http://forge.typo3.org/projects/typo3v60/wiki/2nd_Release_Team_Meeting_TYPO3_60


More information about the TYPO3-team-core mailing list