Does anyone come across a pre-commit SVN hook that works with the following logic?
If "MyClass.java" has been modified and committed, then a change should also be made to "MyClassTest.java" by naming convention.
The goal here is to make sure that the developer made changes to the corresponding unit test when he / she changed the piece of code.
I know this can be fooled by simply changing a bit of formatting. But the goal is not to stop cheating. It is very important to encourage test-based development in a team that is moving towards it.
The bonus would be, because when the change is just a refactor, for the hook to ignore checking if the comment has the word "REFATOR" in the comment. (after all, pure refactors must always be done by themselves)
source
share