Q: Is unit testing a Development or QA Function?
A: Both!
In the comments section on a posting by Jason Anderson, a VSTS member, regarding the positioning of their Unit Testing offering, people are really failing to understand unit testing. VSTS Developer contains unit testing as well as VSTS Tester.
Developers write the tests, QA runs them. Is that so hard to understand?
The power of unit tests are realized when they are incorporated in the the nightly build that is traditionally run by QA.
Many people misunderstand the components of a professional build regimen:
- Version Source and Deployment Files
- Get files and gather file inventory for report
- Compile code and gather results (fail if errors)
- Execute FxCop project and gather results (fail if errors)
- Execute Reference Documentation Build (NDoc or other) and gather results (fail if errors)
- Deploy to unit test server*
- Install unit test environment (DB etc)*
- Perform unit test regression testing and gather results, including code coverage results (fail if errors)
- Build setup.exe and/or deployment (disk) image gather results (fail if errors)
- Re-image deployment test integration servers
- Deploy product to servers and gather results (fail if errors)
- Run QA Smoke Test or Acceptance Test and gather results (fail if errors)
- Generate build report
- Evaluate the results
*Simple products do not require setting up a unit test environment as the build output is sufficient.
The point here is that QA is very much involved in evaluating and verifying the quality of code based on the Unit Test and concomitant code coverage results, even if, in most organizations, they do not write the unit test code.