Recently asked on the OTN PL/SQL forum:
I am reading a book: Learning Oracle PL/SQL by Bill Pribyl and Steven Feuerstein.
I am a newbie of PL/SQL and I got no other programming XPs. but in the very first of this book they are introducing something called: testing, to make some test programms /utilites.
I found that is very hard to make, is it neccessary?
Apparently, after you've typed the final semicolon, you can either sit back and open a beer with the satisfaction of a job well done, or you can check whether the thing works. And apparently it's hard, so, do we really have to?
Well, another poster was recently arguing that PL/SQL is not suited to unit testing anyway, or refactoring either for that matter, because it isn't object oriented. I think that will be my excuse from now on. You want me to test stuff, go make PL/SQL more objecty.
9 comments:
Hi William
Being a former plsql developer, this is pre-SQLDeveloper - for which I have not checked out its plsql debugging capabilities. I used SQLNavigator - Oracle of course no longer licenses it for development - but back in the day it was the best thing since sliced bread for me to be able to test and debug the huge financial packages I used to maintain.
He wasn't asking about tools, he was asking what testing is, and noting that it looked pretty hard.
This would be a WTF were it not a real problem in the industry. This sounds like a good representation of the status quo.
There is a widespread conception that testing database code is somehow difficult.
I overheard a conversation yesterday between a so-called expert and someone else who said that certain code should be moved out of the database into C# because it could then be refactored and tested properly
Essentially, testing and TDD is an approach, regardless of technology.
Even if you were to do a whole MVC approach in a single language/tier such as PL/SQL, you would separate the responsibilities.
Apologies, I've gone all serious in what's meant to be a humourous forum.
Another confirmation of the wisdom of my decision to get out of the development and design scene...
With this level of posts in OTN, it also reminded me why I never frequented that forum!
I must admit, I like the whole notion of faith based development ( see William's comment on the OTN thread). I can see it now...
The fundamentalist: 'It must work, because it says so in the design'
The agnostic 'Im sorry, I just don't think that is possible to know if it works due to the subjectivity of the testing process'
Church of england tester 'well, it does work, kind of, but only on Sundays'
You could always round up all the people who thought it didn't work, and stone them.
"There is a widespread conception that testing database code is somehow difficult."
A valid widespread conception.
The problem with testing, as pointed out by your namesake Frederick P. is that not only is testing extremely difficult, but it also isn't any fun.
Rubik's Cube is a classic example of how geometric problem solving can provide hours of entertainment to the appropriately aligned brain, whereas providing a rigorous proof that your method of arriving at the solution is either correct or approximately efficient
...is years of labour worthy of a major international mathematical prize.
The Rubik's cube is just 27 plastic squares.
Procedural SQL is comparatively boundless.
This really depends on one's point of view, doesn't it?
If one assumes that the mathematical correctness of one's solution can be expressed in terms of set theory ( not an unreasonable assumption for a relational database based solution ), then one could prove the mathematical soundness of the algorithms employed using a tool such as Z, if not the actual concrete implementation of the underlying technology....could one not?
and anyway, is it just me or is the use of the word 'conception' here, although technically correct, a little odd...or perhaps my brain is just not appropriately aligned.
Post a Comment