Tech Talk: Sourcegraph – A large-scale code search engine in Go

July 23, 2014 Jeff Hui

Unit tests are essential to maintaining code quality, especially as the complexity of an application increases.
Sourcegraph is a large-scale code search engine (live at sourcegraph.com) that indexes millions of projects across 5
different languages. Its web app component is written in the Go programming language. The Go standard library has a
terrific package for writing unit tests, but the language is still fairly young and the best-practices conventions
around structuring tests for different types of applications are still evolving and developing.

Quinn Slack discusses some patterns that Sourcegraph uses to implement fast, D.R.Y., and comprehensive unit test
coverage. He walks through how Sourcegraph initially structured its tests and the improvements they made as their web
app scaled and became more complex. He shows specific code snippets and hopes that these usage patterns will be useful
to others building programs in Go. Slides are available at:
http://go-talks.appspot.com/github.com/sourcegraph/talks/pivotal-2014-07-22/pivotal.slide.

About the Author

Biography

More Content by Jeff Hui
Previous
Elisabeth Hendrickson on Using PaaS for Continuous Delivery at the Cloud Foundry Summit
Elisabeth Hendrickson on Using PaaS for Continuous Delivery at the Cloud Foundry Summit

During a technical breakout session at the Cloud Foundry Summit 2014, Elisabeth Hendrickson, director of qu...

Next
My PM Origin Story
My PM Origin Story

This past week, I was asked to write up my career journey for Inventing Heron, which aims to inspire people...

Enter curious. Exit smarter.

Learn More