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.
Article: The art of the small test program
Article: The art of the small test program
The art of the small test program
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?
"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!
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!
Not that hard if that developer's next meal depends on it.Flash wrote:How hard could it be?
Ted Dog, you always speak in riddles.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.
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]
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
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.
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].
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.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.
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.