SlideShare a Scribd company logo
PL/SQL Unit Testing
    with Ruby
Raimonds Simanovskis




         github.com/rsim
What is good code?

                     Test
    Correct
                 functionality!
                     Test
  Fast enough
                 performance!
                   Test after
  Maintainable
                   changes!
How is it done?
       try something...

                  dbms_output.put_line(...)

  it is obvious that
there are no bugs :)

   testers should test,
     that’s their job
What are typical
      problems?
       “trying” and not testing

       tests are not repeatable

     manual verification of results

testing is done too late in development
Types of tests
      unit tests

   integration tests
                                programmer’s
performance & load tests        responsibility

exploratory & usability tests
Test Driven
Development
    Write test


     Run test


    Write code


     Run test


    Refactoring
Good unit tests
          Automatic, run fast

Wide code coverage including edge cases

              Repeatable

   Independent from execution order

Using real and understandable test data
How to do it
when programming in
      PL/SQL ?
utPLSQL
created by Steven Feuerstein, 1999

based on “xUnit”-style frameworks

    not maintained anymore :(
Example
Substring from start
 until end position
Tests
Results
Visual testing tools

Quest Code Tester   SQL Developer 2.1
Why used just by
      few?
 too large / too verbose test code?

   hard to read, too much noise?

    hard to test complex cases?

no best practices how to write tests?

nobody is using, why should I use?
ruby-plsql-spec
         ideal language for writing tests



 RSpec       powerful testing tools
             with “readable” syntax

                library for calling
ruby-plsql     PL/SQL procedures
                    from Ruby
ruby-plsql-spec
     Demo
Benefits
       compact, readable syntax

powerful features also for complex tests

 best practices from Ruby community

   based on needs from real projects

    opensource – “free as in beer” :)
Links
http://blog.rayapps.com/2009/11/27/oracle-
        plsql-unit-testing-with-ruby/

    http://blog.rayapps.com/2010/01/06/
screencasts-of-oracle-plsql-unit-testing-with-
                    ruby/

   http://github.com/rsim/ruby-plsql-spec

More Related Content

What's hot (20)

PPTX
Spring Test Framework
GlobalLogic Ukraine
 
PDF
JUnit 5 - Evolution and Innovation - SpringOne Platform 2019
Sam Brannen
 
PPTX
Laravel Unit Testing
Dr. Syed Hassan Amin
 
PPTX
Unit & integration testing
Pavlo Hodysh
 
PPTX
Codeception
少東 張
 
PPTX
Keyword-driven Test Automation Framework
Mikhail Subach
 
PPT
TDD And Refactoring
Naresh Jain
 
PDF
Test Automation and Keyword-driven testing af Brian Nielsen, CISS/AAU
InfinIT - Innovationsnetværket for it
 
DOCX
Realtime selenium interview questions
Kuldeep Pawar
 
PPTX
Refactoring legacy code driven by tests - ENG
Luca Minudel
 
PPTX
CI / CD w/ Codeception
Tudor Barbu
 
PDF
Refactoring Legacy Code
Adam Culp
 
PDF
Testing with Codeception
Jeremy Coates
 
PDF
Creating Maintainable Automated Acceptance Tests
Jez Humble
 
PDF
Create an architecture for web test automation
Elias Nogueira
 
PDF
iOS Test-Driven Development
Pablo Villar
 
PDF
Into The Box 2018 | Assert control over your legacy applications
Ortus Solutions, Corp
 
PDF
Test Driven Development Methodology and Philosophy
Vijay Kumbhar
 
DOCX
Selenium notes
wholcomb
 
PDF
Behavior Driven Development with SpecFlow
Rachid Kherrazi
 
Spring Test Framework
GlobalLogic Ukraine
 
JUnit 5 - Evolution and Innovation - SpringOne Platform 2019
Sam Brannen
 
Laravel Unit Testing
Dr. Syed Hassan Amin
 
Unit & integration testing
Pavlo Hodysh
 
Codeception
少東 張
 
Keyword-driven Test Automation Framework
Mikhail Subach
 
TDD And Refactoring
Naresh Jain
 
Test Automation and Keyword-driven testing af Brian Nielsen, CISS/AAU
InfinIT - Innovationsnetværket for it
 
Realtime selenium interview questions
Kuldeep Pawar
 
Refactoring legacy code driven by tests - ENG
Luca Minudel
 
