Testing The Waters
Tags: learntocode, testing, tdd
Published: 2017-06-04 18:45:08

---
title: Testing The Waters
subtitle: Life After The Bootcamp
published: true
description: A recent bootcamp grad takes on testing.
cover_image: https://cdn-images-1.medium.com/max/800/1*d-UV-tZNlcMc47ScDWGFMQ.png
tags: Learn To Code, testing, TDD
canonical_url: https://blog.yechiel.me/testing-the-waters-79cf15e3bbe9
---

## **A recent bootcamp grad takes on testing.**

As mentioned in my [latest post](https://blog.yechiel.me/reactjs-app-with-rails-api-4ffb12ba6608), I recently graduated [Flatiron School](https://flatironschool.com/)’s Web Developer bootcamp. After the celebrations calmed down a bit, the question that now begs an answer is “now what?”

While going through the program, the question always came up “what are your plans after graduation?” None of us deluded ourselves into thinking that taking one course would magically transform us into 10X web developers; what Flatiron did do a great job with, was turning us into first class learners, and gosh, there's so much to learn.

Whenever those discussions came up, I always joked that I have a huge to-do list of things I need to learn after graduation. The problem is that it's a horizontal list; I want to do all of the things first!
![ALL THE THINGS!](https://cdn-images-1.medium.com/max/600/1*nfM9x8kN_5RPlbZE98seNA.jpeg "And do them first!")
So now that I graduated, all jokes were off, I had to choose what my next focus will be (other than the job hunt for my next developer position of course). Should I focus on brushing up my basic CS skills with algorithms and data structures? Should I go ahead and learn a new language/framework? 

In the end, I decided to focus on writing tests.

### **Why tests?**

Let me start by explaining what I mean with tests for my non-technical audience.

Suppose you were making a website. For the sake of this thought experiment, let's pretend all this website can do is allow users to sign up, log in, and log out, and delete their accounts (it's like Facebook but without the annoying parts).

So let's say it took me an hour to put that together, I now have to make sure it works. That shouldn't be too complicated, my site can only do 3 things, so I sign up a test user, log out, log back in with the user I just made, and delete it. Perfect, it all works smoothly, under budget and ahead of schedule.

Now I want my website to do something else; maybe a user should be able to edit her information. So I add that functionality, and to make sure the new feature works I log in with my test user and try to edit the username. That works as well, but wait, I also want to make sure that while coding the "Edit User" feature I didn't break anything else, so I go back to my application, sign up a new test user, log out, log back in with an existing user, edit the information, and delete the user. In the process, I realize that somehow a bug crept in that broke the "Delete User" functionality, so I go back into the code to fix it, and in order to verify that everything is fixed, sign up a new test user, log out, log back in with an existing user, edit the information, and delete the user.

It doesn't take much to realize that this process can get very time-consuming quickly, and it only gets worse as I add more features to my website.

### **Enter tests**

The solution is to automate the process. For every project I make, I would add a test suite. So for my above application, my test suite would contain a script that signs a user up, logs an existing user in, etc. 

Ideally, I would aim to have a test cover every feature in my application, so that whenever I make any change to the code, all I have to do is run the tests, and within a few seconds I would have confirmation that I didn't break anything, and if I did, I would know exactly where it was broken so I could fix it.

At Flatiron we dealt with tests a LOT, we read them, ran them, banged our heads when they failed, and celebrated when we got them to pass.
![CELEBRATE GETTING THAT LEARN GREEN!](https://cdn-images-1.medium.com/max/800/1*STzY3STu64_HqzD9KiCuOQ.gif "This GIF used to be real popular on our Flatiron Slack")
In fact, most of the learning was not done through lectures or books, it was done through a pattern I call TDL (Test Driven Learning, loosely based off of TDD, Test Driven Development). We would start by cloning a GitHub repo, running the test suite, analyzing the error messages, and doing what had to be done to get them passing.
![Passing Tests](https://cdn-images-1.medium.com/max/800/1*d-UV-tZNlcMc47ScDWGFMQ.png "Fellow Learners are known to wake up in middle of the night screaming about this lab…")
The one thing we didn't do much of, was actually WRITING tests. And that, I believe, is unfortunate. Writing tests is such an important part of writing software, it would have been nice to spend some time learning how to write them properly.

In my [last project](https://github.com/achasveachas/app-tracker) I did write some tests on my own, but nowhere near as much as I would have liked to. So now that I'm "on my own", I decided to fix that situation. For the coming week or two, I'll be reading up on tests, adding some to my old projects, and maybe even write an entire TDD app from the bottom up.

Based on some friends' recommendations I started reading through [Rails 4 Test Prescriptions](https://pragprog.com/book/nrtest2/rails-4-test-prescriptions), if anyone reading this has some more recommendations please do leave them in the comments.

As always, Happy Coding!

___

*This article has been cross-posted from my blog [Coding Hassid](https://blog.yechiel.me/testing-the-waters-79cf15e3bbe9)
You can read more about my coding journey there, or by following me on Twitter [@yechielk](https://twitter.com/yechielk)*