Learn how to organize your app's files into "modlets". A modlet is a folder that contains a module, its tests, documentation, demo page and other resources.
One of Bitovi's earliest, and most important, development strategies was the introduction of the "modlet" workflow. It's a very simple concept - every module should be developed as its own application. In practice, this means that instead of a folder structure where files are grouped by type like:
Each module has a folder with all of its supporting files, tests, and documentation. Additionally, we add:
A demo page (moduleA.html) that shows off the modules functionality if the module has a visual representation.
A test page (test.html) that runs just the module's tests.
In my experience, this workflow / folder structure provides the following benefits:
It enforces good API design and separation of concerns. By writing a demo page, you might discover that it's difficult to setup your module without a lot of bootstrapping. This might be an indication that something is wrong.
Developers are more likely to update tests and documentation if they are sitting right next to the module they are editing. The test is not hidden away in some tests folder that is more easily ignored.
It is easy to identify missing tests or documentation. If the test or documentation file is missing altogether, it's very easy to identify when they are in the same folder.
You can develop the application without having to load the entire application and all of its tests on every change.