This can be a big debate. Developers testing their own code – What will be the testing output? All happy endings! Yes, the person who develops the code generally sees only Happy Paths of the product and don't want to go into many details.
The main concern of Developer Testing is – the misunderstanding of requirements. If requirements are misunderstood by the developer then no matter at what depth the developer tests the application, he will never find the error. The first place where the bug gets introduced will remain till the end, a developer will see it as functionality.
Optimistic Developers – Yes, I wrote the code and I am confident it's working properly. No need to test this path, no need to test that path, as I know it's working properly. And right here developers skip the Bugs.
Developer vs Tester: Developer always wants to see his code working properly. So he will test it to check if it's working correctly. But you know why tester will test the application? To make it fail in any way, and tester surely will test how an application is not working correctly. This is the main difference in Developer Testing and Tester Testing.
Should Developers test their own work?
I personally don't mind developers testing their own code. After all, it's their baby ;-) They know their code very well. They know what are the traps in their codes.
Where it can fail, where to concentrate more, which is the important path of the application. The developer can do unit testing very well and can effectively identify boundary cases. [Image source]
This is all applicable to a developer who is a Good Tester! But most of the developers consider testing as a painful job, even they know the system well, due to their negligence they tend to skip many testing paths, as it's a very painful experience for them.
If developers find any errors in their code in Unit Testing then it's comparatively easier to fix, as the code is fresh to them, rather than getting the bug from testers after two-three days. But this only possible if the developer is interested in doing that much testing.
It's the Tester's responsibility to make sure each and every path is tested or not. Testers should ideally give importance to all small possible details to verify the application is not breaking anywhere.
Developers, please don't review your own code. Generally, you will overlook the issues in your code. So give it to others for review.
Everyone is having specialization in a particular subject. Developers generally think how to develop the application on the other hand testers think how the end-user is going to use the application.
So, in short, there is no problem if developers are doing basic Unit Testing and basic verification testing. Developers can test a few exceptional conditions they know are critical and should not be missed. But there are some great testers out there.
Through the build to test team. Don't waste your time as well. For the success of any project, there should be an independent testing team validating your applications. After all, it's our (testers) responsibility to make the ‘baby’ smarter!!
What did you say?