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. The Unit Test
● Simple
● Repeatable
● Automated
● Isolated from other tests
● Tests one behavior
● Living documentation
● Developer’s responsibility
3. ● Professional product delivery
● Meets requirement
● Delivered on time
● Easy to build
● Maintainable
● Safe to change
Why should I
care?
4. What to test in
database?
● Logic
● Structure
● State
5. Why utPLSQL v3?
● open-source
● free
● complete
● unit tested
● IDE independent
● transportable
● pure PL/SQL
● CI/CD oriented
● extendable
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
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