Python

Test Driven Development

  • 100% unit test coverage (must)

  • use pytest fixtures to mock/create dependencies, functional tests have the functional marker, integration are using a fixture called integration.

  • Test driven development with functional/integration and unit test (should)

    concept: http://en.wikipedia.org/wiki/Test-driven_development

    1. write function/integration test
    2. write unit test (simplest statement first)
    3. switch between writing code and change/extend tests until all test pass
    4. refactor

Refactor towards Clean Code

see (Refactoring & Clean Code)

Imports

Code formatting

  • 4 spaces instead of tabs (must)
  • no trailing white space (must)
  • pep8 (must)
  • pyflakes (must)
  • pylint (should)
  • mcabe (should)
  • Advances String Formatting pep3101 (must)
  • Single Quotes for strings except for docstrings (must)

Docstring formatting