continuous integration, tdd & living documentation - odoo experience 2015

24
Continuous Integration, TDD & Living Documentation with Odoo Colin Wren, Front end Dev & Dev Team Lead at Neova Health @colinwren [email protected]

Upload: colin-wren

Post on 28-Jul-2015

553 views

Category:

Software


0 download

TRANSCRIPT

1. Continuous Integration, TDD & Living Documentation with Odoo Colin Wren, Front end Dev & Dev Team Lead at Neova Health @colinwren [email protected] 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 3. Belgium is awesome 4. Obligatory Cat Picture 5. What is Continuous Integration? 6. Continuous Integration Merging development code frequently into the codebase often to ensure it doesnt 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 7. What is Test Driven Development and Behaviour Driven Development? 8. 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 9. What is Living Documentation? 10. 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 11. Living Documentation for Developers Once scope for a feature is added its 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 12. 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 hasnt Documentation is written as BDD tests are written 13. How can this be applied to Odoo? 14. 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 15. Demo - Creating a task 16. Example Gherkin 17. Example Step Definition 18. Example Config File 19. Running Behave 20. http://gimpneek.github.io/odoo_living_documentation _demo/living_doc/ HTML Output 21. The Secret Sauce Source 22. Its 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 23. Find out more https://github.com/Gimpneek/odoo_living_documentatio n_demo http://specificationbyexample.com/