Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In addition to adhering to ONAP sonar/checkstyle requirements, the project team has agreed upon these desired preferences for submitting java code.

  • JUnit Tests
    • Test file naming
      • WIP
      • "Test" prefix
    • Where appropriate, use assertj instead of try/catch blocks.  Try/catch blocks are notoriously incorrect or incorrectly maintained, as developers frequently forget to add "fail()" calls in the appropriate branch.
    • WIP
  • Use of Static Methods
    • In general, methods should not be declared "static" unless they are side-effect free.  For instance, they should not interact with external systems (e.g., DBMS).
    • Exceptions include "registration" methods, which are used to register objects once, typically at start-up.  Loggers fall into this category.
    • This is intended to be a guideline and not a hard and fast rule, though exceptions should be granted sparingly.  Typically, a static method can be easily converted into a regular method.
    • WIP

Committer Strategy

  • Require 3 committers to +1 a review - at least 2 companies represented. 
  • Require at least one expert of the repo to +1 (may or may not be a committer).
  • For substantial reviews, either size or logic changes, then time limit of 24 hours to review can override.
  • A +2 from committer or PTL, one can imply they are good with any future patches for a review.