Couple of questions:
1.) Do you unit test release code?
2.) If so, do you then leave those unit tests intact so that the tests themselves exist in the production environment?
I see the value in #1, but is it a "good practice" to create dependencies in production to, for example, the NUnit assemblies?
Give me your thoughts.
Unit tests run on all build configurations. Unit tests are always intact but this does not mean that shipped assemblies are dependent on anything relating to the tests. Tests are always written in a parallel assembly (in the same build environment) that then tests the production assembly.
According to that line of reasoning, writing unit tests before writing code is a recommended way to do proper software engineering.
Code coverage is calculated for a file based on the unit tests that SUCCESSFULLY passed. After all the unit tests are run you are able to see either in your browser the exact lines in your code that are being executed or right in your terminal.
Unit testing is the first software testing phase in SDLC and it is usually taken up during the development of the application. These unit test cases are written and executed by software developers.
The above is my general rule (I'm usually deploying to non-technical users). However I do have an exception, which is a programming utility that is unit tested with ~130 test scripts. Because the test scripts double as examples, I deploy those along with the production release, and consequently they enhance the existing documentation.
Deploying tests with open-source code is definitely worthwhile. It allows people to play with, modify and submit patches, whilst being able to run the tests that passed successfully to permit the original artifact to be released.
Yes and Yes, application behaviour can be different between release and debug builds, hence as part of the release process the release build has to pass all its unit tests.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With