Test-Driven Learning: A Better Way to Learn Any Programming Language

Learning from your mistakes isn’t a new concept. Scottish author Samuel Smiles wrote in 1862 “We learn wisdom from failure much more than from success.”

The view has been popularized recently in software development by teams applying the DevOps and Agilemethodologies of producing small improvements iteratively. If a feature doesn’t work as expected, it can be scrapped; it is a concept known as “fail fast.”

“Fail fast, learn fast” is the main premise of Jez Humble’s book Continuous Delivery: Reliable Software Releases through Build, Test, and Deployment Automation. In the context of this book,  Jez is referring to building reliable production software by releasing as often as possible. Any failures should be small and cause little impact, with the ability to rollback to the last working version and learn what exactly went wrong.

We can apply the same concept to learning. Fail as often as you can, and learn as much as you can from those failures.

Learn to Code by Doing

Schools have taught us to learn the facts first and  then, only when we know what we are doing, apply the skills in practice. We go to school, college, or university and then off to work with all the knowledge we have gained.

This idea has been extended to video-learning sites, such as Pluralsight or Udemy, which are great, but a little boring. I learn best by doing, and only when I have struggled with a subject, do I ever find books or videos on the subject interesting.

In the 16th century, before schools existed, people learned by doing. A child would be an apprentice, learning from a master until they were good enough to perform the job by themselves. The apprentice would practice repeatedly with most of the output getting thrown away. But more important than the output was what they learned from their mistakes. When they became a master, they had years of mistakes that they now knew how to avoid and techniques for all kinds of scenarios.

We are going to use the same repetitive practicing technique to learn to code a new language by creating tests for different problems and solving them in a variety of ways. Only when we don’t know how to write a test or figure out the solution, do we need to look in a book or at course material—do first, learn as you go.

Applying Test-Driven Development to Learning

Test-driven development (TDD) wasn’t my idea; it originated from a range of techniques called extreme programming in the 1990s to help improve software quality in development teams. The core idea of test-driven development is:

  • Create the smallest failing test possible for code you are planning to write.
  • Run the test and fail.
  • Write the code until the test passes.
  • Refactor the code bit by bit, and keep running the tests until the code is maintainable and readable.

The main benefits we are using from TDD is the refactor step. Once the tests have been created with well-defined inputs and outputs, the solution can take many forms. This refactoring step is really useful when learning to understand how built-in language features work and how different ways of approaching the same solution lead to the same output. Another benefit is motivation; it’s addictive watching the tests go from red (failing) to green (pass!). It’s like a kind of game.

The idea of learning through TDD isn’t new either. While learning JavaScript I was introduced to this approach via freeCodeCamp, where from the first lesson you are required to pass failing tests to complete a level. I also recently started learning Ruby and was introduced to Koans via the Edgecase Ruby Koans site.

The idea behind freeCodeCamp and Ruby Koans is to present a long list of failing tests for you to fix. This approach of fixing tests one by one is ideal if you are just starting out. You don’t need to write tests yourself, which sometimes sucks the fun out of learning.

Learning Through Testing Promotes a Deeper Understanding

Early in my career I survived by searching through Stack Overflow, looking at the code already written in the codebase and randomly trying code snippets to see if they would work. That was fun but with some major drawbacks: Some of the code I was writing had unintended side effects. Fixing it involved more searching and more hacks upon hacks. My shortcuts actually caused me more work, and everything took longer and made me hate seeing a tester walk toward my desk with yet another bug.

It wasn’t only my project that suffered. When applying for new jobs, I was able to answer superficial questions that I found on the internet, but when the interviewer probed further, I didn’t have deep enough knowledge to answer any further questions. These problems could have been avoided had I been practicing test-driven learning.

The main benefit of approaching learning by testing is a deeper understanding of the code you are writing, how to interact with library functions, and what output can be expected in different scenarios.

The refactoring is the fun, experimenting part of the process; the same problem can be solved in a multitude of different ways. Experimentation allows your brain to play with an idea and provides a greater understanding of the limits and cool features of the language and where to use them.

I have been practicing TDD for quite a few years, but when I recently needed to learn Ruby, I thought I would try out learning through testing.

My process was:

  • Read the bare minimum about a concept.
  • Write a test for that concept.
  • Test the limits of the concept by refactoring multiple times with different solutions.

