Introduction to Testing in Go Workshop

Presented by Tim Raymond

Description

Whether you are just getting started in Go or have been writing Go code for a couple years, this class will make sure you have what you need to write simple, quick, robust tests. We will start with the basics and introduce table driven tests. Then we'll work through advanced concepts such as testing asynchronous code as well as mocking and injecting code. We’ll finish up with example tests and code coverage. We believe in a hands-on approach to learning, so be ready to write a lot of tests!

What a student is expected to learn

Everyone will have a strong understanding of each part of testing. The test package will be covered in depth, different approaches to table driven testing will be taught, as well as the numerous options for running tests and test suites. Students will learn how to test Net/HTTP packages, and how to mock out tests and create test harnesses. From there, students will learn how to create test coverage and example tests for documentation.

Prerequisites

A basic understanding of the Go programming language. Beginners are highly encouraged to attend this training. While not necessary, it will be helpful if you have completed the Go tour.

Buy Tickets - $199
Agenda (4 hours)
Tuesday, May 19, 2020
  • 2:00 PM EST
    Introduction and setup
  • 2:10 PM EST
    Start Workshop
  • 3:45 PM EST
    30 Minute Break
  • 4:15 PM EST
    Workshop
  • 6:00 PM EST
    End Workshop
Presenter's Bio

Tim Raymond is a full-stack developer with over six years of experience writing Go for companies such as USA Today, InfluxData, and Mattel. He's worked on everything from publishing pipelines, gRPC APIs, IoT backends, and interactive React frontends powered by Go backends. Prior to his involvement in the Go community, Tim served as an organizer for the Boston Ruby Group. His professional interests range across web applications, compilers, networking, performance and cryptography.

Course Details

  • Welcome

    This module covers general information about your instructor and course materials.

  • Getting Started

    This chapter covers general environment setup and other resource related information needed to complete the courses contained within.

  • Testing Basics

    Testing in Go is easy, and simple to use. There is a strong emphasis on testing in Go. The compiler will catch a lot of bugs for you, but it can not ensure your business logic is sound or bug-free.

    While the testing package isn't large, there are a lot of features that are not properly understood. In this chapter we will cover the following concepts:

    • *testing.T
    • Error vs. Fatal
    • Failure Messages
    • Helpers
    • Testing Packages
  • Table Driven Testing

    Table driven tests can be used to cover a lot of ground quickly while re-using common setup and comparison code. Table driven testing is not unique to Go, however, it is very powerful. In this module we will cover the different ways to create, run, and isolate table driven tests.

  • Running Tests

    Understanding the different options to run tests can greatly reduce the feedback cycle during development. In this chapter, we will cover:

    • Running Specific Tests
    • Verbose Output
    • Failing Fast
    • Parallel Options
    • Short Testing
    • Timing Out Tests
    • Race Conditions
  • Testing Net/HTTP

    In the standard library there are two mechanisms for us to use to test web applications.

    • Unit Style Testing
    • Integration Style Testing

    These are not their "official" names, but we believe they do a good job of describing the styles of testing. In this module, we will cover both styles of testing and how to use them.

  • Example Tests

    No project is complete without great documentation. Example tests are a great way to not only document your code, but ensure that the examples you use always work as they are actually a test in addition to the documentation.

  • Code Coverage

    Code coverage is a great tool to show what part of your code is being tested. It will help identify areas that need more testing, as well as assist in making sure your tests actually test the part of the code you think it does.

  • Finalize

    This chapter covers where to get more support on Go, recommends books and videos, and list the contact information for our instructors.

Buy Now! $49

Includes admission for all talks, real time discussions, and early access to all recorded videos. View the agenda.

Buy Now! $199

At the heart of Machine Learning is the model’s code, but it only accounts for a fraction of the overall code of a production system and the rest is the infrastructure needed to power and utilize it. In this workshop, we will focus on the infrastructure of a Machine Learning application written in Go and integrate the systems needed to deploy a ML model at scale.

Buy Now! $199

At the 'edges' of your program (e.g. when interacting with other services) you will use serialization to send and receive data. Working efficiently with serialization will make your interfaces more flexible, will save you money on CPU & bandwidth and free you to focus on writing business value code.

Buy Now! $199

Whether you are just getting started in Go or have been writing Go code for a couple years, this class will make sure you have what you need to write simple, quick, robust tests. We will start with the basics and introduce table driven tests. Then we'll work through advanced concepts such as testing asynchronous code as well as mocking and injecting code. We’ll finish up with example tests and code coverage. We believe in a hands-on approach to learning, so be ready to write a lot of tests!

Buy Now! $199

This course is tailored to developers learning Go for the first time or having less than one year of Go development experience. This workshop will cover practical, daily Go fundamentals. Starting with the language fundamentals, students will move into interfaces and how they lend to embedding and composition in Go. We will finish up with an overview of concurrency in Go.

Buy Now! $199

This course was designed to take experienced Go developers and walk them through how to use all the Go tooling to make your code perform better. We will start with a complete look at benchmarking from start to finish. Then a walk-through of the profiling tools will be presented. Students will finish up by learning about common optimizations in Go. After learning about these optimizations, you will be able to apply this knowledge to your own code to identify performance issues.