Before you add salt taste it
Over the last couple of weeks, I have been struggling with learning Test Driven Development(TDD). What is test driven development you ask, well its a kind of process in web development where you write tests that fail before writing your code that will make the tests pass. It’s a continuous process that developers follow until they are satisfied that their app works as intended before releasing it.
My challenge was in implementing TDD in flask, a python micro-framework.
I encountered it when we were told to write tests for our flasks APIs and I felt like it was a waste of time, I mean why should I write tests yet am sure my app works and on top of that I have to write the tests before writing my code, how?
Even though I had come across flask before, writing tests was still a challenge because most of the learning resources I was using didn’t cover testing flask apps and the ones that I could find online didn’t explain the topic in depth. It was challenging at first as I knew I could make a simple flask app after viewing countless videos on youtube but why was I struggling with writing tests.
Get Steve Obaga’s stories in your inbox
Join Medium for free to get updates from this writer.
Recognizing that the old knowledge I had didn’t really help me tackle the issue of testing and for me to learn and understand, I had to unlearn so that I can learn from a different approach or to put it in simple terms I had to learn to unlearn then relearn.
In order to learn from a different perspective, I began by checking other peoples code and going through them, from one line to the next and referring to the flask documentation when I saw something that I didn’t quite understand. An unethical method to learn but it proved fruitful as I began to grasp some concepts and little by little I began to make some progress.
As with all journeys, the first step is always crucial and it doesn’t matter how slowly you go as long as you do not stop.
It doesn’t matter how slowly you go as long as you do not stop.
I can’t say am an expert at TDD but am on my way there, as I view every day is a new day to learn something new and that’s what makes life a little bit interesting, as there’s no better feeling like that of achieving something that you couldn’t do before.





