Unit Testing Group

cancel
Showing results for 
Search instead for 
Did you mean: 

TS3370 Save Time and Money With Unit Testing

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):

bit.ly/FabUnitTesting

 

 

Here are the demonstrations shown during the presentation:

 

UTF Demo 1

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

 

 

JKI VI Tester Demo 1

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.

bit.ly/FabJVTDemo

UTF Demo 2

This demo shows how to use a setup and teardown VI when working with a method from a class

bit.ly/FabUTFDemo2

JKI VI Tester Demo 2

Testing a method from a class using JKI VI Tester

bit.ly/FabJVTDemo2

 

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.

bit.ly/FabUTFDemo3

 


JKI VI Tester Demo 3

Show how to test a range of values using JKI VI Tester

bit.ly/FabJVTDemo3

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

 

I'm Organizing the GLA Summit!


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?
Message 1 of 8
(12,310 Views)

So happy that this got recorded, been wanting to catch it for a while. Thanks Fab!

James Mc
========
CLA and cRIO Fanatic
My writings on LabVIEW Development are at devs.wiresmithtech.com
Message 2 of 8
(7,620 Views)

James,

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.

Regards,

Fab

I'm Organizing the GLA Summit!


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 3 of 8
(7,620 Views)

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.

I'm Organizing the GLA Summit!


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 4 of 8
(7,621 Views)

FabiolaDelaCueva wrote:

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.





Copyright © 2004-2020 Christopher G. Relf. Some Rights Reserved. This posting is licensed under a Creative Commons Attribution 2.5 License.
Message 5 of 8
(7,621 Views)

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!

Thanks again,

James

James Mc
========
CLA and cRIO Fanatic
My writings on LabVIEW Development are at devs.wiresmithtech.com
0 Kudos
Message 6 of 8
(7,621 Views)

James_McN wrote:

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/





Copyright © 2004-2020 Christopher G. Relf. Some Rights Reserved. This posting is licensed under a Creative Commons Attribution 2.5 License.
0 Kudos
Message 7 of 8
(7,621 Views)

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.

I'm Organizing the GLA Summit!


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 8 of 8
(7,621 Views)