[time-nuts] Unit tests for time calculations

Doug Calvert dfc-list at douglasfcalvert.net
Wed Jun 12 20:14:24 UTC 2013


On Sun, Jun 9, 2013 at 11:29 PM, Bill Hawkins <bill at iaxs.net> wrote:

> Hi, Thanks in advance.
>
> Since this is a list for precise things, could you make your questions
> more precise?
>
>   What sort of test cases?
>
>   What sort of calculations?  Do you mean conversions?
>
>   What do you mean by "catching" an error - where would you catch it?
>
>   What do T1 and T2 have to do with it?
>
>   What do you mean by timescale? Is a timescale a neighborhood?
>
> The work involved in clarifying those questions may make the answers
> clear to you.
>
> Best regards,


Are you familiar with the concept of a unit test?

I can clariy those questions but I am not sure how that is going to make
the answer clear to me. I am writing some software that reads input
from users and a number of disparate systems and I have no control over
the incoming time formats.  I would like to make sure that my time
calculatoins/conversions work and continue to work after i make changes
during development.


T1 and T2 are example time date strings.

Calculations:

T1(UTC) - T2(EST) = Time delta in seconds

12/31/1998 00:00:00 EST + 5184001 seconds = Time Date in UTC


Conversions:

01/01/1991 11:01 AM EST = XX/XX/XXXX XX:XX UTC



As far as "what do you mean by catching an error - where would you catch
it" I cant tell if you are being snide. By catching an error I mean
identifying that the calculation my program made was incorrect. Maybe
you are unfamiliar with unit tests? What was unclear about what catch
errors? What else came to mind when you read the sentence.


Has anyone ever used "time scale" to describe a neighborhood?



More information about the Time-nuts_lists.febo.com mailing list