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.

LabVIEW Development Best Practices Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Unit Test Framework Toolkit Users: We want your feedback!

I really hope so too!

I'd be interested to see if unit testing is still fashionable - both JKI's VI Tester and this seem to have been developed around 2009, and I see many things that cause both tools to crash frequently, as well as not much talk in the forums.

One question I have to anyone out there who is listening is - with the UTF, how can I check that an error is thrown without requiring the string message to be exactly the same. For example, if I include the call chain, it will be different sometimes, or if I package additional information such as a timestamp into the error ring. But I do know that I want to see a certain error code, or even just see that some exception is thrown. As far as I can see, all elements of a cluster have to be equal (I can't check individual element boxes...)

0 Kudos
Message 51 of 57
(1,292 Views)

This can be achieved very easily:

on the output section of your test case, choose "by element" for comparison type and uncheck the elements you want to ignore

Error.png

Message 52 of 57
(1,292 Views)

Thanks for the help!

0 Kudos
Message 53 of 57
(1,292 Views)

Oli_Wachno wrote:

Hi Eli,

hope this thread is still kind of alive.

Finally, I've made it to use the UTF more actively...

There are a lot of usability / speed issues already mentioned, but the IMHO most important improvement would be to have a better help system: the error messages popping up do not allow the user to identify the errors easily.

I really do like the tool, please make it a bit easier to use!

I agree with the sentiment. As I presented during the CLA Summits and I will be presenting again at NI Week, the current version of the Unit Test Framework is much better than its predecesor, but it still needs to improve the User Experience, specially for the first times people use it.

1) I would like to be able to create a test vector directly from the LabVIEW Test. It took me a while to figure out that I needed to go to the project and create the test vector there.

2) I would like to be able to test VIs that have dynamic dispatch terminals. If I am able to set in the setup VI what object I am initializing, then the unit under test should know what object I am testing and which instance it needs to call. For now, we have to create a wrapper.

3) As rik_aspinal pointed out, the default for the error cluster should not be to have the clusters be equal, instead it shoudl be by element, because this is what shows the check boxes.

For an opportunity to learn from experienced developers / entrepeneurs (Steve, Joerg, and Brian amongst them):
Check out DSH Pragmatic Software Development Workshop!

DQMH Lead Architect * DQMH Trusted Advisor * Certified LabVIEW Architect * Certified LabVIEW Embedded Developer * Certified Professional Instructor * LabVIEW Champion * Code Janitor

Have you been nice to future you?
0 Kudos
Message 54 of 57
(1,292 Views)

rik_aspinall wrote:

One question I have to anyone out there who is listening is - with the UTF, how can I check that an error is thrown without requiring the string message to be exactly the same. For example, if I include the call chain, it will be different sometimes, or if I package additional information such as a timestamp into the error ring. But I do know that I want to see a certain error code, or even just see that some exception is thrown. As far as I can see, all elements of a cluster have to be equal (I can't check individual element boxes...)

Oli already answered this question, you can do it by changing to "by element". Also, be aware that the lvtest files are text files and can be edited in your favorite text editor and you can choose there which elements you want to compare too.

I presented about Unit Testing in both CLA Summits this year and I will be presenting on Unit Testing next week during NI Week. After NI Week, I will post a link here to my slides and demonstrations videos. Hopefully these will help.

Stay tuned!

My presentation is on Thursday, August 7 at 2:15 in room 19B  and it is titled

TS3370 - Save Time and Money With Unit Testing.

If you will be at NI week I hope to see you there.

Regards,

Fab

For an opportunity to learn from experienced developers / entrepeneurs (Steve, Joerg, and Brian amongst them):
Check out DSH Pragmatic Software Development Workshop!

DQMH Lead Architect * DQMH Trusted Advisor * Certified LabVIEW Architect * Certified LabVIEW Embedded Developer * Certified Professional Instructor * LabVIEW Champion * Code Janitor

Have you been nice to future you?
0 Kudos
Message 55 of 57
(1,292 Views)

These are some of the key reasons why we do not use the UTF for testing object-oriented systems. We inevitably end up having to create purely custom test VIs or addtional VIs just to manage each test; this mitigates most of the automation advantages of the UTF, particularly when you are talking nearly 1000 tests per project. As a result we have moved to other test frameworks (VI Tester) that allow us the freedom to execute these tests in a timely manner and better suit our TDD practices.

The UTF UX has improved with the 2013 release. If there are improvements to how we can perform the tests for object-oriented systems (particulary those designed to be unit tested by way of depenency injection) then we would certainly re-evaluate our standpoint.

Message 56 of 57
(1,292 Views)

There was a lot of interest on continuing the discussion about Unit Testing after my presentation at NI week. I am gathering feedback I got via e-mail and decided to start a Unit Testing Group, you can join here"

https://decibel.ni.com/content/groups/unit-testing-group?view=overview

Hopefully this results in better unit testing tools for LabVIEW.

For an opportunity to learn from experienced developers / entrepeneurs (Steve, Joerg, and Brian amongst them):
Check out DSH Pragmatic Software Development Workshop!

DQMH Lead Architect * DQMH Trusted Advisor * Certified LabVIEW Architect * Certified LabVIEW Embedded Developer * Certified Professional Instructor * LabVIEW Champion * Code Janitor

Have you been nice to future you?
0 Kudos
Message 57 of 57
(1,292 Views)