Version 8, last updated by Premek Brada at January 12, 2010 11:14 UTC

Project development conventions

Tools to use

  • JUnit – framework for code testing

Processes to obey

  • Ideal development process should be following:
  1. Write method.
  2. Write unit test, good unit test.
  3. Run test, if it fails do code revision.
  4. If your method looks good but unit test kees failing, do test revision.
  5. If your unit passes you can commit code into the svn repository and continue to 1. Else return to 3.
    • Put “re #4” in commit comment to link your commit to ticket #4. “references”, “refs” and “see” will add a comment to the target ticket.
    • If you opened the ticket, you can close it – “closes #4” in commit comment to close ticket 4. “closed”, “close”, “fix”, “fixed”, and “fixes” will also close a ticket. [from repo instructions]
  6. Please update time statistics (Work hours remaining and Hours invested by you) on each commit or at least on ticket closing.

Project and source conventions

The original CoSi framework implementation uses the following naming conventions:
- local variables use prefix “F_” (F like function, since scope of a local variable is limited to the function)
- parameters in funcitions have prefix “P_” (P as parameter)
- member variables don’t have a prefix. The reason for this are existing Java conventions (e.g. java beans) deducing the name of a property from the get- and set methods, with which the property can be accessed. Additionally it is common to use in varialbe names of primitive and other frequently used data types a short term of the type.
- for bigger methods which return a value (fuctions), use variable F_ret (Fi_ret, Fs_ret) which holds a return value – at the end of the function is then only “return F_ret;”
- type-indications can be added to the prefix:
s … String, f.e. Fs_name
i … int, f.e. Fi_index
b … boolean, f.e. Fb_isModified
Examples:
- Fs_thisIsLocalString, Ps_thisIsStringParameter, F_thisIsNonPrimitiveObject, thisIsClassField

  • I found some offences in the present code. Please read my notes and write me what do you think about it. Link: Source code problems