Linked Questions
10 questions linked to/from Time difference between developing with unit tests vs no tests
241 votes
9 answers
40k views
Is it normal to spend as much, if not more, time writing tests than actual code?
I find tests a lot trickier and harder to write than the actual code they are testing. It's not unusual for me to spend more time writing the test than the code it is testing. Is that normal or am I ...
145 votes
11 answers
58k views
Are (database) integration tests bad?
Some people maintain that integration tests are all kinds of bad and wrong - everything must be unit-tested, which means you have to mock dependencies; an option which, for various reasons, I'm not ...
14 votes
6 answers
8k views
Does Code Coverage improve code quality? [duplicate]
I am curious whether there are metrics on whether code coverage actually improves code quality? Any research studies? If so, at what percent does it become a case of diminishing returns? If not, why ...
13 votes
9 answers
10k views
How long should we generally spend writing unit tests for a new feature or bug fixing?
When I have to implement a new feature or fix a bug, I usually try to recreate the situation with a test. I sometime spend around 3 hours coming up with fixtures and writing the test. The actual ...
8 votes
7 answers
2k views
Should I write tests when I can prove code correctness?
People say that "talking about TDD hardly works, if you want to convince someone to TDD, show them results". However, I'm already getting great results without TDD. Showing me that people who use TDD ...
15 votes
4 answers
2k views
How to Quantify the Value of Unit Testing [duplicate]
Our organization is considering integrating unit testing into our software development workflow. I've heard lots of anecdotal stories about how it encourages better, easy to maintain, and well-planned ...
4 votes
4 answers
825 views
Reasonable test coverage requirements when dealing with a contractor?
We're outsourcing some work to an external developer, so I'm busy writing up a contract about what constitutes a deliverable. So far I require that the code is shipped with automated tests. But, ...
4 votes
5 answers
546 views
Should code reviewers reproduce the problem/solution as part of the code review?
Boss in upper management is demanding to know why code reviewers are attempting to reproduce the problem & solution (in the case of defects) and solution (in the case of features) for reasons of ...
1 vote
3 answers
4k views
TDD with layered architecture, while only unit testing domain logic
Our project have a lot of layers, Entities Repositories UnitOfWorks Domain Services (Business Logic) Validation Infrastructure Application Services etc.. We are only writing unit tests for ...
0 votes
6 answers
269 views
How can testability help in identifying and fixing bugs before they are integrated into the system?
Loose coupling promotes testability because it allows components to be tested in isolation without having to test the entire system. This can help to reduce the risk of introducing new bugs by making ...