Each solution offers advantages and trade-offs. Writing down each solution adds a new tool to your toolbelt, so when you do come up against a situation where you need an algorithm, you have a collection of solutions that you now have a deep understanding of because you have already struggled with the concepts.

Learning Through Testing Helps You After You’ve Learned the Basics

I’ve found that once you have the basics, there are other benefits of learning this way. I am much more likely to use test-driven development when writing production code; if I get in the habit while learning, I just continue on when applying it in practice. I also have a sandbox for working out difficult problems. If I have an issue with some code buried deep in a code base, isolating the problem usually speeds up the diagnosis, and if not, it’s much easier to paste that isolated code into Stack Overflow!

Tech4her Africa Won the Silicon Valley’s AngelHack Competition 2018 Hosted at Impact Hub, Lagos.

Tech4Her Africa, a social enterprise driven to raise the next generation Science and Technology leaders emerged the winner of the AngelHack Hackathon hosted at Impact Hub, Ikoyi on 28th – 29th July. They are shortlisted to represent Africa at the Global Demo Day taking place at Silicon Valley, US and are joining other winners from 50 cities around the world for the 12 weeks Angel Hackcelerator program. Announcement on AngelHack’s website here: http://blog.angelhack.com/meet-the-hackcelerators-2018-startups










AngelHack’s HACKcelerator program connects ambitious hackers with thought-leaders and experienced entrepreneurs to help them become more versatile and create fundable startups. With a startup portfolio valuation of $70m, acquisitions from tech giants such as Google, and industry innovators such as BOX, AngelHack is the highest valued pre-accelerator in the industry active in 106 cities around the world. This is the first Hackathon organized in Africa.

The team is led by Mrs. Elizabeth Edwards (also Founder, Tech4Her Africa).

