05-23-2016 02:51 PM
I watched an interesting video on youtube the other day about improving unit testing practices in Java and got serious tool envy!
https://www.youtube.com/watch?v=D-xra_X9Nwg
One bit I liked was the bit about splitting tests into given-when-then statements.
This is a recommended format for acceptance test descriptions from non-technical users (e.g. given the tests stop after 20 seconds, when I resume then it starts where it left off).
This helps highlight if you are testing too much since you should only have assertions in then (ideally 1, or you are testing 1 state) and for me I think it might help tidy up my tests since you can quickly glance and identify setup (given), code under test (when) and the assertions (then).
I will likely write up a bit more detail in a blog post once I have played a bit more but was curious to get some feedback. Here is my interpretation in LabVIEW, anyone else have any better ideas?
05-23-2016 03:01 PM
Our in-house unit testing framework template.vi has a sequence structure with "Arrange / Act / Assert" which is basically the same as what you have above.
Many of the acceptance-style testing frameworks (eg. Cucumber) rely on a run-time interpreted lexical language. Such a thing would be possible in LabVIEW but I wonder about its acceptance (pun intended).
Any yes, I often get tool envy with other stacks versus LabVIEW. It just seems the demand for the tools is higher (as is the user-base).
05-24-2016 12:47 AM
James_McN schrieb:
"I don't write tests when I want to inflict pain on my coworkers"
Good one....