Testable Code

For the past month or two, I’ve been almost completely absorbed by the idea of writing testable code. Dependency injection and unit tests have been on my mind a lot as I have tried to ensure that the code I produce is, not only of top notch quality to begin with, but easily testable.

Yesterday evening, when I got home from installing and demoing the system we developed as a school project (I might write something about that later), I signed on to YouTube and checked my subscriptions and recommended videos. One video in particular caught my eye – “The Clean Code Talks — Inheritance, Polymorphism, & Testing”. In the video, a Google employee called Miško Hevery talked about ways to keep your code clean and testable. He proposed that one should try to limit ones usage of IF-statements and, where applicable, utilize polymorphism instead. I found the video very intriguing and decided to search for more talks by Mr Hevery. Since yesterday evening, I have watched several of his talks and found his ideas really interesting, but coming from a coding background where I’ve been using patterns like Singletons and barely ever writing unit tests for my code, it will probably take some time for me to adapt.

This entry was posted in General. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *