Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1033233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:12:06+00:00 2026-05-16T14:12:06+00:00

I have not used Unit Testing so far, and I intend to adopt this

  • 0

I have not used Unit Testing so far, and I intend to adopt this procedure. I was impressed by TDD and certainly want to give it a try – I’m almost sure it’s the way to go.

Boost looks like a good choice, mainly because it’s being maintained. With that said, how should I go about implementing a working and elegant file-structure and project-structure ? I am using VS 2005 in Win XP. I have been googling about this and was more confused than enlightened.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T14:12:07+00:00Added an answer on May 16, 2026 at 2:12 pm

    Our Boost based Testing structure looks like this:

    ProjectRoot/
      Library1/
        lib1.vcproj
        lib1.cpp
        classX.cpp
        ...
      Library2/
        lib2.vcproj
        lib2.cpp
        toolB.cpp
        classY.cpp
        ...
      MainExecutable/
        main.cpp
        toolA.cpp
        toolB.cpp
        classZ.cpp
        ...
      Tests/
        unittests.sln
        ut_lib1/
          ut_lib1.vcproj (referencing the lib1 project)
          ut_lib1.cpp (with BOOST_AUTO_TEST_CASE) - testing public interface of lib1
          ut_classX.cpp - testing of a class or other entity might be split 
                          into a separate test file for size reasons or if the entity
                          is not part of the public interface of the library
          ...
        ut_lib2/
          ut_lib2.vcproj (referencing the lib2 project)
          ut_lib2.cpp (with BOOST_AUTO_TEST_CASE) - testing public interface of lib2
          ...
        ut_toolA/
          ut_toolA.vcproj (referencing the toolA.cpp file)
          ut_toolA.cpp - testing functions of toolA
        ut_toolB/
          ut_toolB.vcproj (referencing the toolB.cpp file)
          ut_toolB.cpp - testing functions of toolB
        ut_main/
          ut_main.vcproj (referencing all required cpp files from the main project)
          ut_classZ.cpp - testing classZ
          ...
    

    This structure was chosen for a legacy project, where we had to decide on a case-by-case basis on what tests to add and how to group test-projects for existing modules of sourcecode.

    Things to note:

    • Unit Testing code is always compiled separately from production code.
    • Production projects do not reference the unit testing code.
    • Unit Testing projects include source-files directly or only reference libraries, depending on what makes sense given the use of a certain code-file.
    • Running the unit tests is done via a post-build step in each ut_*.vcproj
    • All our production builds automatically also run the unit tests. (In our build scripts.)

    In our real (C++) world you have to make tradeoffs btw. legacy issues, developer convenience, compile times, etc. I think our project structure is a good tradeoff. 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In the past, I have not really used namespaces, but in this project I
I have not used generics much and so cannot figure out if it is
I have not used Windows Vista. I knew that many APIs have been changed/deprecated
I've not used C++ very much in the past, and have recently been doing
You'll have to forgive my ignorance, but I'm not used to using wide character
I have an assembly which should not be used by any application other than
I have not seen much support for Grails to develop facebook apps.I was just
I have not had to mess with mailto links much. However I now need
I have not been able to find a way to cancel/terminate asynchronous read operation
Note - I have not delved very deeply into Apple's iPhone SDK yet. However,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.