CI / CD w/ Codeception
Tudor Barbu
 
Refactoring Legacy Code
Adam Culp
 
Testing with Codeception
Jeremy Coates
 
Creating Maintainable Automated Acceptance Tests
Jez Humble
 
Create an architecture for web test automation
Elias Nogueira
 
iOS Test-Driven Development
Pablo Villar
 
Into The Box 2018 | Assert control over your legacy applications
Ortus Solutions, Corp
 
Test Driven Development Methodology and Philosophy
Vijay Kumbhar
 
Selenium notes
wholcomb
 
Behavior Driven Development with SpecFlow
Rachid Kherrazi
 

Viewers also liked (6)

PDF
PL/SQL Unit Testing Can Be Fun
Raimonds Simanovskis
 
PDF
Oracle adapters for Ruby ORMs
Raimonds Simanovskis
 
PDF
PL SQL Unit Tests mit SQL Developer
Trivadis
 
PDF
eazyBI Overview - Embedding Mondrian in other applications
Raimonds Simanovskis
 
PDF
Improve Mondrian MDX usability with user defined functions
Raimonds Simanovskis
 
PDF
PL/SQL Unit Testing Can Be Fun!
Raimonds Simanovskis
 
PL/SQL Unit Testing Can Be Fun
Raimonds Simanovskis
 
Oracle adapters for Ruby ORMs
Raimonds Simanovskis
 
PL SQL Unit Tests mit SQL Developer
Trivadis
 
eazyBI Overview - Embedding Mondrian in other applications
Raimonds Simanovskis
 
Improve Mondrian MDX usability with user defined functions
Raimonds Simanovskis
 
PL/SQL Unit Testing Can Be Fun!
Raimonds Simanovskis
 
Ad

Similar to PL/SQL unit testing with Ruby (20)

PPTX
utPLSQL: Unit Testing for Oracle PL/SQL
Steven Feuerstein
 
PDF
Bgoug 2019.11 test your pl sql - not your patience
Jacek Gebal
 
PDF
POUG2019 - Test your PL/SQL - your database will love you
Jacek Gebal
 
PDF
utplsql.pdf
vijayv991893
 
PDF
Six simple steps to unit testing happiness
Steven Feuerstein
 
PPTX
#DOAW16 - DevOps@work Roma 2016 - Testing your databases
Alessandro Alpi
 
PDF
POUG Meetup 1st MArch 2019 - utPLSQL v3 - Testing Framework for PL/SQL
Jacek Gebal
 
PDF
Ukoug webinar - testing PLSQL APIs with utPLSQL v3
Jacek Gebal
 
PDF
SELJE_Database_Unit_Testing.pdf
Eric Selje
 
PPS
Why Unit Testingl
priya_trivedi
 
PPS
Why Unit Testingl
priya_trivedi
 
PPS
Why unit testingl
Priya Sharma
 
PDF
Agile db testing_techniques
Tarik Essawi
 
PPT
A testing framework for Microsoft SQL-Server
elliando dias
 
PDF
SELJE_Database_Unit_Testing_Slides.pdf
Eric Selje
 
PDF
Software testing: an introduction - 2017
XavierDevroey
 
PPTX
Testing 101
Noam Barkai
 
PDF
DSR Testing (Part 1)
Steve Upton
 
PDF
Beyond Testing: Specs and Behavior Driven Development
Rabble .
 
PDF
David Parnas - Documentation Based Software Testing - SoftTest Ireland
David O'Dowd
 
utPLSQL: Unit Testing for Oracle PL/SQL
Steven Feuerstein
 
Bgoug 2019.11 test your pl sql - not your patience
Jacek Gebal
 
POUG2019 - Test your PL/SQL - your database will love you
Jacek Gebal
 
utplsql.pdf
vijayv991893
 
Six simple steps to unit testing happiness
Steven Feuerstein
 
#DOAW16 - DevOps@work Roma 2016 - Testing your databases
Alessandro Alpi
 
POUG Meetup 1st MArch 2019 - utPLSQL v3 - Testing Framework for PL/SQL
Jacek Gebal
 
Ukoug webinar - testing PLSQL APIs with utPLSQL v3
Jacek Gebal
 
SELJE_Database_Unit_Testing.pdf
Eric Selje
 
Why Unit Testingl
priya_trivedi
 
