Sitemap
Frank Gitau

Frank Gitau

GROWTH MINDSET AND MY TIME LEARNING TDD

6 min readSep 24, 2018

Let me begin by stating how much I cursed whoever thought Test Driven Development (TDD) was a good idea. Whoever thought about making TDD a standard in programming convention for the rest of us? That was my feeling regarding this approach to programming when I was forced to implement it in a recent project for a fellowship I intended to join.

I had been coding (Notice I am not calling it programming for programming is an art and what I was doing was child’s play at best) for a while usually for data analysis. I used to write procedural code for statistical models in R and later in python. None of my supervisors during this exercises ever expected any of the proper programming conventions usually applied in computer science to be followed partly because they didn’t know them and partly because they did not care. There was no OOP (Object Oriented Programming), no version control, no continuous Integration, no deployment or TDD. All that was expected was functionality at the end of the day. As long as the model yielded the least MAE or RMSE. As long as the AIC score and the likelihood function were statistically attractive then it did not matter.

Personally, however, I did not feel content with the code quality. I did not feel it was the best I could do. With time, I mastered OOP and started applying it in my scripts. The impact of this was astounding. Suddenly my code was reusable across projects and easier to debug. I could maintain it easily and I could brag about my code. I started focusing on the efficiency of the code. Making sure that I could analyse large data-sets in the most efficient way. In my mind, I was writing quality code and delivering it with the desired functionality.

Now here comes a new fellowship opportunity. An opportunity that clearly states that if I am to join it I have to master TDD amongst other disciplines. The thing about TDD is that tests drive development. One has to write tests first and then write code to satisfy the tests. Who in their right minds think that is a logical approach. That one will write a test for code that does not exist. That I will write test cases for different scenarios fully expecting them to fail up until I finish writing the code. I abhorred this. I cursed the mind that conceptualized this cumbersome approach.

Nonetheless, I buckled up, put on my big boy pants and got to it. I labored through setting up pytest and the associated test cases for some functionality I was working on. I think one of the biggest smiles to ever wash over my face was when for the first time, I saw code test coverage of 95% on my console. The feeling then was of joy for having conquered this seemingly monstrous task. In addition, I had just discovered a programming secret that was long hidden in plain sight; an ability to cut debugging time by half. Here I was testing every piece of code in my project and easily identifying bugs by identifying the test failures. I naturally settled into a pattern where my tests grew alongside my code and I was loving it.

Right now if you ask me, I do not know why I was so opposed to this new approach. It had multiple benefits and a negligible cost in terms of the time taken to write tests. My initial reluctance to learn it because it was cumbersome was replaced by my eagerness to apply it to each project I implemented. Such is the benefit of a growth mind-set as opposed to a fixed mind-set.

That said,a common question that comes up in life is regarding intelligence, its nature .Is it static or dynamic. Is effort a substitute for raw talent? Many could argue for either cases and could propose an entire array of argument has and counter arguments. Some of the prolific names that might be mentioned in this discussion might be Messi vs Ronaldo and Elon Musk vs normal people. In the case for Messi vs Ronaldo, some may suggest that Ronaldo’s obvious effort and the success resulting from said effort are a sufficient justification for effort and others may argue that Messi’s raw talent makes him the greatest footballer.

Get Frank Gitau’s stories in your inbox

Join Medium for free to get updates from this writer.

In the case of Elon Musk vs the rest of us, a question may arise whether one can be able to achieve the same level of success in the field of technology without the intelligence exhibited by Musk. Elon’s mother recalls a time when he was a toddler and found fear of the dark illogical since darkness was just absence of light and remarking that darkness was just absence of photons . How many people could confidently come to the same conclusion at that age? Better still, how many people still don’t know what photons are?

In answering these questions, I would propose a review of Malcolm Gladwell’s ‘Theory of Success’ and especially his 10,000 hour rule. This rule suggests and attempts to prove by considering the likes of Bill Gates and Steve Jobs that for one to excel in anything, then they would have to invest at least 10,000 hrs in perfecting their skill in order to succeed. Essentially, this means that if one puts enough effort, if one actively seeks to grow their selected skill, then them becoming successful is more likely if not guaranteed.

Back to the case of the footballers and the genius, the truth is while Lionel Messi is a skilled and talented football, he does not sit around and expect success, he still puts in time to train and practice to perfect his skills and remain a contender for the best footballer of this generation. Similarly, Ronaldo (Who in a matter of speaking is still talented) is not merely content with his skill or absence of comparative talent and actively works continuously to become better, to be a contender for greatest footballer of all time. For Musk, if the intelligence he displayed as a baby was not cultivated, if a yearning to learn and accrue knowledge over time did not complement it, it would have been a case of just another guy who used to be a really smart baby.

The purpose of highlighting the above cases was to show the importance of having a growth mind-set. Realizing that current circumstances and conditions are just stepping-stones to becoming better. Realizing that our intelligence is not limited to what we know right now but what we think we could possibly learn. What this means is that while we are still human and have limits to what we can learn or achieve, we can still strive to achieve the impossible and get better in the meantime.

Zones of Growth Mindset

Consider the diagram above. An individual is usually at any given time in one of the three zones. In the innermost, is the zone on contentment, here one as o motivation to better themselves and one stagnates. One does not see any sense in trying to growth. Individuals in this zone have a fixed mind-set and think that what is currently outside their skill set is a pipe-dream, a reservation for the others who already possess the skills they desire.

Others are in the ZPD, the zone of progressive development. Here, the individuals actively seek growth and seek new skills. Any ability or knowledge beyond them is seen as a challenge to work towards achieving. Here individuals possess a growth mind-set and actively seek to grow what they can do. With time, the area of the zone of impossibility is continuously depleted with time. Individuals here benefit from the advantages of change and positive change for that case.

The outermost region is the region of Impossibility. From a realist point of view, humans have limitations and cannot possibly do absolutely everything, however; what they can do is to strive for the impossible and effectively eat into what was previously not achievable by them. This comes with the feelings of achievement and accomplishment in the individuals. It places the individuals at a position to determine what they can do and cannot do thereby taking control of their destiny.

All this is just a look at what it takes to have a growth mind-set. To realize that your mind has the ability to grow or degrade depending on your mind-set. Here’s to achieving the impossible by doing the impossible!!!

--

--