Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. IT & Infrastructure
  4. unit testing - keep tests in current project or separate?

unit testing - keep tests in current project or separate?

Scheduled Pinned Locked Moved IT & Infrastructure
testingbeta-testingquestionannouncement
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DavidNohejl
    wrote on last edited by
    #1

    Hello, when you write unit tests, do you make special project for them, or do you keep that with your code? I cannot decide, because: - tests nicely document code, I want them in my project - test code have no place in release that goes live, I want them in separate project. Where do you keep your unit tests, and why?


    "Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus

    C 1 Reply Last reply
    0
    • D DavidNohejl

      Hello, when you write unit tests, do you make special project for them, or do you keep that with your code? I cannot decide, because: - tests nicely document code, I want them in my project - test code have no place in release that goes live, I want them in separate project. Where do you keep your unit tests, and why?


      "Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      dnh wrote:

      when you write unit tests, do you make special project for them, or do you keep that with your code?

      Separate project.

      dnh wrote:

      tests nicely document code, I want them in my project

      Tests should be isolated from the code they test.

      dnh wrote:

      test code have no place in release that goes live, I want them in separate project.

      Exactly.


      Upcoming events: * Glasgow: Geek Dinner (5th March) * Edinburgh: Web Security Conference Day for Windows Developers (12th April) My: Website | Blog | Photos

      D B 2 Replies Last reply
      0
      • C Colin Angus Mackay

        dnh wrote:

        when you write unit tests, do you make special project for them, or do you keep that with your code?

        Separate project.

        dnh wrote:

        tests nicely document code, I want them in my project

        Tests should be isolated from the code they test.

        dnh wrote:

        test code have no place in release that goes live, I want them in separate project.

        Exactly.


        Upcoming events: * Glasgow: Geek Dinner (5th March) * Edinburgh: Web Security Conference Day for Windows Developers (12th April) My: Website | Blog | Photos

        D Offline
        D Offline
        DavidNohejl
        wrote on last edited by
        #3

        Thanks Colin.

        Colin Angus Mackay wrote:

        dnh wrote: test code have no place in release that goes live, I want them in separate project. Exactly.

        I was playing with idea to keep tests in same project but exclude from release build, however separate project seems to be most obvious, straightforward and better solution. :) When I started to write my website and ended up with about 8 projects (3layers+utils+tests) for thing that did literally nothing it seemed too much. Well I guess it's ok ;)


        "Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus

        1 Reply Last reply
        0
        • C Colin Angus Mackay

          dnh wrote:

          when you write unit tests, do you make special project for them, or do you keep that with your code?

          Separate project.

          dnh wrote:

          tests nicely document code, I want them in my project

          Tests should be isolated from the code they test.

          dnh wrote:

          test code have no place in release that goes live, I want them in separate project.

          Exactly.


          Upcoming events: * Glasgow: Geek Dinner (5th March) * Edinburgh: Web Security Conference Day for Windows Developers (12th April) My: Website | Blog | Photos

          B Offline
          B Offline
          Brady Kelly
          wrote on last edited by
          #4

          I keep them separate as well. In addition to what Colin says, you don't want any dependencies on your unit testing libraries or utilities, such as NUnit and NMock in your production projects.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups