Version 8, last updated by Premek Brada at January 12, 2010 11:14 UTC
Development conventions
Project development conventions
Tools to use
- Maven – project management and comprehension tool
- Maven home page: http://maven.apache.org/
- Introduction to Maven: http://wiki.kiv.zcu.cz/SlovnikTerminologie/JemnyUvodDoMavenu (sorry, in czech only)
- Using Maven in CoSi projects
- JUnit – framework for code testing
- Junit home page: http://www.junit.org/
- Avoid the use of version 3.8.x or older
- log4j – logging framework
- log4j home page: http://logging.apache.org/log4j
- log4j short manual
Processes to obey
- Ideal development process should be following:
- Write method.
- Write unit test, good unit test.
- Run test, if it fails do code revision.
- If your method looks good but unit test kees failing, do test revision.
- 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]
- 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
- Our source code should follow these conventions and practices:
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