Skip to main content

All Questions

Tagged with
3 votes
3 answers
365 views

Why are test frameworks like JUnit or TestNG not more "object-oriented"?

By "more object-oriented", I mean, it appears to me testing frameworks like TestNG and JUnit could encourage testers to write implementations of Test and TestSuite interfaces. The current approach ...
Benjamin Berman's user avatar
-1 votes
1 answer
402 views

Given an implementation of a Service Layer and Repository layer, should you make tests of both?

Currently I have an entity called Product with the respective ProductRepository and ProductService. For ProductService, I have tests for: Read (Covering Create too) Update Delete Besides achieving ...
0xFED5550's user avatar
  • 107
15 votes
5 answers
71k views

Unit testing a void method

In order to fix a bug in an application, I modified a method named postLogin by adding a call to an existing method named getShoppingCart. Code protected void postLogin() { getShoppingCart(); } ...
A_B's user avatar
  • 409
4 votes
2 answers
3k views

Testing strategy for wrapper class

In my Android project I decided to create wrapper around SharedPreferences(which is basically key-value storage) with following interface interface Preferences{ public void saveInt(int value, ...
CheesyGnocchi's user avatar
20 votes
7 answers
29k views

Should each method have a separate JUnit test class?

I am writing JUnit unit tests for my classes. Is it better to have a separate class for each method, or have just one test class for every actual class?
viraj's user avatar
  • 501
0 votes
2 answers
3k views

Where Are Multiple JUnit Test Methods Typically Placed in Code?

I've just read the Vogella JUnit tutorial and found it very helpful in understanding how to use JUnit. However, I'm a bit confused about what the convention is for placing multiple test methods in ...
Thunderforge's user avatar
  • 2,798
7 votes
3 answers
28k views

How to test Java web applications

So far I haven't been testing or learning how to test my java web applications. If you do, what are the tools you need, and is it really necessary to test a web application if doesn't need scaling or ...
OnlineAlien's user avatar