If developers are using postman to test the rest ws then the real controller is going to accept the request that further passes the request to Service and Data Layer. Then how is it called a unit test? Are developers responsible for performing such integration tests or it's job of the testers?
What I thought developer's job is, using MockMvc to create the HTTP calls and mock service classes within the test class itself and perform the unit testing of controllers.
I go by Michael Feathers' definition of what's NOT a unit test:
A test is NOT a unit test if:
1. It talks to a database
2. It communicates across a network
3. It touches the file system
4. You have to do special things to your environment (such as editing configuration files) to run it.
By this definition, using PostMan falls under #2 so any test where you have to use PostMan is not a unit test.
I wouldn't call it an integration test (since one side is just a test tool), more like a functional test. Whose responsibility it is to write such tests depends on the organization. Ideally it would be QA, but not all QA teams are equipped to do this.
Arun Singh Raaj wrote:Are developers responsible for performing such integration tests or it's job of the testers?
This is a false dichotomy, in my opinion.
Is it the architect's job to make sure the building doesn't fall down? Is it the carpenter's job? Is it the construction foreman's job? Is it the building inspector's job? I think that software quality is everyone's responsibility. You do what you can to make sure your work isn't going to contribute to the failure of the project, right?
As a developer, I'm always of the mindset of making sure that what I wrote works. If that means I have to unit test and do integration tests and perform whatever kind of other tests need to be done before I move on to the next task, then I do it. If some of the testing has to be in collaboration with other folks on the team like UX specialists or security specialists, then I will collaborate with them. If you don't know where your due diligence to ensure quality ends as a developer and someone else's starts, then don't you think it's more prudent to assume that you have responsibility right up to deploying your work to production? Or would you rather just do cursory testing (Well, it works on my machine...) and then relegate the responsibility of checking your work to others? Which is the more professional way of working?
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop