01-07-2015 01:01 PM
You bring up a good point of timestamps and testing code that relies on timing. We moved to a TimeProvider class for time management where we needed the testability. The class either uses the built in LabVIEW primitives (the Default stategy) or a defined result (the Mock strategy). Our production code would rely on the TimeProvider object passed to it for all timing-related functionality and then we could control the exact time in our unit tests.
We had a case where needed to implement real-time clock calibration to an external device and there was a great deal of timing related code. Previously we needed a physical setup and, due to limitations in the setup, we often had "false" fails. Using the mock helped us test the timing code without worrying about actually having the external device or the correct setup conditions. The new style was more complicated but we were able to isolate a rare bug that could have occurred.
01-07-2015 01:03 PM
NZ is awesome. Believe the tourism. You should all come and live here!
01-07-2015 01:04 PM
tyk007 wrote:
NZ is awesome. Believe the tourism. You should all come and live here!
Actually, it is - I've spent time working and playing in NZ before, and it's an amazingly beautiful place.
01-07-2015 01:14 PM
I was thinking about your comment too regarding comparison of floating point when it is part of a cluster. Looking at some of my test code I have had to do the same. This is certainly an area where the way the UTF manages the comparisons makes things easier - you can deal with the cluster directly.
01-07-2015 01:19 PM
tyk007 wrote:
NZ is awesome. Believe the tourism. You should all come and live here!
01-07-2015 01:23 PM
justin.goeres wrote:
tyk007 wrote:
NZ is awesome. Believe the tourism. You should all come and live here!
01-07-2015 01:24 PM
Sorry for the thread hijack tyk007!
01-07-2015 01:25 PM
No worries. Loving it!
01-08-2015 06:41 AM
Sweet as
I have the desperate feeling, I need to return to Aotearoa real soon
04-17-2015 04:16 AM
Hi tyk007,
Just to catch up with you on this, we had the CLA Summit in Rome this week where I presented about Assertions. I'm putting the presentation up on the CLA forum but have also attached it here as I don't think you can get onto the CLA pages.
I'm still working on updating and finishing the code, but am going to upload the latest version of it today together with some quick videos on how it works to Github - the link is in the presentation slides. There are a few differences between the video and what I now have (such as the UI doesn't automatically pop up anymore, there is a Launch Viewer function in the Advanced API Functions section - I'm thinking of getting rid of the UI as I no longer think it will be used).
Anyway, let me know if you have any questions about the code - as I said, it's full of holes and probably some bugs at the moment, but will hopefully be useful and will get better.
Cheers,
Pete H
NIUK