Test-Driven Development in Go

By Adelina Simion
    What do you get with a Packt Subscription?

  • Instant access to this title and 7,500+ eBooks & Videos
  • Constantly updated with 100+ new titles each month
  • Breadth and depth in over 1,000+ technologies

About this book

Experienced developers know that designing a comprehensive testing strategy is vital to shipping and maintaining services in production. This book teaches you to leverage TDD, which is already an industry practice, for testing your Go applications at different levels. In addition, one chapter discusses the challenges and approaches of testing concurrent code, which requires different techniques for testing and profiling.

You’ll use TDD to solve and test a variety of problems, from simple mathematical functions to web applications. You’ll learn how to structure and run your unit tests, and what assertion frameworks are available for you to use. You’ll implement test suites using table-driven testing, which is a common technique used in Go. Then, you’ll write and run Behavior-Driven Development (BDD) style tests. You’ll learn more complex topics that require end-to-end testing with mocking and contract testing via practical examples. Finally, you’ll explore the difficult aspects of implementing and running TDD in production. You’ll come across the challenges of testing concurrent code and fuzzing.

By the end of this book, you’ll design and implement a comprehensive testing strategy for your Go applications and microservice architectures.

Publication date:
June 2023
Publisher
Packt
Pages
390
ISBN
9781803247878

About the Author

  • Adelina Simion

    Adelina Simion is a polyglot engineer and developer relations professional, with a decade of technical experience at multiple startups in London. She started her career as a Java backend engineer, converted later to Go, and then transitioned to a full-time developer relations role. She has published multiple online courses about Go on the LinkedIn Learning platform, helping thousands of developers upskill with Go. She has a passion for public speaking, having presented on cloud architectures at major European conferences. Adelina holds an MSc. Mathematical Modelling and Computing degree.

    Browse publications by this author
Test-Driven Development in Go
Unlock this book and the full library FREE for 7 days
Start now