Automated testing...
-
I've been thinking "Ah, that's nice. In theory!" about software unit testing. Until now. :) I've implemented a VBScript scripting host in my app, which allows me to automate input to the app. The app (a POS application) does a series of operations based on the input, and outputs information to database (not counting receipts, and other types of "hard copy" output, which I unfortunately have to test by hand). I predict the output by calculating the output in beforehand in my VBScripts. I then compare the output in the database with my predictions. If there are any deviations from my predictions, I sound the alarm. I've just completed a couple of thousands of tests - a task which would normally have taken me many weeks to do by hand. Admittedly, this is not very fine grained module testing. It's basically seeing the entire app as a black box. But it's better than nothing, and I have already nailed two "once in a blue moon" bugs. Other than that, I think I'm very close to a release. :cool: ps. It's also a great way to stress test your app. After 2000 transactions - no memory leak. Take that, you janitor dependent programmers! :rolleyes: ds.
-- Verletzen zerfetzen zersetzen zerstören Doch es darf nicht mir gehören Ich muss zerstören
-
what you're describing is functional testing, not unit testing. -- Rules of thumb should not be taken for the whole hand.
dan neely wrote:
what you're describing is functional testing, not unit testing.
True, but at least he is testing!!! :-D
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
-
I've been thinking "Ah, that's nice. In theory!" about software unit testing. Until now. :) I've implemented a VBScript scripting host in my app, which allows me to automate input to the app. The app (a POS application) does a series of operations based on the input, and outputs information to database (not counting receipts, and other types of "hard copy" output, which I unfortunately have to test by hand). I predict the output by calculating the output in beforehand in my VBScripts. I then compare the output in the database with my predictions. If there are any deviations from my predictions, I sound the alarm. I've just completed a couple of thousands of tests - a task which would normally have taken me many weeks to do by hand. Admittedly, this is not very fine grained module testing. It's basically seeing the entire app as a black box. But it's better than nothing, and I have already nailed two "once in a blue moon" bugs. Other than that, I think I'm very close to a release. :cool: ps. It's also a great way to stress test your app. After 2000 transactions - no memory leak. Take that, you janitor dependent programmers! :rolleyes: ds.
-- Verletzen zerfetzen zersetzen zerstören Doch es darf nicht mir gehören Ich muss zerstören
Joergen Sigvardsson wrote:
nd other types of "hard copy" output, which I unfortunately have to test by hand
One of my main apps is a form printing engine, and I wrote some custom test software that involves outputting the forms to PDFs (via a special PDF print driver), and then comparing the PDF against a known good version. Works like a charm and has saved my bacon on more than one occasion.
-
Joergen Sigvardsson wrote:
a POS application
Aw. Don't be so hard on yourself, Joergen. It can't be that bad. ;P
And I get on my knees and pray We don't get fooled again
:laugh: :laugh:
-- Verletzen zerfetzen zersetzen zerstören Doch es darf nicht mir gehören Ich muss zerstören
-
what you're describing is functional testing, not unit testing. -- Rules of thumb should not be taken for the whole hand.
So, unit testing doesn't test for correct functionality..? :~ I honestly never understood the difference between functional testing and unit testing, other than that unit testing often means testing very small pieces of code, while functional testing means testing a larger pieces of code.
-- Verletzen zerfetzen zersetzen zerstören Doch es darf nicht mir gehören Ich muss zerstören
-
Joergen Sigvardsson wrote:
nd other types of "hard copy" output, which I unfortunately have to test by hand
One of my main apps is a form printing engine, and I wrote some custom test software that involves outputting the forms to PDFs (via a special PDF print driver), and then comparing the PDF against a known good version. Works like a charm and has saved my bacon on more than one occasion.
You just gave me an idea! In the debug build, I actually output printouts as bitmaps. Maybe if I stream it to disc... thanks for the idea man! Much appreciated!
-- Verletzen zerfetzen zersetzen zerstören Doch es darf nicht mir gehören Ich muss zerstören
-
I've been thinking "Ah, that's nice. In theory!" about software unit testing. Until now. :) I've implemented a VBScript scripting host in my app, which allows me to automate input to the app. The app (a POS application) does a series of operations based on the input, and outputs information to database (not counting receipts, and other types of "hard copy" output, which I unfortunately have to test by hand). I predict the output by calculating the output in beforehand in my VBScripts. I then compare the output in the database with my predictions. If there are any deviations from my predictions, I sound the alarm. I've just completed a couple of thousands of tests - a task which would normally have taken me many weeks to do by hand. Admittedly, this is not very fine grained module testing. It's basically seeing the entire app as a black box. But it's better than nothing, and I have already nailed two "once in a blue moon" bugs. Other than that, I think I'm very close to a release. :cool: ps. It's also a great way to stress test your app. After 2000 transactions - no memory leak. Take that, you janitor dependent programmers! :rolleyes: ds.
-- Verletzen zerfetzen zersetzen zerstören Doch es darf nicht mir gehören Ich muss zerstören
-
So, unit testing doesn't test for correct functionality..? :~ I honestly never understood the difference between functional testing and unit testing, other than that unit testing often means testing very small pieces of code, while functional testing means testing a larger pieces of code.
-- Verletzen zerfetzen zersetzen zerstören Doch es darf nicht mir gehören Ich muss zerstören
Joergen Sigvardsson wrote:
I honestly never understood the difference between functional testing and unit testing, other than that unit testing often means testing very small pieces of code, while functional testing means testing a larger pieces of code.
well...... close. Functional testing simulates user interaction or external influence, I/O with the outside world. Although you can look at unit testing as the same thing, and some people do. Basically unit testing should test a "unit" a piece of stand-alone code for correctness. Does the compression routine compress, does the decompression routine decompress based on a variety of samples of input data. Does the network class send, does it receive, does it calculate a CRC32, etc. A functional test is similar except it is usually applied to larger class groupings or full applications. If you are simulating mouse clicks, data entry, data transmission/receipt to an entire program to stimulate final-functionality then you are doing a functional test. The problem comes with noun-verb use of function. A functional test refers to the verb use of function, not the noun. Unit tests referse to the noun version of function. Since programmers love analogies: using a car as an example, a functionality test is test-driving a car after building it, a unit test would be making sure a wheel or gear moves, tubes hold heat/pressure to spec and pistons fire at correct timing, etc.
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
-
So, unit testing doesn't test for correct functionality..? :~ I honestly never understood the difference between functional testing and unit testing, other than that unit testing often means testing very small pieces of code, while functional testing means testing a larger pieces of code.
-- Verletzen zerfetzen zersetzen zerstören Doch es darf nicht mir gehören Ich muss zerstören
Unit testing, if a maner of testing functionalities. (At least it's my concept :p). It is the phylosophy to test a functionality in little portions. So basically it is not the same, but Unit testing is a way to test functionnalities. But if you were not testing func what are you testing?
-
I've been thinking "Ah, that's nice. In theory!" about software unit testing. Until now. :) I've implemented a VBScript scripting host in my app, which allows me to automate input to the app. The app (a POS application) does a series of operations based on the input, and outputs information to database (not counting receipts, and other types of "hard copy" output, which I unfortunately have to test by hand). I predict the output by calculating the output in beforehand in my VBScripts. I then compare the output in the database with my predictions. If there are any deviations from my predictions, I sound the alarm. I've just completed a couple of thousands of tests - a task which would normally have taken me many weeks to do by hand. Admittedly, this is not very fine grained module testing. It's basically seeing the entire app as a black box. But it's better than nothing, and I have already nailed two "once in a blue moon" bugs. Other than that, I think I'm very close to a release. :cool: ps. It's also a great way to stress test your app. After 2000 transactions - no memory leak. Take that, you janitor dependent programmers! :rolleyes: ds.
-- Verletzen zerfetzen zersetzen zerstören Doch es darf nicht mir gehören Ich muss zerstören
Joergen Sigvardsson wrote:
The app (a POS application)...
This is unrelated (as most of my posts are) but around these parts, POS stands for "piece of sh*t" so whenever I see that I have to reread it! :laugh: Cheers! Mark
-
Joergen Sigvardsson wrote:
The app (a POS application)...
This is unrelated (as most of my posts are) but around these parts, POS stands for "piece of sh*t" so whenever I see that I have to reread it! :laugh: Cheers! Mark
Best thing I had was a job I was looking into that included support and deployment of POS systems to end users:laugh: I too had to reread it at first. I was thinking, "Boy, they sure do have a high opinion of their product";P
------------------------------------- Do not do what has already been done. Absolute power corrupts absolutely.. but it ROCKS absolutely, too.
-
So, unit testing doesn't test for correct functionality..? :~ I honestly never understood the difference between functional testing and unit testing, other than that unit testing often means testing very small pieces of code, while functional testing means testing a larger pieces of code.
-- Verletzen zerfetzen zersetzen zerstören Doch es darf nicht mir gehören Ich muss zerstören
<kidding> unit test -> the programmer's tests integration test -> the test guys job :) </kidding> ... Well, of course if this is a project of one...
-
I really like unit testing. It also covers you from other programmers breaking your code, and blaming it on you. You have proof that you code passed the unit test before they touched it.
ednrgc wrote:
You have proof that you code passed the unit test before they touched it.
Don't you have your code in a revision controls system? Other dev, or you break the code, roll it back. :)
My Blog A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects. - -Lazarus Long
-
ednrgc wrote:
You have proof that you code passed the unit test before they touched it.
Don't you have your code in a revision controls system? Other dev, or you break the code, roll it back. :)
My Blog A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects. - -Lazarus Long
-
dan neely wrote:
what you're describing is functional testing, not unit testing.
True, but at least he is testing!!! :-D
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
-
what you're describing is functional testing, not unit testing. -- Rules of thumb should not be taken for the whole hand.
dan neely wrote:
what you're describing is functional testing, not unit testing.
That's an interesting point. When does unit testing cross over into functional testing? Or does it ever? In other words, if I test anything but my lowest level classes and methods, does that mean I'm now doing functional testing? Marc
People are just notoriously impossible. --DavidCrow
There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith -
Joergen Sigvardsson wrote:
The app (a POS application)...
This is unrelated (as most of my posts are) but around these parts, POS stands for "piece of sh*t" so whenever I see that I have to reread it! :laugh: Cheers! Mark
Mark Salsbery wrote:
but around these parts, POS stands for "piece of sh*t"
yup, in the business community it refers to Point-Of-Sale, which is a generalized term for capturing information at a remote sale location (gas station for instance, I was in the POS gasoline sales before transferring to Engineering with another company). Ironically, either definition works with POS even in the business community. ;) which was why I jumped ship and went to engineering instead of staying in accounting.
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
-
Jeffry J. Brickley wrote:
True, but at least he is testing!!!
Which is why I ed him, instead ofing. -- Rules of thumb should not be taken for the whole hand.
dan neely wrote:
Which is why I ed him, instead ofing.
true... but the worst thing about nit picking... is you end up with a handfull of nits.... :rolleyes:
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
-
Mark Salsbery wrote:
but around these parts, POS stands for "piece of sh*t"
yup, in the business community it refers to Point-Of-Sale, which is a generalized term for capturing information at a remote sale location (gas station for instance, I was in the POS gasoline sales before transferring to Engineering with another company). Ironically, either definition works with POS even in the business community. ;) which was why I jumped ship and went to engineering instead of staying in accounting.
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
Jeffry J. Brickley wrote:
Ironically, either definition works with POS even in the business community.
:laugh:
-
I've been thinking "Ah, that's nice. In theory!" about software unit testing. Until now. :) I've implemented a VBScript scripting host in my app, which allows me to automate input to the app. The app (a POS application) does a series of operations based on the input, and outputs information to database (not counting receipts, and other types of "hard copy" output, which I unfortunately have to test by hand). I predict the output by calculating the output in beforehand in my VBScripts. I then compare the output in the database with my predictions. If there are any deviations from my predictions, I sound the alarm. I've just completed a couple of thousands of tests - a task which would normally have taken me many weeks to do by hand. Admittedly, this is not very fine grained module testing. It's basically seeing the entire app as a black box. But it's better than nothing, and I have already nailed two "once in a blue moon" bugs. Other than that, I think I'm very close to a release. :cool: ps. It's also a great way to stress test your app. After 2000 transactions - no memory leak. Take that, you janitor dependent programmers! :rolleyes: ds.
-- Verletzen zerfetzen zersetzen zerstören Doch es darf nicht mir gehören Ich muss zerstören
We've used automated testing for various specific situations (for example, determining the worst case execution times of function - this was with real-time embedded systems, where worst case execution times are important). But this[^] is my favourite automatic testing system (albeit for a non-mainstream language). Define properties you believe should hold true, and they'll be tested automatically.