Test-Driven Development in Go
eBook - ePub

Test-Driven Development in Go

A practical guide to writing idiomatic and efficient Go tests through real-world examples

Adelina Simion

Share book
  1. 342 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Test-Driven Development in Go

A practical guide to writing idiomatic and efficient Go tests through real-world examples

Adelina Simion

Book details
Table of contents
Citations

About This Book

Explore Go testing techniques and leverage TDD to deliver and maintain microservices architecture, including contract, end-to-end, and unit testingPurchase of the print or Kindle book includes a free PDF eBook

Key Features

  • Write Go test suites using popular mocking and testing frameworks
  • Leverage TDD to implement testing at all levels of web applications and microservices architecture
  • Master the art of writing tests that cover edge cases and concurrent code

Book Description

Experienced developers understand the importance of designing a comprehensive testing strategy to ensure efficient shipping and maintaining services in production. This book shows you how to utilize test-driven development (TDD), a widely adopted industry practice, for testing your Go apps at different levels. You'll also explore challenges faced in testing concurrent code, and learn how to leverage generics and write fuzz tests.The book begins by teaching you how to use TDD to tackle various problems, from simple mathematical functions to web apps. You'll then learn how to structure and run your unit tests using Go's standard testing library, and explore two popular testing frameworks, Testify and Ginkgo. You'll also implement test suites using table-driven testing, a popular Go technique. As you advance, you'll write and run behavior-driven development (BDD) tests using Ginkgo and Godog. Finally, you'll explore the tricky aspects of implementing and testing TDD in production, such as refactoring your code and testing microservices architecture with contract testing implemented with Pact. All these techniques will be demonstrated using an example REST API, as well as smaller bespoke code examples.By the end of this book, you'll have learned how to design and implement a comprehensive testing strategy for your Go applications and microservices architecture.

What you will learn

  • Create practical Go unit tests using mocks and assertions with Testify
  • Build table-driven test suites for HTTP web applications
  • Write BDD-style tests using the Ginkgo testing framework
  • Use the Godog testing framework to reliably test web applications
  • Verify microservices architecture using Pact contract testing
  • Develop tests that cover edge cases using property testing and fuzzing

Who this book is for

If you are an intermediate-level developer or software testing professional who knows Go fundamentals and is looking to deliver projects with Go, then this book is for you. Knowledge of Go syntax, structs, functions, and interfaces will help you get the most out of this book.

]]>

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Test-Driven Development in Go an online PDF/ePUB?
Yes, you can access Test-Driven Development in Go by Adelina Simion in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming Languages. We have over one million books available in our catalogue for you to explore.

Information

Table of contents