Code Organization

A simple code project is typically organized with two sub-projects: one for code, and another for unit testing.

When we add Traceability to the project, we place the original code in the Functional Layer, and then mirror it to create the Traceable Layer. We also follow this pattern for the unit tests.

It is important to make sure that compilation generates two sets of code: one that is purely Functional Code, and the other containing the Traceable Code. This way, we can deploy the Functional Code into production systems with no worry that we are accidentally deploying the Traceable Code as well.

Multitier Code Organization

If the software is designed around Multitier Architecture then it may be laid out such that each tier has its own section, with multiple projects inside of each tier. The unit tests section will then have a similar pattern of tiers so that there is a clear mapping between the code and the corresponding unit tests:

Once again, the Traceable Layer mirrors the Functional Layer:

In the event we are creating a solution that contains both a Logging Layer and a Traceable Layer, we simply extend the mirroring pattern again:

By requiring that each layer generate its own code files, we are able to easily map where each layer resides in the production and development systems. This concept will be explored more in the next section.

Next: System Organization