Building a solution

Today our team leader asked me to get someone in our team started on a new solution. This entails 2 things:

  1. A dev tree
  2. Tests and code (and yes, I choose this order on purpose)

 

The Dev Tree

Suppose you have to make a new solution.

 

  • Create root:
    • $/TeamProject/<SolutionName>
  • Create main branch:
    • $/TeamProject/<SolutionName>/Dev
  • Create lib & src folder:
    • $/TeamProject/<SolutionName>/Development/lib
    • $/TeamProject/<SolutionName>/Development/lib/Unity
    • $/TeamProject/<SolutionName>/Development/lib/EnterpriseLibrary
    • $/TeamProject/<SolutionName>/Development/src
    • $/TeamProject/<SolutionName>/Development/src/Applications
    • $/TeamProject/<SolutionName>/Development/src/Framework
    • $/TeamProject/<SolutionName>/Development/src/Tests/Unit Tests
    • $/TeamProject/<SolutionName>/Development/src/Tests/Integration Tests

In the ‘scr’ folder you create the solution with the solution name. In the the solution you should create the same solution folder structure as on the file system, just to keep things easy to find. Be careful though, when you create new projects, Visual Studio doesn’t automatically set the project in the same folder as the solution folder you created it in.

Keep your structure in the tests the same as the structure of the ‘real’ projects. So if you have:

Project.Naam/Visitors/PaymentVisitor.cs

Than you should have:

Tests/Unit Tests/Test.Project.Naam/Visitors/PaymentVisitorTests/

Keep your project name the same as the assembly name. So if you have TeamProject.Billing.Framework.dll, your project name should be TeamProject.Billing.Framework.

This would also be a good time to add an automatic build. We use FinalBuilder which is an excellent tool – Dennis did an excellent job explaining why -  and we created a template for making automatic builds. This speeds up the creation process and that should help with the adoption of continuous integration and nightly builds. Generally it should help adoption of a strive towards better quality.

Now add tests and code…

(more…)