7
votes
3answers
513 views

Unit testing time-bound code

I'm currently working on an application that does a lot of time-bound operations. That is, based on long now = System.currentTimeMillis();, and combined with an scheduler, it will calculate periods of ...
16
votes
6answers
2k views

how much time do you spend on Unit testing?

In a company I used to work for, executives insisted that the code coverage with unit tests must be 99% or more. This resulted in writing more tests than code. It took us literally 3 days to write ...
4
votes
4answers
258 views

How do you automatically test a time check?

Say you have a property startTime. Then you have a method doSomething: doSomething() { //...stuff startTime = System.currentTimeMillis(); //... more stuff } How do you test that startTime ...