Home > Developers > Wiki > Vetting Patches
Views

1   Introduction

This document is intended to serve as a pre-submit checklist for contributors and a pre-commit checklist for committers.

2   First Pass

Initially, code should be scanned for more obvious mistakes. Complete unit test suite must pass; no errors or failures.

2.1   No "leftovers"

  • No temporary debugging code exists.
  • No commented-out code exists without explanations.
  • No generated files.

2.2   Pretty

Code is consistently and readably indented.

2.3   Unit tests

Unit tests are...

  • written for JUnit 4.
  • part of a test suite, like AdminTestSuite or PPITestSuite.
  • part of one of ApplicationTestSet1, 2, 3, or 4.
  • part of ApplicationTestSuite.
  • suffixed with Test, like ViewSettingsTest

2.4   i18n

  • All strings are ready for translation.
  • Translations are added to _is_IS.properties for pseudo L10n.

2.5   Licensing

All files use licensing information as specified at MifosLicensing.

2.6   Language

Proper grammar, spelling, and punctuation is used.

2.7   Ownership

Omit your own name. Ex: "this file created/mainted by me, Adam Monsen". Once the code is checked in, we all own it, any one of us may maintain it! Credit for contributors should appear in the AUTHORS file only.

This type of anonymity will:

  • increase our bus-factor
  • discourage territoriality
  • promote group ownership and responsibility

3   Second Pass

When delving deeper into examining a patch, consider that more complex Mifos idioms are followed and look for deeper logic issues.

3.1   Intention-Driven Code

All method names and logic is self-explanatory or has Javadoc and/or comments.

3.2   Code Reuse

Efficient, sensible, and prolific code reuse is found.

3.3   Typesafe Containers

Generics are used whenever possible to parameterize containers.

3.4   Permissions

Pages and forms are accessible/usable only by appropriate users/roles.


Grameen logo