Go Testing

Open-source Go projects categorized as Testing

Top 23 Go Testing Projects

  • Testify

    A toolkit with common assertions and mocks that plays nicely with the standard library

    Project mention: Full Introduction to Golang with Test-Driven Development | news.ycombinator.com | 2024-08-03

    This article is too basic and does not introduce anything you'd encounter in a typical Go project. If you want introduction to Go testing I recommend just reading the official docs https://pkg.go.dev/testing and understanding how to write table driven tests - https://go.dev/wiki/TableDrivenTests.

    Going beyond what's built in, get familiar with https://github.com/stretchr/testify as that's used a lot.

  • InfluxDB

    Purpose built for real-time analytics at any scale. InfluxDB Platform is powered by columnar analytics, optimized for cost-efficient storage, and built with open data standards.

    InfluxDB logo
  • learn-go-with-tests

    Learn Go with test-driven development

    Project mention: [Go, Book Review] Learn Go with Tests by Chris James | dev.to | 2024-03-23

    There are not particularly bad parts. Overall the book is well written and organized. Moreover, Since it is also an open-source material, many readers have contributed to the contents of the book(including a few of mine :)). I hope there are more books like this for other languages such as Rust or Python.

  • Gor

    GoReplay is an open-source tool for capturing and replaying live HTTP traffic into a test environment in order to continuously test your system with real data. It can be used to increase confidence in code deployments, configuration changes and infrastructure changes.

  • chromedp

    A faster, simpler way to drive browsers supporting the Chrome DevTools Protocol.

    Project mention: Rustify some puppeteer code | dev.to | 2024-06-27

    To my surprise the code was closer in structure to the puppeteer version than it was to the chromedp. The chromedp version uses nested context declarations to manage the browser and page runtimes, the rust version uses a more linear approach. You construct a browser instance and then you can interact with it as a user would. This points at the fact that the chromiumoxide api is higher level.

  • toxiproxy

    :alarm_clock: :fire: A TCP proxy to simulate network and system conditions for chaos and resiliency testing

    Project mention: (Mostly) Deterministic Simulation Testing in Go | news.ycombinator.com | 2024-05-30

    I really like an idea to solve scheduling problem via compiling to WASI. Many months ago I had conversation with friends, how to implement deterministic testing in Go, without custom IO runtime (common approach in Scala/Rust/C++). We were talking about a few random things, which require a lot of effort (compare to WASI):

    1. https://github.com/Shopify/toxiproxy

    2. https://github.com/bytedance/ns-x

    3. https://github.com/hnes/cpuworker

    But all of them are not too good from the first glance.

  • GoConvey

    Go testing in the browser. Integrates with `go test`. Write behavioral tests in Go.

  • ginkgo

    A Modern Testing Framework for Go

    Project mention: Writing tests for a Kubernetes Operator | dev.to | 2023-10-07

    Ginkgo: a testing framework based on the concept of ‌"Behavior Driven Development" (BDD)

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  • terratest

    Terratest is a Go library that makes it easier to write automated tests for your infrastructure code.

    Project mention: What is Terratest and How to Use it | dev.to | 2024-05-17

    The Terratest Go library leverages this to define a variety of test cases used to test Docker images, cloud infrastructure defined for AWS, Azure, GCP, Kubernetes, and many more.

  • go-grpc-middleware

    Golang gRPC Middlewares: interceptor chaining, auth, logging, retries and more.

  • go-sqlmock

    Sql mock driver for golang to test database interactions

    Project mention: Princípios SOLID em GoLang - Dependency Inversion Principle (DIP) | dev.to | 2024-08-03
  • mockery

    A mock code autogenerator for Go (by vektra)

    Project mention: I Write Tests in Go | news.ycombinator.com | 2024-04-10

    I'm far too lazy to write mocks by hand in go. You can generate a mock for a given interface with mockery https://github.com/vektra/mockery

  • goss

    Quick and Easy server testing/validation

  • syzkaller

    syzkaller is an unsupervised coverage-guided kernel fuzzer

    Project mention: Automated Unit Test Improvement Using Large Language Models at Meta | news.ycombinator.com | 2024-02-17

    https://arxiv.org/abs/2402.09171 :

    > This paper describes Meta's TestGen-LLM tool, which uses LLMs to automatically improve existing human-written tests. TestGen-LLM verifies that its generated test classes successfully clear a set of filters that assure measurable improvement over the original test suite, thereby eliminating problems due to LLM hallucination. [...] We believe this is the first report on industrial scale deployment of LLM-generated code backed by such assurances of code improvement.

    Coverage-guided unit test improvement might [with LLMs] be efficient too.

    https://github.com/topics/coverage-guided-fuzzing :

    - e.g. Google/syzkaller is a coverage-guided syscall fuzzer: https://github.com/google/syzkaller

    - Gitlab CI supports coverage-guided fuzzing: https://docs.gitlab.com/ee/user/application_security/coverag...

    - oss-fuzz, osv

    Additional ways to improve tests:

    Hypothesis and pynguin generate tests from type annotations.

    There are various tools to generate type annotations for Python code;

    > pytype (Google) [1], PyAnnotate (Dropbox) [2], and MonkeyType (Instagram) [3] all do dynamic / runtime PEP-484 type annotation type inference [4] to generate type annotations. https://news.ycombinator.com/item?id=39139198

    icontract-hypothesis generates tests from icontract DbC Design by Contract type, value, and invariance constraints specified as precondition and postcondition @decorators:

  • rod

    A Chrome DevTools Protocol driver for web automation and scraping.

  • gotests

    Automatically generate Go test boilerplate from your source code.

    Project mention: Russ Cox: Go Testing by Example | news.ycombinator.com | 2023-12-05

    A huge time-saver for me when generating table-driven test boilerplate in Go has been using gotests[0] to generate the template.

    If you use VSCode with the Go extension it's already available there as a command "Go: Generate Unit Tests for Function/Package".

    [0] https://github.com/cweill/gotests

  • go-fuzz

    Randomized testing for Go

  • realize

    Realize is the #1 Golang Task Runner which enhance your workflow by automating the most common tasks and using the best performing Golang live reloading.

  • go-cmp

    Package for comparing Go values in tests

  • dockertest

    Write better integration tests! Dockertest helps you boot up ephermal docker images for your Go tests with minimal work.

    Project mention: Testcontainers | news.ycombinator.com | 2024-02-27

    I am using https://github.com/ory/dockertest for tests, specifically for databases. Is there any advantage to use Testcontainers?

  • HTTPLab

    The interactive web server

  • keploy

    Shadow Test generation for Developers. Generate tests and stubs for your application that actually work!

    Project mention: Developer's Guide to Smoke Testing: Ensuring Core Functionality | dev.to | 2024-08-26

    ### Keploy

  • testcontainers-go

    Testcontainers for Go is a Go package that makes it simple to create and clean up container-based dependencies for automated integration/smoke tests. The clean, easy-to-use API enables developers to programmatically define containers that should be run as part of a test and clean up those resources when the test is done.

    Project mention: Testcontainers-Go: Effortless Container-Based Testing for Go Developers | news.ycombinator.com | 2024-08-14
  • Gauge

    Light weight cross-platform test automation

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
NOTE: The open source projects on this list are ordered by number of github stars. The number of mentions indicates repo mentiontions in the last 12 Months or since we started tracking (Dec 2020).

Go Testing discussion

Log in or Post with

Go Testing related posts

  • I curate a daily newsletter with resources about Golang - Daily Golang. Here are the latest 6 issues of the newsletter

    3 projects | dev.to | 19 Aug 2024
  • Testcontainers-Go: Effortless Container-Based Testing for Go Developers

    1 project | news.ycombinator.com | 14 Aug 2024
  • Princípios SOLID em GoLang - Dependency Inversion Principle (DIP)

    1 project | dev.to | 3 Aug 2024
  • Full Introduction to Golang with Test-Driven Development

    1 project | news.ycombinator.com | 3 Aug 2024
  • Go mock

    3 projects | dev.to | 30 Jul 2024
  • Understanding Tdd vs Bdd : A Guide For Developers

    1 project | dev.to | 25 Jul 2024
  • Effortless HTTP Client Testing in Go

    2 projects | dev.to | 11 Jul 2024
  • A note from our sponsor - SaaSHub
    www.saashub.com | 7 Sep 2024
    SaaSHub helps you find the best software and product alternatives Learn more →

Index

What are some of the best open-source Testing projects in Go? This list will help you:

Project Stars
1 Testify 22,960
2 learn-go-with-tests 21,947
3 Gor 18,533
4 chromedp 10,812
5 toxiproxy 10,587
6 GoConvey 8,222
7 ginkgo 8,213
8 terratest 7,451
9 go-grpc-middleware 6,247
10 go-sqlmock 6,035
11 mockery 5,947
12 goss 5,550
13 syzkaller 5,287
14 rod 5,184
15 gotests 4,918
16 go-fuzz 4,751
17 realize 4,454
18 go-cmp 4,149
19 dockertest 4,085
20 HTTPLab 4,024
21 keploy 3,854
22 testcontainers-go 3,458
23 Gauge 2,968

Sponsored
Purpose built for real-time analytics at any scale.
InfluxDB Platform is powered by columnar analytics, optimized for cost-efficient storage, and built with open data standards.
www.influxdata.com