4
votes
2answers
436 views

Unit testing of non-atomic methods [duplicate]

I'm new in unit testing. For last two days I'm thinking how to test non-atomic methods with unit tests. When i need to write tests for some simple, atomic method situation in pretty easy - i'm taking ...
1
vote
2answers
121 views

Testing Framework Selection: xUnit family theory

Background: I am familiar with xUnit family frameworks and have had experience with (shunit2, PhpUnit and simpletest). I am currently trying to find a testing framework for C++. I did a quick search ...
1
vote
1answer
199 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
163 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
112 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 ...
57
votes
11answers
6k 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
2answers
247 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
112 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
212 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 ...
78
votes
12answers
6k views

How big does my project need to be for me to unit test it? [closed]

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
513 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
7k 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
550 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
569 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
488 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 ...
6
votes
8answers
325 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), ...
1
vote
1answer
230 views

Unit test storage on Android apps

I've been experimenting recently with Android applications. I've developed the convention (which I've seen used elsewhere) of placing my unit tests in a parallel source folder within an Eclipse ...
10
votes
3answers
193 views

Unit tests, write them before or after the framework?

This is my first question here, so i'll make it short and to the point. When Writing unit tests, should you write them before or after you have made the underlying framework for them? This came up in ...
28
votes
5answers
2k views

Test driven development - convince me! [closed]

I know some people are massive proponents of test driven development. I have used unit tests in the past, but only to test operations that can be tested easily or which I believe will quite possibly ...