Without compilation, how to find bugs?

Ben Finney ben+python at benfinney.id.au
Thu Oct 13 20:01:14 EDT 2016


pozz <pozzugno at gmail.com> writes:

> All the tricks have a common goal: to discover bugs as soon as
> possible, mostly during compilation process. Indeed I usually find
> some bugs during compilation (or static analysis). It seems to me very
> important.

Do you also use static code analysis? Do you find that static code
analysis finds many types of bugs that compilation could not find?

Do you always write use unit tests for the code you write? For the
existing code you change? Do you specify the unit tests so that they
each assert one specific thing about the function's behaviour, and fail
unambiguously when that's not the observed behaviour?

Do you aim for complete unit test coverage of all branches in your code?
Do you treat un-covered code as dangerously unpredictable code?

If your answer is “no” to any of those, I think you may have a good
answer to your overall question :-)

-- 
 \       “A poet can survive everything but a misprint.” —Oscar Wilde, |
  `\                           _The Children of the Poets_, 1886-10-14 |
_o__)                                                                  |
Ben Finney




More information about the Python-list mailing list