Test driven development – Who should write the tests

development-processtdd

Originally, it is the duty of the developer to write the test, but I noticed that in many cases/e-mature developers those cases are not giving even 80% coverage.
How about I have a QA person dedicated to write ALL the tests for a given project instead of the developer?
Are there any cons to that?

Best Answer

In Test-Driven Development, the tests must be written by the developer. Otherwise someone other than the developer is driving the development.

So as soon as you give the job of writing tests to a non-developer, that person becomes a developer.

My experience in TDD is that writing the test code is often as hard or harder than writing the production code. So if you have resources capable of writing good unit test / integration test code, they ought to be writing the production code that makes those tests pass.

Related Topic