Article: The art of the small test program

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

Article: The art of the small test program

#1 Post 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.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#2 Post by musher0 »

Very interesting... Shouldn't this article also be e-mailed to every Puppy developer? :)

BFN.

musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#3 Post 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:

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#4 Post by musher0 »

Hi, Flash.

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

musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#5 Post 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!

User avatar
Ted Dog
Posts: 3965
Joined: Wed 14 Sep 2005, 02:35
Location: Heart of Texas

#6 Post 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.

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#7 Post 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:

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#8 Post 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.
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#9 Post 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 !)
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#10 Post 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.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#11 Post 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.

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#12 Post 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.

Post Reply