• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

Can you call it unit testing if developers are using postman to test REST ws?

 
Ranch Hand
Posts: 238
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Please shed some light on it.
Thanks in advance.
 
Sheriff
Posts: 13730
228
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is your definition of "Unit Test"?

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.
 
Saloon Keeper
Posts: 5776
146
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Junilu Lacar
Sheriff
Posts: 13730
228
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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?
 
and POOF! You're gone! But look, this tiny ad is still here:
Enterprise-grade Excel API for Java
https://products.aspose.com/cells/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!