Blog of Rob Galanakis (@robgalanakis)

testing

Passing around complex objects is the opposite of encapsulation

I see this a lot: class Foo: spam = None eggs = None def frob(foo): return sprocket(str(foo.eggs)) f = Foo() s = frob(f) It tends to be more sinister, and difficult to see, in verbose examples. But generally it is easily identified by the called method using a single...

Read more

Python logging best practices

Logging is one of those things that, being orthogonal to actually getting something done, many developers fail to learn the nuances of. So I want to go over a few things I had to learn the hard way: We are blessed in the python community because we have the wonderful ‘logging’...

Read more

Run/debug your way to brittle software!

While working on pynocle some time ago, I found myself getting away from TDD and going back to the more traditional “run-debug-fix” pattern.  Write code you think is correct, run it to see if it is, if it isn’t, stick a breakpoint and see what’s wrong, change code, repeat until...

Read more

Validation routines as an intro to unit testing

For the past several weeks I’ve been introducing TDD and a focus on unit testing at work to the TA group.  Well I introduced it months ago but am now just convincing (forcing) people to do it.  This can be an imposing subject for people that have spent their...

Read more

Pynocle update

New pynocle uploaded to google code (not PyPI yet). In this is a much better dependency graph rendering, module filename resolution, optimizations (such as only calculating dependency data and filename resolutions once), replacing imports with AST, and other improvements. However I took out the ability to run pynocle over...

Read more

Python software metrics- my first useful OS project?

I’ve tried to open-source code quite a few times, but the projects have been niche enough that they haven’t been very useful.  Well, I finally have something universally useful. I’ve take an interest in code metrics recently (as documented on this blog) and I have been quite upset to learn...

Read more

Relearning python, day 3

The last few days were spent re-organizing my code and writing unit tests.  Here’s what I learned: I was still spending too much time thinking about namespaces, privateness, interfaces, and organization.  Once I got rid of some ‘abstract’ classes that served no purpose (they’re not meant to be subclassed...

Read more

1 2 3 4