we hate to bring this upbut dr pangloss was wrong we do not live in "the best of all possible worlds there are some places where it rains too littleand others where it rains too much some places are too coldsome too hotand some too hot in the summer and too cold in the winter sometimes the stock market goes down-- lot andperhaps worst of allour programs don' always function properly the first time we run them books have been written about how to deal with this last problemand there is lot to be learned from reading these books howeverin the interest of providing you with some hints that might help you get that next problem set in on timethis provides highly condensed discussion of the topic while all of the programming examples are in pythonthe general principles are applicable to getting any complex system to work testing is the process of running program to try and ascertain whether or not it works as intended debugging is the process of trying to fix program that you already know does not work as intended testing and debugging are not processes that you should begin to think about after program has been built good programmers design their programs in ways that make them easier to test and debug the key to doing this is breaking the program up into separate components that can be implementedtestedand debugged independently of other components at this point in the bookwe have discussed only one mechanism for modularizing programsthe function sofor nowall of our examples will be based around functions when we get to other mechanismsin particular classeswe will return to some of the topics covered in this the first step in getting program to work is getting the language system to agree to run it--that iseliminating syntax errors and static semantic errors that can be detected without running the program if you haven' gotten past that point in your programmingyou're not ready for this spend bit more time working on small programsand then come back testing the most important thing to say about testing is that its purpose is to show that bugs existnot to show that program is bug-free to quote edsger dijkstra"program testing can be used to show the presence of bugsbut never to show their absence!" oras albert einstein reputedly once said"no amount of experimentation can ever prove me righta single experiment can prove me wrong "notes on structured programming,technical university eindhovent report wsk- april