Author’s Introduction
Let’s get introduced to course concepts through the author's journey.
We'll cover the following
My first attempt
My first attempt to write a test back in 2008 was a complete failure.
I was working for a small startup on a relatively large project, and no matter how hard I tried, my code kept breaking in unexpected places.
The real problem was that I couldn’t take it anymore. Instead of enjoying the work, I was miserable.
I was trying hard to write my code to accomplish its goal and ensure I wasn’t breaking any existing code. But there was always something broken.
It was a hard hit to my inflated ego, but thankfully I didn’t give up. I was determined to fix the problem and transform how my job would make me feel about myself.
Some misconceptions
However, I didn’t realize that this situation wasn’t entirely my fault. I used to think that my coding skills were so bad that I couldn’t write good code.
That wasn’t true. It was partially my fault and partially due to the unhelpful tools that I had to use.
Ruby’s code-checking mechanism
The Ruby language is so permissive that it lets us get away with almost anything we want—it doesn’t check whether your code works. It performs a few basic syntax checks, but aside from that, we’re pretty much on our own.
A few years after I started to learn Ruby, I realized there is an optional built-in code-checking mechanism, but it must be assembled manually. Not only that, but the way we do it isn’t exactly straightforward.
This code-checking mechanism is called testing.