Page 1 of 1

Article: The art of the small test program

Posted: Tue 11 Jun 2013, 20:16
by Flash
The art of the small test program
By Chip Camden
June 6, 2013, 6:49 PM PDT

Takeaway: When your application fails, Chip Camden suggests creating a Small Test Program because it will help vendors and developers help you. Here’s what is involved in creating such programs.

Posted: Tue 11 Jun 2013, 22:49
by musher0
Very interesting... Shouldn't this article also be e-mailed to every Puppy developer? :)

BFN.

musher0

Posted: Wed 12 Jun 2013, 02:28
by Flash
I was hoping to get a discussion started about how developers might write a small test program and make it available with their application program if anyone wanted to use it. Perhaps it could give the app a workout and save the test results in a file that could be sent to the developer. How hard could it be? :roll:

Posted: Wed 12 Jun 2013, 04:47
by musher0
Hi, Flash.

I'm too tired to be brilliant at this time of night! :)
TWYL.

musher0

Posted: Thu 13 Jun 2013, 06:27
by amigo
"How hard could it be?" Actually, unit tests are at least as hard to write as the code itself -one must really understand what the code is supposed to do and create tests which prove or disprove the assumptions made about the code block.

I'm afraid there aren't more than a couple of folks here who could really do such work -on their own projects, I mean. Writing tests for other people's code means you need to be smarter than the guy who wrote the code. Writing tests for your own code means you only have to be smarter than yourself!

Posted: Thu 13 Jun 2013, 11:29
by Ted Dog
Peano's Axioms gave me a methodology of program testing which has served me well,


It's related to Number Theory in advanced mathematics, but as its applied to programing test cases, you really only need 6 test cases for each block of linear code, case switch, loop or function call.

Posted: Thu 13 Jun 2013, 11:53
by Karl Godt
amigo wrote:I mean. Writing tests for other people's code means you need to be smarter than the guy who wrote the code. Writing tests for your own code means you only have to be smarter than yourself!
Think that will be one of the top-10 of wisdom thoughts of the year. My top nr 1 it is ! :lol:

Posted: Thu 13 Jun 2013, 14:53
by jamesbond
Flash wrote:How hard could it be? :roll:
Not that hard if that developer's next meal depends on it.
Ted Dog wrote:Peano's Axioms gave me a methodology of program testing which has served me well,


It's related to Number Theory in advanced mathematics, but as its applied to programing test cases, you really only need 6 test cases for each block of linear code, case switch, loop or function call.
Ted Dog, you always speak in riddles.
Care to elaborate?

===

Anyway, to put it into the context, the article talks about a "developer-user" making test cases for the "developer-developer". For example, it's for people like a game developer who uses Java and find bugs in Java. The article advises that the game developer create small test cases to demonstrate the bugs and send to that to the developer of Java (Oracle) so that Oracle engineers can or is encouraged to fix that bugs.

It is not talking about the general end-user at all, nor does it encourage developers (of any sort) to ship "unit testing code" with their stuff.

Posted: Thu 13 Jun 2013, 15:28
by musher0
One big and quite logical problem is mentioned in the article :
you cannot know what you don't know... (Corollary: if you did, you'd know where to look for the bugs, and there would be no bugs left !)

Posted: Fri 14 Jun 2013, 10:35
by technosaurus
to write a test you only need to know the desired output for a given input. this requires that you compute the desired output, you could just as easily make the same mistake.... but as long as you double check the common cases and the extremes, you should be fine.

in highly important systems it is common to have multiple algorithms typically written by separate programmers and require agreement between them.

Posted: Fri 14 Jun 2013, 17:09
by jpeps
technosaurus wrote:to write a test you only need to know the desired output for a given input. this requires that you compute the desired output, you could just as easily make the same mistake.... but as long as you double check the common cases and the extremes, you should be fine.

in highly important systems it is common to have multiple algorithms typically written by separate programmers and require agreement between them.
Test classes are built in to UI's like Eclipse for Java and Android programming. Often the method tests are written before the actual method is coded. If a test "fails" when it is run, it shows the actual vs desired output. If the method doesn't exist yet, you can right click and it will be automatically inserted into the code. The tests would cover multiple possible user inputs.

I could see how a developer might include a test checklist when asking others to run his app on other hardware. The only way to find unknown foreseen bugs would be to distribute the app to other developers/users prior to releasing it to the public. I think this is standard procedure for professional developers.

Posted: Sat 15 Jun 2013, 07:33
by sunburnt
Several apps. I posted here had test apps. ( or example demos.) for them.

And one I`m finishing now is complex enough it required a fully fledged test app. to develop it.

As JamesBond points out, Flash`s article link is involved a bit further, but is still applicable.