Is Type Tracing for Python Useful? Some Experiments
renesd.blogspot.com
renesd.blogspot.com
However, my main use for this so far has been for old python 1.5-2 programs (some 15 years old) with not much typing at all. Adding limited type information for methods seems useful for helping the static checkers as well in these cases. The division errors in the blog post were based on real bugs it found inside class methods for example. I bet there are lots of corner cases I haven't tripped over yet however. I wouldn't be surprised with dynamic python that it could cause quite a lot of problems. Python can get pretty fancy. I told it to ignore all 'self' variables for example.
I think basing it on the coverage tool helped avoid a lot of problems. Because they have already done the hard parts of getting the tracing to only happen on user code. If you don't trace into libraries, and only do user code the task becomes 7 million times easier.
We found that auto-documentation via these kinds of run-time traces is really powerful. If you add in a bit of centralization (connecting traces across many users), this can also be a useful way to capture bugs or unforeseen behavior.
It does seem like there's a lot more very useful tools which could be made from the data we already have. Bug databases combined with commits are also filled with useful information. It does seem you can train a classifier for certain bugs from just those features.
I think the "Auto Complete from stack overflow" and related stuff from early 2016 was also pretty neat, in that it didn't use trace info, but more normal text search methods. But was surprisingly useful none the less.