Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

CodeSignal

Foundations of TDD in Go and Testify: The Principles

via CodeSignal

Overview

This course introduces Test-Driven Development (TDD) for Go projects, covering the Red-Green-Refactor workflow, TDD mindset, and setup with Testify. Learn best practices like SOLID principles and dependency injection, and explore TDD's impact on code quality and speed compared to traditional approaches.

Syllabus

  • Unit 1: Introduction to TDD with Go: What, Why, and How
    • Write a Test, Watch It Fail
    • Make the Test Pass
    • Refactor for Readability and Clarity
  • Unit 2: Generalizing Solutions with Test Driven Development
    • Write another failing test
    • Make it pass again
    • Refactor to use parameterized tests
  • Unit 3: The TDD Mindset: Thinking in Tests with Go
    • Defining the first test for Shopping Cart totals
    • Make it pass
    • Write another failing test
    • Make the Cart Total Function Work
    • Implement Sum Method in ShoppingCart Struct
    • Make it Red
    • Make it Green
  • Unit 4: Setting Up and Mastering Testing in Go and Testify
    • Understanding Testing with Testify in Go
    • Use some Verifiers
    • Create a Test Suite
    • Refactor Test Setup with SetupTest
    • Group Email Tests Using Suites
    • Expect an error
  • Unit 5: Managing Dependencies in TDD with Go
    • Write your first failing test
    • Make it pass
    • Refactor
    • Write a test that expects logging (Red)
    • Make the tests pass
    • Refactor the UserManager Class
  • Unit 6: Introduction to the AAA Pattern in TDD with Go and Testify
    • Refactor Tests Using the AAA Pattern

Reviews

Start your review of Foundations of TDD in Go and Testify: The Principles

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.