Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In my opinion, unit tests should be placed in a separate assembly from production code. Here are just a few cons of placing unit tests in the same assembly or assemblies as production code are:</p> <ol> <li>Unit tests get shipped with production code. The only thing shipped with product code is production code.</li> <li>Assemblies will be unnecessarily bloated by unit tests.</li> <li>Unit tests can affect build processes like automated or continuous build. </li> </ol> <p>I don't really know of any pros. Having an extra project (or 10) isn't a con.</p> <p><strong>Edit: More Info On Build and Shipping</strong></p> <p>I would further recommend that any automated build process place production and unit tests into different locations. Ideally, the unit test build process only runs if the production code builds, and copies the product files into the unit tests directory. Doing it this way results in the actual bits being separated for shipping, etc. Additionally, it is fairly trivial to run automated unit testing at this point on all tests in a particular directory.</p> <p>To summarize, here is the general idea for a daily build and testing and shipping of bits and other files:</p> <ol> <li>Production build runs, placing production files into a specific "production" directory. <ol> <li>Build production projects only.</li> <li>Copy compiled bits and other files into a "production" directory.</li> <li>Copy bits and other files into a release candidate directory, aka a Christmas release directory would be "Release20081225".</li> </ol></li> <li>If production build succeeds, unit test build runs. <ol> <li>Copy production code to "tests" directory.</li> <li>Build unit tests to "tests" directory.</li> <li>Run unit tests.</li> </ol></li> <li>Send build notifications and unit tests results to developers.</li> <li>When a release candidate (like Release20081225) is accepted, ship these bits.</li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload