Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Question regarding Tests  RSS feed

 
Mark Weinberg
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which of the following statements are true about tests? (multiple answers)
a. Tests can call another test
b. The order of tests occurring within a test case is guaranteed
c. If a previous test sets up data, that test can be used inside of other tests relying on the previous data
d. Changes made by a test method will modify the other methods also in the same test
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37180
515
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This sounds like a quiz. How about you say what you think and why and we'll tell you if you are correct.
 
Mark Weinberg
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the answers are a, c and d but I'm not sure. The exception being b because I don't think the order of tests is guaranteed at all.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37180
515
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree with you on A and D being correct. And with B being incorrect. Even if the order of test happens to be the same every time, this isn't guaranteed.

For C, I'm not sure if I am reading it right. To me, it sounds like it saying to rely on state set up earlier but also to call the test again to ensure it is set up. Which seems to conflict with itself.
 
Mark Weinberg
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Jeanne for helping me out. I greatly appreciate it.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!