[Tutor] Where should unit test files go in a project directory structure and some related questions?

Alan Gauld alan.gauld at btinternet.com
Sun Aug 16 10:28:27 CEST 2015


On 16/08/15 03:10, boB Stepp wrote:

> time.  I have not ever thought about formal project directory
> structures before, so I may need a bit of guidance here.

As you've discovered this varies wildly between projects.

Here is my default structure, but bear in mind most of my
projects have been big multi-team, multi-language type
structures so you probably don't need all of this.

project
- doc	project documents: contracts reqs, designs, test specs etc
- man(*)   user docs
- bin(*)   the master exe or main.py type files
- lib(*)   the shipping libraries
- src      the code
-- lang      folder per language used - sql, python, C, bash, etc
--- lib      modules/packages - subfolder per package
--- test     test code - sub-tree under this, depends on test tools.
--- tools    tools used but not shipped - db load/reset etc
--- main     folder in some languages, a file in others

Of course there may be others needed under those - such
as data, config, etc.

And you need some kind of script to copy the shipping files
into their final resting places(stored under tools of course).
The shipping folders are those marked with (*) (although with
open source you may well ship all/some of the src tree too).

And on a big project their may well be a separate production environment 
created for each live release that enables testing
of fault reports from users etc. But that's almost certainly
overkill for your needs.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list