"Sorry, we were looking for more of a senior-level developer. Your code needs WAY more tests." This was the response I got after sharing a code sample with a prospective employer. I was crushed. I thought I WAS a senior-level developer. But unlike the PHP background I had come from, employers in the Rails world expected, rightly, that candidates should know how to write tests.
It took me a few years but I did end up becoming a competent tester. I got my first full-time Rails job in 2013 at a small startup that made a health-related product. Their codebase had a test suite, which allowed me to see what a real production test suite looked like. Their test suite had some problems. There were a number of "flapping tests" that would fail once in a while, seemingly at random. This taught me how to reproduce flapping test failures and how to fix them (or what to do if they can't be fixed). Their test suite also used Cucumber for integration testing, which taught me the pros and cons of Cucumber.
In early 2014 I started working with a client with an "Airbnb for surfers" product who had only one developer and a very fragile and messy legacy codebase. This experience helped teach me how to use tests to wrangle legacy code into compliance. Working with this legacy codebase also helped me develop the skill of what Michael Feathers calls "characterization testing", or what I sometimes call "reverse TDD".
In this talk you'll learn:
- Why it was hard for me to get started learning testing
- How my exposure to various different codebases helped me learn what makes good and bad tests
- What the high-level testing lessons I learned were
- How you can get better at testing faster than I did
- Testing books, tutorials and other resources you can turn to
Jason Swett is a developer, trainer, author and former panelist on the Ruby Rogues podcast.
Since putting his first website online in 1996, Jason has worked with organizations like AT&T, Lenovo, VMware, HP, Dow Jones, Deloitte, Kroger and the University of Chicago.
He has taught programming in the United States, The Netherlands, Bulgaria and Nigeria.
Jason is also a co-organizer of the GRWebDev Meetup, the largest programming meetup West Michigan. He lives in Sand Lake, Michigan with his wife and two kids.