Standards
Coding standards
There are described in subversion at <root>/xplanner/docs/html/developers/index.html.
| The IDEA project file has the correct coding standards already set. |
Design standards
See Good design
XPlanner design patterns/idioms
Injection dependencies (spring framework)
We use the spring framework to
- Reduce coupling
- Increase class coherence and decrease their size (natural application of Single Responsability & Interface seggregation)
- Increase testability
Page arguments
- Each page has a main object, the target. The id of the target should always use the oid parameter in the request url.
/do/edit/task?oid=231
Rational: this is equivalent to the this reference of java objects. Any operation can assume to find the target id through this request parameter
Development standards
Testing
We rely heavily on testing to ensure sustainable quality of the project. Any new feature is supposed to introduce both unit tests (things are implemented right) and acceptance tests (we implemented the right things). Both set of tests will become our first line of defense to make sure that no regression are introduced as we change the software. This is even more important since it is a open-source software developed with many resources distributed across the world.
A test is not a unit test if:
Instead all external resources should be mocked (using spring makes this easy). |
Run targets/Test suites
The build has 2 targets: unit.tests and acceptance.tests
- unit.tests should only include unit tests and run very fast. We are looking at a fast feedback here not accurate feedback (acceptance tests do that)
- acceptance.tests include every "slow" tests from integration tests to full acceptance tests
There are 2 junit test suites that correspond to these to be used inside IDEs: TestAllUnitTests and TestAllAcceptanceTests
Naming conventions
- The unit tests follows the following naming pattern
src/com/technoetic/xplanner/util/MyUtil.java src-test/com/technoetic/xplanner/util/TestMyUtil.java - Acceptance tests are located under src-test/com/technoetic/xplanner/acceptance and follows <test>TestScript.java naming pattern.
- Performance tests are located under src-test/com/technoetic/xplanner/performance and follow <test>PerformanceTest.java naming pattern.
Use of todos to mark things to do
Any smells, bugs, inefficiency... that a developer finds but does not have the time to remove should be annotated with a TODO tag. A TODO tag is a comment in the syntax appropriate to the language of the file that will start with the tag followed by a description:
// DEBT: rename m to something more descriptive public int m() { return 0; }
| Tag | Regex | Purpose |
|---|---|---|
| TODO | \btodo\b.* | General task |
| DEBT | \bdebt\b.* | Refactoring that are yet to be done |
| FIXME | \bfixme\b.* | Bug or missing features that should be fix ASAP |


