testingdebuggingprofilingand tuning nlike programs in languages such as or javapython programs are not processed by compiler that produces an executable program in those languagesthe compiler is the first line of defense against programming errors--catching mistakes such as calling functions with the wrong number of arguments or assigning improper values to variables (that istype checkingin pythonhoweverthese kinds of checks do not occur until program runs because of thisyou will never really know if your program is correct until you run and test it not only thatunless you are able to run your program in way that executes every possible branch of its internal control-flowthere is always some chance of hidden error just waiting to strike (fortunatelythis usually only happens few days after shippinghoweverto address these kinds of problemsthis covers techniques and library modules used to testdebugand profile python code at the endsome strategies for optimizing python code are discussed documentation strings and the doctest module if the first line of functionclassor module is stringthat string is known as documentation string the inclusion of documentation strings is considered good style because these strings are used to supply information to python software development tools for examplethe help(command inspects documentation stringsand python ides look at the strings as well because programmers tend to view documentation strings while experimenting in the interactive shellit is common for the strings to include short interactive examples for examplesplitter py def split(linetypes=nonedelimiter=none)"""splits line of text and optionally performs type conversion for examplesplit('goog '['goog'' '' 'split('goog ',[strintfloat]['goog' lib fl ff