Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Test Driven Development for PLSQL with utPLSQL v3

1,070 views

Published on

Slides from presentation on Unit Testing and Test Driven Development for Oacle SQL and PLSQL using utPLSQL v3 framework.

Published in: Technology
  • Be the first to comment

Test Driven Development for PLSQL with utPLSQL v3

  1. 1. utPLSQL v3 Ultimate Unit Testing framework for Oracle Jacek Gębal twitter: @GebalJacek mail: jgebal@gmail.com blog: oraclethoughts.com Senior Data Engineer Developer @Fidelity Investments - Ireland co-author of: utPLSQL v3
  2. 2. The Unit Test ● Simple ● Repeatable ● Automated ● Isolated from other tests ● Tests one behavior ● Living documentation ● Developer’s responsibility
  3. 3. ● Professional product delivery ● Meets requirement ● Delivered on time ● Easy to build ● Maintainable ● Safe to change Why should I care?
  4. 4. What to test in database? ● Logic ● Structure ● State
  5. 5. Why utPLSQL v3? ● open-source ● free ● complete ● unit tested ● IDE independent ● transportable ● pure PL/SQL ● CI/CD oriented ● extendable
  6. 6. Getting started unit testing as part of software delivery lifecycle
  7. 7. Test Driven Development ● write a test ● make it fail ● keep it simple ● tests are examples ● tests become documentation ● get to green fast ● take baby steps ● stuck? undo and start over ● write only enough code to pass the test ● remove duplication (in code and tests) ● rename and clean up ● run tests and stay green ● change implementation, not behavior ● improve structure in small steps RED GREEN REFACTOR
  8. 8. Run all tests after every single change
  9. 9. demo
  10. 10. utPLSQL v3 recap ● pure PL/SQL ● test configuration - annotations ● run configuration - invocation parameters ● flexible run scope ● hierarchical test structure ● several reporters ● test expectations on complex data-types ● multiple matchers ● automatic test isolation ● CI/CD with command-line utPLSQL-cli
  11. 11. resources Documentation: http://utplsql.org/utPLSQL/ Cheat-sheet: https://www.cheatography.com/jgebal/cheat-sheets/utplsql-v3/#downloads Sources: https://github.com/utPLSQL/utPLSQL Demo project: https://github.com/utPLSQL/utPLSQL-demo-project Sonar: https://sonarcloud.io/dashboard?id=utPLSQL%3AutPLSQL-demo-project%3Adevelop Twitter: #utplsql, @utplsql

×