• 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
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Web applications - Server vs Client Side Testing

 
Ranch Hand
Posts: 54
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a web application that I want to test(I know, I put TDD junkies to shame, I'm working on it). It has an AngularJS front end with a Struts2 backend. The AngularJs code communicates with the Struts2 code via REST calls. After mulling it over, I realized that whaterver happens in the backend doesn't matter as long as I recieve the proper data back from the REST calls on the frontend. Therefore, I realized that I could just use "Black Box" testing and only write the JS tests. What is your opinion of this decision?
 
Sheriff
Posts: 13517
223
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The expression "Putting somebody or something to shame" means to be so much better at something that it makes the other party ashamed of how poorly they do that same thing compared to you. It doesn't seem like that's what you meant though.

Test running on the front end should test only the front end. If you're checking that the front end actually makes proper REST calls then run JS tests. If the check is for proper display of returned data, run JS tests. If you're testing whether a REST call is properly parsed and processed, test on the backend.

In my opinion, JS testing should be far less than backend testing. If you do mostly JS testing even for things you shouldn't test with JS, then proper backend testing will put you to shame.
 
William Ng
Ranch Hand
Posts: 54
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now that I think about it and after reading your response, I believe back end testing is the way to go, with some basic JS testing. My theory was that testing JS would also test the back end and it probably would. But why not just test the backend directly. And like you seem to suggest, backend is probably more effective.

Regarding the use of "putting to shame". I did indeed use it incorrectly. Thanks for the correction. Should have tested my question?

Thanks for the response.
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Read as much as you can on the uses, advantages, and downsides of both methods and make the right choice.
And I agree with your method,stick to black-box testing and test only public methods.Whenever a public behavior is checked, the private implementation is also implicitly tested and your tests will break only if there is a certain problem.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!