2
Unit Testing Essentials
In the previous chapter, we learned all about the iterative process of writing tests alongside code using TDD, as well as how it fits into the Agile project methodology. We covered the red, green, refactor approach, which requires frequent switching between source code and test code.
When first starting with TDD, following a prescribed process for writing code may seem like an artificial way of working, but it soon becomes second nature with practice. In this chapter, we will learn all the Go fundamentals required to begin putting everything else we have learned to use. We will begin to write unit tests with Go’s testing package, focusing on the test writing syntax and process. This chapter will allow us to get hands-on ...
Get Test-Driven Development in Go now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.