From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fcda7,71c35a0e73c110d5 X-Google-Attributes: gidfcda7,public X-Google-Thread: 1164f8,71c35a0e73c110d5 X-Google-Attributes: gid1164f8,public X-Google-Thread: 11035d,71c35a0e73c110d5 X-Google-Attributes: gid11035d,public X-Google-Thread: fa528,71c35a0e73c110d5 X-Google-Attributes: gidfa528,public X-Google-Thread: 10872d,71c35a0e73c110d5 X-Google-Attributes: gid10872d,public X-Google-Thread: 115614,71c35a0e73c110d5 X-Google-Attributes: gid115614,public X-Google-ArrivalTime: 2003-08-03 03:15:59 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-09!supernews.com!216.170.153.135.MISMATCH!tdsnet-transit!newspeer.tds.net!newsfeed.online.be!newsfeed01.sul.t-online.de!t-online.de!newspeer1-gui.server.ntli.net!ntli.net!newsfep1-win.server.ntli.net.POSTED!53ab2750!not-for-mail Message-ID: <3F2CE0CD.F7F6E3BF@ntlworld.com> From: "Dr. David Kirkby" X-Mailer: Mozilla 4.8 [en] (X11; U; SunOS 5.9 sun4u) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.sys.hp.hpux,comp.unix.tru64,comp.sys.dec,comp.unix.solaris,comp.sys.sgi.admin,comp.unix.aix Subject: Re: Free UNIX for non-commerical use. References: <3F233C74.4F4C3BAB@ntlworld.com> <3F2368E5.ED5037A0@hotmail.com> <3F23A005.83B7C2DA@hotmail.com> <3f23a698$0$15040$cc9e4d1f@news.dial.pipex.com> <3F251918.B861101C@ntlworld.com> <3F2C375C.F3C56116@ntlworld.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Date: Sun, 03 Aug 2003 11:15:41 +0100 NNTP-Posting-Host: 62.255.96.78 X-Complaints-To: abuse@ntlworld.com X-Trace: newsfep1-win.server.ntli.net 1059905748 62.255.96.78 (Sun, 03 Aug 2003 11:15:48 BST) NNTP-Posting-Date: Sun, 03 Aug 2003 11:15:48 BST Organization: ntlworld News Service Xref: archiver1.google.com comp.sys.hp.hpux:30074 comp.unix.tru64:10502 comp.sys.dec:16570 comp.unix.solaris:164624 comp.sys.sgi.admin:18880 comp.unix.aix:54285 Uli Link wrote: > > Automated testing can do a lot to help this. > > Agree. Let's take a closer look. > > > In an application I wrote, > > http://atlc.sourceforge.net/ > > a number of programs are used to automatically generate bitmaps. The > > md5 checksums of those bitmaps are then compared to what's expected. > > > > That's even closer. I think that is pretty close, given that a) I can visually check any bitmap at this point - they are simple, consisting of at most 3 colours, with straight lines or circles. b) Using Gimp to measure distances/diameters, makes it possible to ensure the bitmaps are what's expected. Sure, Gimp has bugs, but the chances of measuring a diameter in Gimp and it agreeing with what I expect, means its highly likely there no errors. The 1st, 3rd and 4th examples here http://atlc.sourceforge.net/ show the sort of thing I generate. So then I generate an md5 checksum of those. That's the easy bit. > > Once the bitmaps are generated, another floating point intensive > > program performs a numerically intensive finite difference computation > > on these bitmaps, generating some answers as text and some more > > bitmaps. The numerical answers are checked against those expected. The > > md5 checksums of the bitmaps are checked against those expected. > > > > When I say against 'what is expected' I'm comparing the results on a > > number of platforms, running a number of different operating systems > > using a number of different compilers at a number of different > > optimisation levels. > > Sounds like many, many hours of hard work needed before you know what is > expected. Yes, it is. I have probably spent 10x longer verifying the code than writing it! Of course while verifying it, bugs became appernt, so the two work in parallel to a certain extent. But one needs check carefully numerical/scientific programs as it's easy to generate data that is wrong and you not know it. I know of a student who was asked to re-submit his PhD after testing his code - he never re-submitted. If you build a word processor and it has a bug, it usually becomes very apparent. Do the same for a numerical simulation and it's often not the case. So careful testing is really important. I should have said I don't make a conserted effort to check the effect of optimistation on other than SPARC. If someone runs it on another platform and the results differ, then its up to them to play with the optimisation. But I verify the code passes all tests on all platforms I can. That has spotted a bug that was only apparent on 64-bit platforms and another only apperent when the default char was unsigned. First I set up some test cases, where exact analytical results can be computed - see http://atlc.sourceforge.net/accuracy.html if interested. If the numerical results of the program are close to the exact analytical results (1% errors are more than acceptable here. Better accuracy takes more CPU time, and is of no practical use.) So that allows me to check the numerical results. So I generate checksums for the important numerical results. The bitmaps generated here are less important, as they are only for visual inspection. They don't contain any scientifically accurate information. Binary data is written to contain accurate data. Testing that is more of a problem, and one I've not fully addressed. Once the bitmaps are generated, I generate checksums on a SPARC. Then test on other systems to see if the checksums agree. When they don't, I verify the the data is not too far off. In each case, only one pixel has been affected, so its easy to accept 2 different checksums. Obviously if there were lots, this would be impossible. > The other way round: expect _and_ accept insignificant differences. This > means defining borders within a result is accepted. Sort of. But by printing data to 4 significant figures with printf, that is quite easily. For the bitmaps, I need a bit more work. > Real problem are often more complex as at a first thought. Needs a lot of > investigation finding bitmaps similar but you cannot easy compare by > checksum. I know a lot of programmers avoiding floating point arithmetics > for much easier getting exact measurable results. > Fixed point is fine, but in my case not practical. > > However, it is easy to not think to write a specific test - only after > > you found a bug and realised my tests don't check for that problem. So > > I add a test to the testsuite. > > Every engineer must lern to check the fault bandwith together with the > measured results. True. But sometimes you don't easily realise the fault bandwidth, or know it is too large. If a program has 10 command line options, its easy to check those 10 in isolation. More difficult to test all 2^10 possible combinations. > It is impossible the prove a non-trivial programm as fault free, if built by > faulty compilers, complex programming languages, and libs by human. True, but by careful testing on one platform and checking the results on others don't differ significantly, one has a high degree of confidence in the results. > To my expierience the greatest problem in software projects is, that there > are no expected results specified, before delivery to test. I avoid that. I can compute analytical results in some case, as described at http://atlc.sourceforge.net/accuracy.html So many tests are against these analytical results. > All this is complex enough with a single thread, and then you will need to > test with mass data for deadlocks between threads. One of the issues I came across was when using different algorithms for single and multi-threaded cases. The multi-threaded case would always converge to a very slightly different result. Not much, perhaps 0.001%, but when that happens on a lots of tests, it makes testing impossible. The other issue was the results on multi-threaded case depended on the number of threads run. Again, very small, but it would have made sensible testing impossible, when numerous pixels in numerous bitmaps would depend on how many CPUs the system had. Hence I changed the algorithm to one where the results are entirely identical on single-threaded and multi-threaded and the results are independent of the number of threads run. I loose a bit of speed because of this, but its the only way to make testing practical. > Don't believe in missile guidance systems or a recent > upperclass automobile, not even those from Germany. > Too much secrets and too much political-strategic-struggles concerning > individuals career to give quality a chance. And (too much) > formalism _can_ > kill the individuals responsibility for the quality of its work. > The absence of those factors is perhaps the greatest influence on the > quality of open source development. I can believe that, although I've never worked in such an environment, I have no experience of it. -- Dr. David Kirkby, Senior Research Fellow, Department of Medical Physics, University College London, 11-20 Capper St, London, WC1E 6JA. Tel: 020 7679 6408 Fax: 020 7679 6269 Internal telephone: ext 46408 e-mail davek@medphys.ucl.ac.uk