Why Unit Testingl
priya_trivedi
 
Why unit testingl
Priya Sharma
 
Agile db testing_techniques
Tarik Essawi
 
A testing framework for Microsoft SQL-Server
elliando dias
 
SELJE_Database_Unit_Testing_Slides.pdf
Eric Selje
 
Software testing: an introduction - 2017
XavierDevroey
 
Testing 101
Noam Barkai
 
DSR Testing (Part 1)
Steve Upton
 
Beyond Testing: Specs and Behavior Driven Development
Rabble .
 
David Parnas - Documentation Based Software Testing - SoftTest Ireland
David O'Dowd
 
Ad

More from Raimonds Simanovskis (20)

PDF
Profiling Mondrian MDX Requests in a Production Environment
Raimonds Simanovskis
 
PDF
Analyze and Visualize Git Log for Fun and Profit - DevTernity 2015
Raimonds Simanovskis
 
PDF
Data Warehouses and Multi-Dimensional Data Analysis
Raimonds Simanovskis
 
PDF
mondrian-olap JRuby library
Raimonds Simanovskis
 
PDF
Atvērto datu izmantošanas pieredze Latvijā
Raimonds Simanovskis
 
PDF
JavaScript Unit Testing with Jasmine
Raimonds Simanovskis
 
PDF
JRuby - Programmer's Best Friend on JVM
Raimonds Simanovskis
 
PDF
Agile Operations or How to sleep better at night
Raimonds Simanovskis
 
PDF
TDD - Why and How?
Raimonds Simanovskis
 
PDF
Analyze and Visualize Git Log for Fun and Profit
Raimonds Simanovskis
 
PDF
opendata.lv Case Study - Promote Open Data with Analytics and Visualizations
Raimonds Simanovskis
 
PDF
Extending Oracle E-Business Suite with Ruby on Rails
Raimonds Simanovskis
 
PDF
Rails-like JavaScript Using CoffeeScript, Backbone.js and Jasmine
Raimonds Simanovskis
 
PDF
RailsWayCon: Multidimensional Data Analysis with JRuby
Raimonds Simanovskis
 
PDF
Why Every Tester Should Learn Ruby
Raimonds Simanovskis
 
PDF
Multidimensional Data Analysis with JRuby
Raimonds Simanovskis
 
PDF
Rails on Oracle 2011
Raimonds Simanovskis
 
PDF
Rails-like JavaScript using CoffeeScript, Backbone.js and Jasmine
Raimonds Simanovskis
 
PDF
How to Adopt Agile at Your Organization
Raimonds Simanovskis
 
PDF
Multidimensional Data Analysis with Ruby (sample)
Raimonds Simanovskis
 
Profiling Mondrian MDX Requests in a Production Environment
Raimonds Simanovskis
 
Analyze and Visualize Git Log for Fun and Profit - DevTernity 2015
Raimonds Simanovskis
 
Data Warehouses and Multi-Dimensional Data Analysis
Raimonds Simanovskis
 
mondrian-olap JRuby library
Raimonds Simanovskis
 
Atvērto datu izmantošanas pieredze Latvijā
Raimonds Simanovskis
 
JavaScript Unit Testing with Jasmine
Raimonds Simanovskis
 
JRuby - Programmer's Best Friend on JVM
Raimonds Simanovskis
 
Agile Operations or How to sleep better at night
Raimonds Simanovskis
 
TDD - Why and How?
Raimonds Simanovskis
 
Analyze and Visualize Git Log for Fun and Profit
Raimonds Simanovskis
 
opendata.lv Case Study - Promote Open Data with Analytics and Visualizations
Raimonds Simanovskis
 
Extending Oracle E-Business Suite with Ruby on Rails
Raimonds Simanovskis
 
Rails-like JavaScript Using CoffeeScript, Backbone.js and Jasmine
Raimonds Simanovskis
 
RailsWayCon: Multidimensional Data Analysis with JRuby
Raimonds Simanovskis
 
Why Every Tester Should Learn Ruby
Raimonds Simanovskis
 
Multidimensional Data Analysis with JRuby
Raimonds Simanovskis
 
Rails on Oracle 2011
Raimonds Simanovskis
 
Rails-like JavaScript using CoffeeScript, Backbone.js and Jasmine
Raimonds Simanovskis
 
How to Adopt Agile at Your Organization
Raimonds Simanovskis
 
Multidimensional Data Analysis with Ruby (sample)
Raimonds Simanovskis
 

Recently uploaded (20)

PDF
Why aren't you using FME Flow's CPU Time?
Safe Software
 
PDF
Plugging AI into everything: Model Context Protocol Simplified.pdf
Abati Adewale
 
PDF
Unlocking FME Flow’s Potential: Architecture Design for Modern Enterprises
Safe Software
 
PDF
ArcGIS Utility Network Migration - The Hunter Water Story
Safe Software
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
 
PDF
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
PPTX
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
PDF
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
PDF
Database Benchmarking for Performance Masterclass: Session 1 - Benchmarking F...
ScyllaDB
 
PDF
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
Edge AI and Vision Alliance
 
PDF
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
PDF
How to Visualize the ​Spatio-Temporal Data Using CesiumJS​
SANGHEE SHIN
 
PDF
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
PDF
2025_06_18 - OpenMetadata Community Meeting.pdf
OpenMetadata
 
DOCX
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
PPTX
Curietech AI in action - Accelerate MuleSoft development
shyamraj55
 
PPTX
UserCon Belgium: Honey, VMware increased my bill
stijn40
 
PDF
LLM Search Readiness Audit - Dentsu x SEO Square - June 2025.pdf
Nick Samuel
 
PDF
Java 25 and Beyond - A Roadmap of Innovations
Ana-Maria Mihalceanu
 
Why aren't you using FME Flow's CPU Time?
Safe Software
 
Plugging AI into everything: Model Context Protocol Simplified.pdf
Abati Adewale
 
Unlocking FME Flow’s Potential: Architecture Design for Modern Enterprises
Safe Software
 
ArcGIS Utility Network Migration - The Hunter Water Story
Safe Software
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
 
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
Database Benchmarking for Performance Masterclass: Session 1 - Benchmarking F...
ScyllaDB
 
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
Edge AI and Vision Alliance
 
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
How to Visualize the ​Spatio-Temporal Data Using CesiumJS​
SANGHEE SHIN
 
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
2025_06_18 - OpenMetadata Community Meeting.pdf
OpenMetadata
 
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
Curietech AI in action - Accelerate MuleSoft development
shyamraj55
 
UserCon Belgium: Honey, VMware increased my bill
stijn40
 
LLM Search Readiness Audit - Dentsu x SEO Square - June 2025.pdf
Nick Samuel
 
Java 25 and Beyond - A Roadmap of Innovations
Ana-Maria Mihalceanu
 

PL/SQL unit testing with Ruby

  • 2. Raimonds Simanovskis github.com/rsim
  • 3. What is good code? Test Correct functionality! Test Fast enough performance! Test after Maintainable changes!
  • 4. How is it done? try something... dbms_output.put_line(...) it is obvious that there are no bugs :) testers should test, that’s their job
  • 5. What are typical problems? “trying” and not testing tests are not repeatable manual verification of results testing is done too late in development
  • 6. Types of tests unit tests integration tests programmer’s performance & load tests responsibility exploratory & usability tests
  • 7. Test Driven Development Write test Run test Write code Run test Refactoring
  • 8. Good unit tests Automatic, run fast Wide code coverage including edge cases Repeatable Independent from execution order Using real and understandable test data
  • 9. How to do it when programming in PL/SQL ?
  • 10. utPLSQL created by Steven Feuerstein, 1999 based on “xUnit”-style frameworks not maintained anymore :(
  • 11. Example Substring from start until end position
  • 12. Tests
  • 14. Visual testing tools Quest Code Tester SQL Developer 2.1
  • 15. Why used just by few? too large / too verbose test code? hard to read, too much noise? hard to test complex cases? no best practices how to write tests? nobody is using, why should I use?
  • 16. ruby-plsql-spec ideal language for writing tests RSpec powerful testing tools with “readable” syntax library for calling ruby-plsql PL/SQL procedures from Ruby
  • 18. Benefits compact, readable syntax powerful features also for complex tests best practices from Ruby community based on needs from real projects opensource – “free as in beer” :)
  • 19. Links http://blog.rayapps.com/2009/11/27/oracle- plsql-unit-testing-with-ruby/ http://blog.rayapps.com/2010/01/06/ screencasts-of-oracle-plsql-unit-testing-with- ruby/ http://github.com/rsim/ruby-plsql-spec