There is a common adage on software testing that reads: "all software is guilty until proven innocent". This saying is a testament to how delicate applications can get, especially as they grow. Testing is a crucial part of the software development lifecycle to ensure that our apps instead stay strong as they grow.
In fact, testing is so important that some codebases have more test code than production code, and at times, many developers spend more time building and running tests than they do writing production code.
This chapter covers testing from front to back. It starts with the basics of the built-in testing libraries that come with the Go language, and moves on to more complex use cases and third-party libraries. It then dives into advanced topics like performance profiling and nested tests.
After this chapter, you'll know both the basics and advanced topics to write better, more effective tests with less code and effort.
* There are many less well known test features behind the scenes or buried in documentation. I recommend watching this chapter in full before writing your next test suite to learn how to use Go's test facilities properly
- Title: Advanced Testing and Debugging in Go
- Release date: May 2020
- Publisher(s): Aaron Schlesinger
- ISBN: None
You might also like
Testing in Go
Having access to a reliable and comprehensive test suite for your applications isn’t a luxury anymore—it’s …
Hands-On Dependency Injection in Go
Explore various dependency injection methods in Go such as monkey patching, constructor injection, and method injection …
Network Programming with Go
Go combines the best parts of many other programming languages. It’s fast, scalable, and designed for …
Hands-On Software Architecture with Golang
Understand the principles of software architecture with coverage on SOA, distributed and messaging systems, and database …