Developers should fully test their own code and work with testers to produce a test plan and a regression test plan. The testers should use the test plans plus some additional random tests they think of.
I don't like the word "fully". I have previously worked as a dedicated software tester for 6 years in a large international company. That company had both time and money to divide tasks, so that a person don't end up with a conflict of interests. In smaller companies, one have to think a little smarter to achieve a similar goal.
My experience from that time, is that a developer should write code and do some "simple" test activities as code review and unit testing. All other test activities must be left to the dedicated testers.
As a functional tester, I had many long talks with developers when constructing, for example when I needed to construct sequence diagrams for my functional tests. At that time in the process, the developer was only a "consultant", he/she didn't own the test process.
If a company can't afford to have dedicated testers, one should at least avoid that the developer tests his own code.
There's not a data type big enough to count all the bugs and corrections in a project that was found by a fresh pair of eyes
I agree that there should be independent testing particularly at the functional and requirements level.
However, code is a work product and a developer should deliver a quality work product. A developer who takes ownership over what he delivers needs to be able to say, "My code functions as I intended".
A writer .e.g. might proof-read, spell check and grammar check their document prior to handing it over to someone else to proof-read it. No editor wants to receive a document that is full of typos.
I would also argue that regarding unit-test the developer is the best qualified to perform it. Once it becomes integrated or a system level test a dedicated tester will be the best choice.
I also believe in Test-Driven-Development and so when writing new code will often write the tests first and then the code.
The end result is that very few bugs are submitted against my code.
Our company also practices code-review. We are semi-agile.
I have worked on both sides - as a dedicated tester and as a developer. I have seen far better success in quality projects being released on time when developers do their own code verification coupled with independent validation as opposed to independent test alone.
Developers should always test their own code. That however should not be the only testing.
As a developer I test my implementation, I run the application, or whatever, and test the new stuff I have implemented. I walk through all the paths I have written in debug mode and confirm that what I expect to happen actually does.
When I am happy with it peers test it. When they are happy testers test it. When they are happy internal staff test it. Finally selected customers test it. If all of the above are happy we release it and wait for the complaints.
As my previous employers finally learned, a programmer cannot properly test his own code.
First, there's that hauntingly beautiful poem "It works on my machine".
Secondly, developers don't think like users (Praise Be !), and so won't do stupid things (at least, not as often).
That doesn't mean they shouldn't test it at all: it should work as expected, boundary conditions checked, and as much a defensive wall put up so that eventualities are either prevented or handled. Here, in particular, experience counts.
. . . but sooner or later, that stuff goes into the wild, and the heartless and mindless aboriginals will flay it. It's their nature.
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein
"As far as we know, our computer has never had an undetected error." - Weisert
"If you are searching for perfection in others, then you seek dissappointment. If you are searching for perfection in yourself, then you seek failure." - Balboos HaGadol Mar 2010
Developers should always fully test their code. The number of times I have had to ream people out for checking stuff in that may well compile but cannot possible ever have worked! Guess what they don't work for us anymore.
In addition ...
Fully documented and planned test plans should be in place and carried out by a dedicated testing team before release.