Tagged Questions
1
vote
1answer
123 views
Unit-testing databases: test all possible permutations of read and write to table?
I am testing a resource management class that is interacting with a database or a file system, or a combination of both. I was wandering if it is the norm to test all possible permutations of read and ...
-1
votes
4answers
141 views
How to use unit testing? [duplicate]
How to use unit testing?
There are a lot of frameworks for different languages, which provide functionality of unit testing. There is a lot of information on how to use each of them technically. Just ...
2
votes
1answer
86 views
Testing MVC models when using SQL referential constraints
I have an MVC web app that's wired against PostgreSQL. The DB uses the full gamut of various referential constraints to ensure referential integrity, as opposed to say the Rails approach, where you ...
54
votes
11answers
5k views
Is it a bad practice to modify code strictly for testing purposes
I have a debate with a programmer colleague about whether it is a good or bad practice to modify a working piece of code only to make it testable (via unit tests for example).
My opinion is that it ...
8
votes
1answer
166 views
Should I refactor my unit tests when I extract a class out of the System Under Test?
I wrote this class that does a few things (perhaps this is a violation of the Single Responsibility Principle). I realize now that some other part of the project needs a piece of that logic and the ...
4
votes
2answers
100 views
Unit testing markup building logic
I'm currently writing a library of helper functions to produce some repetitive markup. I have a reference to the markup the functions should produce, but I'm curious about how I should go about unit ...
2
votes
2answers
200 views
Returning a mock object from a mock object
I'm trying to return an object when mocking a parser class. This is the test code using PHPUnit 3.7
//set up the result object that I want to be returned from the call to parse method
...
75
votes
12answers
6k views
How big does my project need to be for me to unit test it?
I assume that my project is decoupled enough to allow for unit testing. But how big, exactly, in terms of clases and functions does my project need to be to make unit testing worthwhile?
We all make ...
7
votes
4answers
482 views
Do some best practices depend on skill?
Is there evidence that some software development best practices depend on programming skill level? I mean, these methods are good, but maybe the way the are used or the extent might vary?
This ...
3
votes
5answers
4k views
How to unit test a jsp file?
I'm developing a Java 6 EE application and I'm testing my jsp code with another one with a testing version of the function calls and code used in the original one but it seems loose and impractical. ...
7
votes
3answers
436 views
Interfacing application code with unit tests
I am working on a project in which we have to implement and unit test
some new module.
I had a quite clear architecture in mind so I quickly wrote down the main
classes and methods and then we started ...
4
votes
1answer
435 views
How to unit test large legacy systems? [duplicate]
Possible Duplicate:
Best practices for retrofitting legacy code with automated tests
When working in large legacy systems (large systems with no unit testing ever) I often come across ...
4
votes
8answers
481 views
Testing loses its effectiveness if all programmers don't use them
Let's assume you are convinced that the extra time spent unit testing has merit and improves production. Does that still hold up when everyone working on the same code doesn't use them? This question ...
5
votes
3answers
403 views
How do you motivate your team colleagues to learn, use and apply best practices? [duplicate]
Possible Duplicate:
How do you motivate peers to become better developers?
How do you promote and how do you assure that in your new project best practices like unit testing, TDD, ...
6
votes
8answers
297 views
What benefit do I get from good methodology?
One of my friends has worked for nearly 10 years, asked me why he needs to learn new things such as unit-testing, MVC, Multi-tier architecture (he creates 3-tier application but designs like 2-tier), ...