Skip to content

Instantly share code, notes, and snippets.

@samjonester
Last active January 3, 2017 14:07
Show Gist options
  • Save samjonester/bb8bff5ca2f9faa281d7aeda3b1eb76b to your computer and use it in GitHub Desktop.
Save samjonester/bb8bff5ca2f9faa281d7aeda3b1eb76b to your computer and use it in GitHub Desktop.
Do I Realy Need To Test That!?

Do I Really Need To Test That!?

Abstract

That test is hurting your test suite! Tests at the application's edge fail in strange ways and erode confidence in your test suite. You'll learn why Integrations and the edges are not meant to be tested, and also how to make your own decision and not listen to me! We'll practice thinking through test design at one of the more difficult areas of an application and how to purposefully break the rules.

Details

Not all tests are created equal. Some tests erode confidence in your test suite, and make it slow. You'll see examples of these tests at the edge of your application. You'll learn why those areas shouldn't be tested. More importantly, though, you'll learn how to make these decisions for yourself. After all, what good are rules if you can never break them?

Once you've been convinced to avoid testing the edges of your application, you'll learn strategies to test what's really important, the code YOU wrote. You'll learn the true meaning behind the infamous quote "Don't mock what you don't own", and how to leverage that idea properly. Then you'll learn ways to purposefully test the edges of your application when it is important to do so.

Pitch

Do I Really Need To Test That!? is a talk about purposeful design. Tests should be given even more design direction than production code. They tell a story about how and why the production code is shaped the way it is. Forget about testing what you think you should test, or neglecting to test things that are slow or hard. You'll learn how to think through test design at one of the more difficult areas of your application. You'll learn how to think about testing the edges of your application: where you connect to a database or the file system, or where you make API calls. The challenges caused by these areas mean that more thought should be given to designing your tests. You'll learn about that thought process, and how to decide what's important to your test suite.

About Me

Sam Jones @samjonester

I am a double agent at Test Double living in Philadelphia, PA. I have a passion for learning and teaching. I love the Ruby community for its inclusivity, and also for fostering such an amazing community. Ruby is a place where anyone can share ideas and code. I am a cook and cyclist in my free time, as well as a Husband and Father.

@seeflanigan
Copy link

This sounds great!

A part that feels a little fuzzy to me is: "The difficulty means that more thought should be given to these areas.", and a possible edit (this is definitely tone policing) is "This difficulty is a sign that we need to give more thought to these areas." However, it's a trivial nitpick at best.

I would attend this talk, and hope I get a chance to check out a video or something. I may be doing this wrong! (Mocking 3P svcs.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment