0
votes
3answers
77 views

Should each method have a seperate 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?
4
votes
3answers
185 views

What is the best use case for selenium?

I've been trying to develop web applications while at the same time creating the testing. I understand unit testing, I can declare a test method and test specific methods in my application. But I ...
2
votes
1answer
102 views

Separate Action from Assertion in Unit Tests

Setup Many years ago I took to a style of unit testing that I have come to like a lot. In short, it uses a base class to separate out the Arrangement, Action and Assertion of the test into separate ...
2
votes
3answers
235 views

how and should I 'unit test' an entire package?

I'm still learning to be good about doing unit level testing, as I've always been a little sloppy about only doing functional testing in the past, so I want to double check I'm doing this 'right'. I ...
0
votes
0answers
34 views

Best practices for introducing testing to a large, stable, legacy Java application? [duplicate]

I'm working with a stable, but large legacy java application that is over 12 years old, maybe older. Although the code has been upgraded to java 6, it's lacks the features above java 1.4 for the most ...
2
votes
1answer
189 views

Is it worth the time to run static analysis tools (e.g. Findbugs) on test classes? [closed]

How likely is it for a bug that can be discovered by a static analysis tool (namely Findbugs) in test classes mask a real bug in the actual code? Is this a realistic scenario? Is it really worth the ...
3
votes
3answers
417 views

Effective way to estimate dead code removal?

I've been working in an application with about 100k LOCs and basically We have been reworking features to comply with a new architecture based on a new technology stack. This work is almost finished ...
1
vote
3answers
452 views

Unit Testing Wrapper (Facade?) Method

I have to write unit tests for some classes my group is developing. The classes are fairly simple, and I'm not sure how to best test them. public class MyObjectRegistry { private ...
5
votes
3answers
3k views

How to test the data access layer?

I have a DAO method that utilizes Spring for JDBC access. It calculates a seller's success rate of selling an item. Here is the code: public BigDecimal getSellingSuccessRate(long seller_id) { ...
2
votes
2answers
139 views

Where should tests' log files go?

My application has a rather non-trivial, yet standard, log configuration. It includes a console appender and a rolling size-based file appender. When I'm running the tests, thru the IDE or with ...
0
votes
1answer
77 views

Test Doubles : Do they go in “source packages” or “test packages”?

I've got a couple of data access objects (DefaultPersonServices.class, DefaultAddressServices.class) which is responsible for various CRUD operations in a database. A few different classes use these ...
2
votes
3answers
206 views

How do I limit the resources available to a program?

I'm delving into multi-threaded programming with Java, but I'm finding it hard to test my program for bugs. My computer simply has too many resources and cores, making it hard to see how my program ...
3
votes
2answers
344 views

What are the different meanings of 'fixture'?

I have some difficulty understanding the concept of "fixture". I know what a test suite is, a test case, a test run, but what exactly is a "fixture"? A parameterized test case? It seems to me that ...
3
votes
2answers
824 views

Testing Java as Groovy

We're looking into improving our testing process for some of our applications, and the idea that's been put forward it to write unit tests in Groovy and automatically run them with Maven. The first ...
-2
votes
2answers
461 views

How can I test database access methods in Java? [closed]

I want to write a test for a method that accesses a database such as following. public class MyClass{ public String getAddress(Int id){ String query = "Select * from Address where ...
18
votes
4answers
4k views

What is the correct way to handle debug output in Java?

As my current Java projects grow bigger and bigger, I feel a likewise growing need to insert debug output in several points of my code. To enable or disable this feature appropriately, depending on ...
7
votes
3answers
506 views

How do I hire testers by giving them a buggy app for testing their efficiency?

My boss wants to recruit testers based on their testing efficiency (number of bugs identified). So, he's shortlisted 5 people and I need to give them an app full of bugs and see how they fare in ...
9
votes
11answers
8k views

Why is using System.out.println() so bad? [closed]

Of course, it is very good use to use a logging framework for the error messages or warnings. But sometimes I use System.out.println() if I want to try something new in a short time. Is it really so ...
1
vote
2answers
302 views

Recognizing text fields according to their label value

I have an application who has text fields (not select, not checkbox or other types) where an user can enter some value, like this: ISBN and E-Mail are the label of each input. Now I have to ...
4
votes
3answers
301 views

When module calling gets ugly

Has this ever happened to you? You've got a suite of well designed, single-responsibility modules, covered by unit tests. In any higher-level function you code, you are (95% of the code) simply ...
41
votes
6answers
5k views

How to deal with static utility classes when designing for testability

We are trying to design our system to be testable and in most parts developed using TDD. Currently we are trying to solve the following problem: In various places it is necessary for us to use static ...
36
votes
14answers
2k views

If you had two projects with the same specification and only one was developed using TDD how could you tell?

I was asked this question in an interview and it has been bugging me ever since. You have two projects, both with the same specification but only one of these projects was developed using Test ...
4
votes
2answers
183 views

Need to test .properties one by one in every possibility?

For example, there are some key-value configuration in .properties file. Such like someFeatureEnable=true. It must be bool type value which will be parsed by framework, in my case it's typical Java ...
7
votes
3answers
2k views

How could I make automatic tests for GUI?

How can I check automatically what is seen and what not? Or at least, how can I organize some partly automatic tests? IDE: Eclipse (could use also IntelliJ Idea if necessary) Testing tool: Junit ...
3
votes
3answers
639 views

On the effectiveness of unit testing

EDIT: I think that no one really understood the question. I think that this is partly my fault as well, so I hop it gets better now. The thing is, I am perfectly aware of the existence of mocking ...
9
votes
5answers
2k views

Test-driven development and improving white box testing skills

I am an entry level Java Programmer straight out of school. I have good knowledge and experience with J2SE. Can anyone advise me on how to improve or tune my skills towards being a Java white box ...
2
votes
3answers
387 views

Testing web applications written in java

How do you test the web applications (both server side and client side code)? The testing method has to work irrespective of the framework used (struts, spring web mvc) etc. I am using Java for the ...
0
votes
1answer
128 views

Testing activities carried out in an OO development project

Does anyone know the testing activities carried out in an Object-Oriented development project that uses an incremental approach to development and delivery?
9
votes
2answers
1k views

design pattern for unit testing? [duplicate]

I am beginner in developing test cases, and want to follow good patterns for developing test cases rather than following some person or company's specific ideas. Some people don't make test cases and ...
5
votes
3answers
340 views

Should a unit/integration test that may result in an infinite loop have a clear assertion?

Unit: A multithreaded unit reads data of a queue and processes it, sending it off to another queue. When the last item is processed (null value found) the process stops. Test: Place a set of known ...
5
votes
1answer
1k views

Have you tried Chronon the Java “Time Travelling Debugger” — if so, is it worth trying and why? [closed]

First heard about it from Google Tech Talks, back 2009 when it was called Silver Bullet: http://www.youtube.com/watch?v=LpfmKIxusZY It's now called, Chronon... http://chrononsystems.com/ "Sounds" ...