Tagged Questions
36
votes
6answers
2k 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 ...
33
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 ...
13
votes
4answers
664 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 ...
12
votes
2answers
432 views
What are some good books/resources/ways to learn TDD? [closed]
As a grad student, I haven't really written anything to test my code. Usually what we do is just run the code on some test input and if the output result looks okay or as we expected then we just ...
8
votes
11answers
3k 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 ...
8
votes
5answers
1k 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 ...
8
votes
2answers
754 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 ...
7
votes
3answers
381 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 ...
7
votes
3answers
1k 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 ...
6
votes
1answer
776 views
Have you tried Chronon the Java “Time Travelling Debugger” — if so, is it worth trying and why?
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" ...
5
votes
3answers
277 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
3answers
268 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 ...
4
votes
2answers
118 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 ...
4
votes
3answers
270 views
Is there a tool to test Java UI?
Is there a tool to configure in a way that it locates buttons, clicks them, detects windows, reads text labels, determines if UI elements are checked/selected etc for Java? The tool need not be ...
3
votes
3answers
441 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 ...
2
votes
3answers
227 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 ...
2
votes
2answers
172 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 ...
1
vote
2answers
196 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 ...
0
votes
1answer
117 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?
-2
votes
2answers
188 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 ...