In .NET(C#) is there any advantage/disadvantage to go with debug/release build for unit testing?
Which target configuration do you usually use for unit testing on a build server? Does it matter?
What about code coverage (for this one I'm guessing debug versions are needed).
I'd recommend running the release code. For a couple of reasons. 1) It is the code that the customers will be using. 2) Some code has special debug conditionals that will produce differences between the debug and release builds.
By default, Debug includes debug information in the compiled files (allowing easy debugging) while Release usually has optimizations enabled. As far as conditional compilation goes, they each define different symbols that can be checked in your program, but they are language-specific macros.
Debug and analyze unit tests with Test ExplorerYou can use Test Explorer to start a debugging session for your tests. Stepping through your code with the Visual Studio debugger seamlessly takes you back and forth between the unit tests and the project under test.
You can now debug your release build application. To find a problem, step through the code (or use Just-In-Time debugging) until you find where the failure occurs, and then determine the incorrect parameters or code.
I'd recommend running the release code. For a couple of reasons.
1) It is the code that the customers will be using.
2) Some code has special debug conditionals that will produce differences between the debug and release builds.
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