From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Unit Testing Group

cancel
Showing results for 
Search instead for 
Did you mean: 

Test Evaluation - What types do you often use?

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.

0 Kudos
Message 11 of 20
(3,344 Views)

NZ is awesome. Believe the tourism. You should all come and live here!

0 Kudos
Message 12 of 20
(3,344 Views)

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.





Copyright © 2004-2023 Christopher G. Relf. Some Rights Reserved. This posting is licensed under a Creative Commons Attribution 2.5 License.
Message 13 of 20
(3,344 Views)

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.

0 Kudos
Message 14 of 20
(3,344 Views)

tyk007 wrote:

NZ is awesome. Believe the tourism. You should all come and live here!

New-Zealand-Rocks500.jpg

0 Kudos
Message 15 of 20
(3,344 Views)

justin.goeres wrote:

tyk007 wrote:

NZ is awesome. Believe the tourism. You should all come and live here!

http://i6.minus.com/i3jsx5Whee8YM.jpg





Copyright © 2004-2023 Christopher G. Relf. Some Rights Reserved. This posting is licensed under a Creative Commons Attribution 2.5 License.
0 Kudos
Message 16 of 20
(3,344 Views)

Sorry for the thread hijack tyk007!





Copyright © 2004-2023 Christopher G. Relf. Some Rights Reserved. This posting is licensed under a Creative Commons Attribution 2.5 License.
0 Kudos
Message 17 of 20
(3,344 Views)

No worries. Loving it!

Message 18 of 20
(3,344 Views)

Sweet as

I have the desperate feeling, I need to return to Aotearoa real soon

Message 19 of 20
(3,344 Views)

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

Message 20 of 20
(3,344 Views)