I am the only person on my team that use TDD. How do I make them to use it?I am annoyed that when I pull, someone's code will break my tests and I am the one who has to fix them.Will using github, fork and pull request solve this problem, so that they need to pass the test before the pull is accepted?I am not the project manager and I can't seems to convince her to use it.
How to convince teammates to use TDD
tdd;ruby on rails;communication
The way I see it, the only way to convince for anything about tests is to demonstrate that they are useful - ie that test failures help to find and fix bugs.The way you describe the problem though, looks like this is not the case here. Look......when I pull, someone's code will break my tests and I am the one who has to fix them.If I understand correctly, you mean you have to modify tests. Well, that does not sound like test failures help to find and fix bugs does it? If tests don't help in finding bugs, it's pretty weak position to start convincing your colleagues - what could they expect to gain? tedious fixes in fragile test code?This may sound like a dead end, but it really isn't. Your final goal (convince for TDD) still makes pretty good sense, don't drop it. Just re-focus your efforts on removing the obstacle you discovered.Test failures that bother you now are essentially false alerts - meaning these are bugs in tests not in the code. Use these as an opportunity to improve tests, to learn how to make good reliable test design. Work on tests to make false alerts less frequent and to make it easier to discover real bugs in tested code.As you discover real bugs, let your colleagues know and help them fix - and don't forget to point that these bugs are found by your tests. That will make a really solid ground to convince your colleagues.It is worth mentioning that test design skills you develop at preliminary stage will most probably be needed again, if (when:) you finally convince your teammates to use TDD. Think of it......What would happen when test driven development is introduced to your inexperienced colleagues?First thing to expect is that guys will start writing crappy tests and (horror!) even breaking good ones while learning. To help them find a way to do it right you'll need quite a solid understanding of good test design.All the errors you find and fix in your tests now, will be repeated again and again by all your teammates when they begin learning. If (when!) that happens, you would better be prepared to quickly and clearly explain how to improve if you want them to remain positive about TDD.