Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Golang Unit Testing: Brief Guide and Best Practices #103

Open
matthawkins90 opened this issue Mar 28, 2022 · 0 comments
Open

Golang Unit Testing: Brief Guide and Best Practices #103

matthawkins90 opened this issue Mar 28, 2022 · 0 comments

Comments

@matthawkins90
Copy link
Contributor

I'm trying to teach myself Go.

Unit tests are highly valued for these projects. Unit tests are also a great way for new contributors to get familiar with a project, and can also serve as a form of documentation for how code works.

I think it would be a good idea to have a basic guide and "best practices" in the Contributing section of the dev docs, just to start collecting that knowledge there.

I'm thinking about having sections like:

  • Example of how to run tests that are already there
  • Example of how to run a specific test
  • Best practices for writing good tests:
    • Table-driven tests
    • Subtests
  • Measuring code coverage
  • Finding areas of the codebase that need unit tests

I'm definitely not an expert on any of these topics, but I want to start aggregating information into a guide. I would welcome any tips or examples to follow from more experienced devs here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant