Your SlideShare is downloading. ×
PL/SQL unit testing with Ruby
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

PL/SQL unit testing with Ruby

2,784
views

Published on

Presentation at EMEA Harmony Oracle user groups conference in Tallinn

Presentation at EMEA Harmony Oracle user groups conference in Tallinn

Published in: Technology

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,784
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
27
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. 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
  • 13. Results
  • 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
  • 17. ruby-plsql-spec Demo
  • 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