Continuous Integration, TDD & Living Documentation - Odoo Experience 2015
1. Continuous Integration, TDD &
Living Documentation with
Odoo
Colin Wren, Front end Dev & Dev Team Lead at Neova Health
@colinwren
colin@neovahealth.co.uk
2. Little about me
Work for Neova Health, based in London
Been working with Odoo for last 2 years
Using Odoo for Open-eObs, an electronic patient
observation platform
Odoo interests: Web Controllers, JavaScript and
Testing
7. Continuous Integration
Merging development code frequently into the
codebase often to ensure it doesn’t break other
code in the codebase by running unit test and
integration test suites against newly merged code
Automated via a Continuous Integration Engine
such as Jenkins, Travis or Runbot which helps
alleviate the need to spend developer time to run
test suites
Ideal for generating Living Documentation
8. “What is Test Driven Development and
Behaviour Driven Development?”
9. Test/Behaviour Driven Development
Test Driven Development
Write tests first, implement later
Helps you to think about what the code needs to achieve and then implement
the functionality with that in mind
Behaviour Driven Development
Describe how features of the product work using business (or other) domain
language
Allows non-developers to write tests in their own domain language
Developers run tests using Given, When, Then to test the output of the
system when an event happens when the system is in a certain state
11. Living Documentation
A single document that client, business team &
development team use as a single point of scope
Acts as project definition, test suite and client
documentation
Is an evolving document which helps to catch breaking
scope changes or code changes over time
Helps business team understand impact of scope changes
on code base and vice versa
Tests what a feature does not how it does it
12. Living Documentation for Developers
Once scope for a feature is added it’s available for
client, business and development
This should prevent continual scope changes and
creep
As the document evolves the side effects of scope
changes to established features are easily evidenced
Test integration into documentation helps to show
how much of features have been implemented as
well history of tests
13. Living Documentation for Business
Use Living Documentation to negotiate scope with
clients and show them how changes will affect
product
Integration with test suite gives instant feedback on
what has been implemented and what hasn’t
Documentation is written as BDD tests are written
15. Living Documentation with Odoo
Disclaimer: At time of writing pull request is still pending
Use Behave and ERPPeek to run tests (OERPScenario)
Business team push BDD feature files to repo
Development team push steps to same repo or different
one used as submodule in git
CI Engine listens to these repos and repos for product and
run Behave test suites to generate Living Documentation
and upload to webserver
23. It’s a Behave Reporter
Behave exposes hooks for reporting plugins
As the tests run I collect information on features,
scenarios, steps & tags
After the tests have run I use this information to
match information in the config file and write the
webpages using Jinja2