Skip to Content
Head First Go
book

Head First Go

by Jay McGavren
April 2019
Beginner
556 pages
14h 21m
English
O'Reilly Media, Inc.
Content preview from Head First Go

Chapter 14. code quality assurance: Automated Testing

image

Are you sure your software is working right now? Really sure? Before you sent that new version to your users, you presumably tried out the new features to ensure they all worked. But did you try the old features to ensure you didn’t break any of them? All the old features? If that question makes you worry, your program needs automated testing. Automated tests ensure your program’s components work correctly, even after you change your code. Go’s testing package and go test tool make it easy to write automated tests, using the skills that you’ve already learned!

Automated tests find your bugs before someone else does

Developer A runs into Developer B at a restaurant they both frequent…

Developer A: Developer B:
How’s the new job going? Not so great. I have to head back into the office after dinner. We found a bug that’s causing some customers to be billed twice as often as they should be.
Ouch. How did that get onto your billing server? We think it might have gotten introduced a couple of months ago. One of our devs made some changes to the billing code then.
Wow, that long ago… And your tests didn’t catch it? Tests?
Your automated tests. They didn’t fail when the bug got introduced? Um, we don’t have any of those.
What?!

Your customers rely on your code. When it fails, it can be disastrous. Your company’s ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Head First Git

Head First Git

Raju Gandhi
Learning Go

Learning Go

Jon Bodner
Head First Software Architecture

Head First Software Architecture

Raju Gandhi, Mark Richards, Neal Ford
Head First Design Patterns, 2nd Edition

Head First Design Patterns, 2nd Edition

Eric Freeman, Elisabeth Robson

Publisher Resources

ISBN: 9781491969540Errata Page