Members of the team (some of who are students of the University Of Lagos (Adeola Akinwale, Dolapo Otufadebo, Chukwudumebi Onwuli, Chiamaka Eguzoro, Chidera Ofokansi);

Mentors on this team are: Mrs Fayo Williams (Certified Business Consultant)  & Dr. Roselyn Isimeto (Lecturer at Computer Science, UNILAG).


The team developed Tatafo App- Watson AI based app that helps university students access  information and resources instantly at a click.

In the mobile powered economy, University students need instant access to answers just like they can have on Google.” said Mrs ELizabeth Edwards (Team lead & Founder, Tech4her Africa).


Mr Yele Bademosi the CEO of Microtraction,

Judge and Mentor during the just concluded Angelhack Hackathon Lagos took to twitter to congratulate the ladies saying “ 5 years ago I went for my first tech event @Angelhack London 2013 and it changed my career path. Congratulations to the kick-ass female developers from Tech4her Africa who won the hackathon”

We hope this new achievement can further encourage others to join Tech4Her Africa, help them reach more of its target audience and foster new partnerships. Learn more about Tech4her Africa on their website (www.tech4herafrica.com).

The future is definitely Female!

Chatbots and The Future of Education

Ever noticed how quickly people learn when it’s something they’re truly interested in?

I for one only learned how to write songs because I was curious about how words and melodies can be put together to create something that has the power to make people happy or sad.

I didn’t go to music school to learn how to write songs. I simply listened to my mother while she sang, I played my father’s records while he was at work, and I watched my sisters whenever they got together to do something they called composing. I was eight years old at the time and I was fascinated by all this.

I wanted to know how it was done so I could do it too. Why? Because I wanted to see if my songs would have the same effect on people.

By the time I was twelve, I was using my own pocket money to buy singles and albums of artists I liked. I would listen to tracks over and over again, read the lyrics in the liner notes, and imagine myself writing them. At fifteen, I wrote my first song and at 21, I released my first collection of songs written and co-produced by me.

Self Education

What I’m trying to say is everything I know about songwriting is largely self taught. And I did it all out of curiosity.

Curiosity didn’t kill the cat. It only killed the cat’s lack of insight and increased its appetite to learn more. Today, many people are educating themselves and learning new skills on the internet by watching videos and presentations on YouTubeSlideShare, and Lynda.com.

The beauty of teaching yourself is that you are motivated by your own interests and what you want to achieve.

Having these learning platforms on the internet is like having your own private teacher on demand. But it’s not so easy to get a real one-to-one session with these online teachers because they are far too busy creating more content.

So when people have burning questions about something they didn’t quite understand in the slides and videos, they ask their eTeachers in the comments section and hope to get a response.


This poses a real problem because it can have people waiting days on end for an answer. Sometimes, they don’t even get one. Some of these eTeachers have huge followings and it’s simply impossible for them to answer every single question.

This is a problem that educational chatbots can solve. A chatbot is simply software that simulates human conversations like Apple’s Siri or Amazon’s Alexa.

Today’s students are mostly millennials who love messaging platforms like WhatsappiMessage, and Snapchat. Wouldn’t it be more efficient if these eTeachers had messaging chatbots that could answer basic questions for their students?

Imagine a situation where a student is stuck on a particular aspect of Photoshop and needs answers there and then in order to finish a project with a close deadline.

That student could send a message to Lynda.com’s chatbot for instance, who will then search the platform and send the student a message with the most suitable answer.


IBMs artificial intelligence technology is currently being used to power a teaching assistant for an online course at the Georgia Institute of Technology.

Jill Watson gives human professors and assistants the time they need to address more important issues while she answers routine questions from students.

While this is great for the university and its online course, it’s not so great for those who do not have access to that service.

I envision a world where a single conversational messaging app can pull answers from a host of educational institutions. You simply ask your question and the chatbot will search for answers from the online courses of top universities and all digital learning platforms.

Freemium or Premium?

This suggests that education in today’s world should really be free. But long established universities probably oppose this move because they’ve become accustomed to their ever increasing tuition fees.

Another approach might be to charge an affordable monthly subscription fee to access the library of information on the app, similar to the way people pay for music libraries on streaming platforms like Spotify and Apple Music.

Imagine a billion people or more paying £9.99 per month for access to the world’s library of educational information.

In this way, value will still be created and people around the world would have the power to truly educate themselves on any subject they might be curious about.

Chatbots have huge potential to make this a living reality. With their machine learning capabilities, they could even learn to teach post graduate courses.

The only time you’d need to see an actual human teacher would be to spend time on more complex theoretical or practical issues like philosophical discussions or physical experiments that require the knowledge, guidance, or supervision of an experienced expert.

Imagine what we can achieve when billions of people are liberated to learn in their own way, at their own pace, and in their own time.

Think of all the innovative ideas that will spring forth when anyone with access to the internet becomes empowered to educate themselves and learn about things they truly care about, in a seamless way.

It’s mind blowing!

6 Ways Artificial Intelligence and Chatbots Are Changing Education.

Chatbots are about to change the world in more ways than we can imagine. Already, bots around the globe can complete a diverse set of varying tasks. From ordering pizza online to mashing faces together in Project Murphy, chatbots are about to become a normal element in everyday life.

As the scope of chatbots becomes broader every day, there are new applications popping up constantly. Education has traditionally been known as a sector where innovation moves slowly. During the most recent years, there has been a large hype over innovative tools to enhance teaching and learning through educational technology.

The time has come for chatbots and artificial intelligence to meet the educational sector. Already, there’s a lot happening but there is no question technology will have an even deeper reach in the near future.

We’ve come across six applications of both chatbots and artificial intelligence within the educational area that could have an astounding impact on the whole industry.

1. Automatic Essay Scoring

Giving feedback on individual written essays is an enormously time demanding task that many teachers struggle with, and in massive open online courses, the problem is even larger. Because there are often over 1000 students in one class, there’s simply no realistic way to give individual feedback to written essays.

To combat this problem, innovators have been flirting with the artificial intelligence (AI) industry, and a solution is relatively close at hand.

By feeding a machine-learning algorithm thousands and thousands of essays, many people believe there’s a good chance of replacing human feedback on essays with AI systems. The project has made rapid improvement since 2012 when The Hewlett Foundation sponsored a competition between essay grading systems. The winner presented a 0.81 correlation, on average, with human graders.

Since then, researchers and scholars have continued accelerating and improving systems in full force. One report claims to have achieved a 0.945 correlation on the same data as in the Hewlett competition. Astonishing!

However, there’s also strong opposition towards relying on only technology when setting grades. Skeptic Les Perelman has set out to expose the true nature of grading algorithms and has successfully managed to point out weak points amongst auto-grading vendors.

How will auto-grading turn out? The future is not yet clear, but realistically there should be a chance of replacing at least one or two of the necessary graders with AI in a few years time.


2. Spaced Interval Learning

Repeating old lessons right when you are about to forget them is an optimal learning super-hack. It’s called TheSpacing Effect.

Polish inventor Piotr Wozniak has come up with a learning app built around the spacing effect. This app keeps track of what you learn and when you learn it. By incorporating artificial intelligence, the app is able to learn when you are most likely to forget information and remind you to repeat it. It only takes a couple of repetitions to make sure the information sticks for years to come.

Instead of students studying intensely before finals only to forget everything a few weeks later, schools and universities should aim for more lasting knowledge retention using this method.

Sadly, findings like the spacing effect have had a small impact on the educational system, which lives up to its reputation of being a sector of slow adoption of technology and innovation.

3. Conversational Course Assessments & Student Ratings

Student evaluations of teaching-surveys have been around for almost 100 years. Despite moving from paper to online surveys, there has been minimal progress to make the feedback process better in any way.

As student evaluations of teaching are often the most valued source of information, it’s obvious that they need improvement.

Because of modern day technology, such as AI-driven chatbots, machine learning, and natural language processing, there are lots of exciting opportunities to explore within the teacher-feedback-area.

Using a chatbot to collect feedback is the ultimate compromise between a qualitative and a quantitative research method. As teachers are normally way too busy to collect qualitative feedback from each student, an end-course survey is often used.

A chatbot can collect opinions trough a conversational interface with the same advantages as a ‘real’ interview but with a fraction of the required work. The conversation can be tailored according to the responses and personality of the student, ask follow-up questions, and find out the reason behind opinions. It’s also possible to filter out personal insults and foul language, which are sometimes present in teacher ratings.

Other than being a compelling option to surveys and with more qualitative data, a chatbot brings many other advantages for teachers who seek to improve efficiency in teaching. By involving more data sources such as self-assessment, grades, peer feedback, and the latest scientific findings on how to teach effectively, it’s possible to form a more nuanced picture of teaching performance. Comparing the data to that of other teachers around the world should make it possible for the system to suggest new and powerful ways to improve teaching and share findings throughout the teacher’s community.

4. Watson, the Teacher Assistant

At the Georgia Institute of Technology, students were charmed by the new teachers assistant, Jill Watson, who managed to respond to student inquiries in a fast and accurate way.

What the students didn’t know was that Ms. Watson’s true identity actually was a computer and powered by IBMs AI-system with the same name. Computer Science Professor Ashok Goel fed Watson more than 40.000 forum posts to get the system up and running.

Answering common questions is a perfect application for a chatbot and a much more interactive approach than using an FAQ-tab.

After getting huge publicity, Jill Watson is spreading her wings and is now being implemented in universities across the globe. One of the latest to be added to the list is BI Norwegian Business School in Oslo, Norway.

5. The Chatbot Campus Genie

At the Deakin University in Victoria, Australia, development is in full swing to complete the first ever chatbot campus genie. Just like in the case of the AI teacher assistant, the intelligence behind it comes from IBM’s supercomputer system, Watson.

 Once operational, the Deakin genie will be able to answer questions related to everything a student needs to know about life on campus. How to find the next lecture hall, how to apply for next semester’s class, how to submit assignments, where to find parking or where a counselor can be reached are all questions that can be handled by the genie.

When new students swarm the campus, they have similar questions every year which makes for a perfect application of a chatbot.

William Confalonieri is the driving force behind the genie-project and the CIO at Deakins University.

“The most promising opportunity to use this technology,” he says, “Is to support a much more personalized approach to on-campus services that still appeals to a large crowd. The system will also help lower the burden on stressed-out faculty, as they no longer have to explain the same things over and over to different students.”

Confalonieri hopes to be able to expand the capabilities of the system rapidly in the coming years and have it handle significantly more complex tasks in the future.


6. Student-Centered Feedback

The current educational system can, a bit maliciously, be described as a factory-line where the end-goal is to produce competent students to fill employee needs. The factory expects the same raw material (students), the same response to treatment (lessons) and the same result in the same time frame.

As human beings are complex beyond the reach of even the most advanced science, the factory approach is not ideal when it comes to transferring knowledge to a diversified new generation.

Entrepreneurs are now exploring a new take on the educational model. A student-centered system where student’s own personality and interest is the most decisive factor when it comes to curriculum configuration.

The content adapts to individual learning pace and can present gradually harder problems to accelerate learning as the student comprehend more and more. This way, both fast and slow learners can keep going at their own pace without being discouraged by other students.

It’s also possible for an AI-driven curriculum to foresee future trouble areas and present more problems related to it in order to prevent future struggles.