Attached are the slides from the presentation Fabiola De la Cueva did during NI Week 2014 on Unit Testing and as promised the links to the videos of the demonstrations are included here as well.
Description from NI Week 2014 program: Learn unit testing techniques to save time and money in your LabVIEW projects from LabVIEW Champion and LabVIEW Architects Forum Founder Fabiola De la Cueva. Also discover how to take advantage of tools like the LabVIEW Unit Test Framework Toolkit and JKI VI Tester.
Edit [2015-May-6] Attached a new version of the slides that includes the Unit Test definition, properties of a good unit test and some contrasts between unit testing and integration testing given in the "Art of Unit Testing" by Roy Osherove in his second edition book.
Unit Test definition according to Roy Oshervore (emphasis is mine):
"An automated piece of code that invokes the unit of work being tested, and then checks some assumptions about a single end result of that unit. A unit test is almost always written using a unit testing framework. It can be written easily and runs quickly. It's trust-worthy, readable, and maintainable. It is consistent in its results as long as production code has not changed."
Below is a video recorded during the presentation given at NI Week 2014 (this does not include Roy Oshervore's definitions):
Here are the demonstrations shown during the presentation:
This video shows steps to test a VI using Unit Test Framework and how the unit tests can be edited both using the Unit Test Framework or a Text Editor. bit.ly/FabUTFDemo1
This Video shows how a new test case using JKI VI Tester is created to compare the output of a VI with the expected results.
UTF Demo 2
This demo shows how to use a setup and teardown VI when working with a method from a class
JKI VI Tester Demo 2
Testing a method from a class using JKI VI Tester
UTF Demo 3
In this video a test vector is generated to test a range of valid lot numbers and another vector is generated with the corresponding expiration dates. Then these are used in the unit test definition.
JKI VI Tester Demo 3
Show how to test a range of values using JKI VI Tester
UTF Demo - How to create User Defined Tests
[Edit Friday, October 30th] Adding a video that shows how to create an User Defined Test in Unit Test Framework
So happy that this got recorded, been wanting to catch it for a while. Thanks Fab!
I am glad the recording worked! I was hoping you were going to be there, but Thursday had lots of good presentations going on at the same time plus some closed door sessions, and it was the last session of the day and lots of people had to take off earlier. I understand not everyone could be there.
Sound might be a little off and I apologize, my mic was not working and I had to use the laptop mic array and the microphone at the room.
I will be interested in learning what you think.
Special thanks go out to Christopher Relf for being there to help answer questions from the audience and get everything setup. I hope some of his insight did get caught in the recording when I repeated some of his comments/answers.
Special thanks go out to Christopher Relf for being there to help answer questions from the audience...
Anytime - happy to help. Unit testing can be super important, and it much easier to set up than most people think. Great presentation Fab - hopefully everyone will add unit testing to their everyday code development process.
I thinks it a great way to highlight the benefits and it's a great approach to get going. I get the impression you find VI tester easier day to day, is this right?
Been working with UTF on a project but hitting some limitations, most frequent is comparing an output of a VI with a tear down output for example to compare a change in a database with a function. Think I will try VI tester again on the next one, it's always different actually using it in anger!
Been working with UTF on a project but hitting some limitations, most frequent is comparing an output of a VI with a tear down output for example...
Can you elaborate? Or, better yet, post an example? Perhaps to a new thread on the forums: http://forums.ni.com/
Both tools have their benefits. Personally I feel more comfortable with LabVIEW code than a configuration window or text files (lvtest files are text files), that also means that sometimes I am tempted to add more to the unit test than I should
JKI VI Tester makes it easier to test classes, specially methods that have dynamic dispatch terminals.
UTF is produced by a certified company, so it does not require to be validated when working on regulated industries. The lvtest files and the vector files are text files, that means other languages can be used to generate/parse them.
There are times you need a hammer, there are times you need a screw driver.
Give it a go with VI tester and let us via this community how it goes.