In this course we're covering every aspect of the testing features in Go:
In this course we're covering every aspect of the testing features in Go:
Basic unit tests.
Test Driven Development.
Unit test a single layer of your application.
How to use Go modules.
How the TestMain function works and how to use it.
Mock and unit test external REST API calls.
Mock and integration test REST API calls form inner layers of your application.
How to perform functional tests.
How to define and write benchmarks to compare the quality of two versions of the same solution.
Mock and unit test MySQL database connection and query.
Mock frameworks available out there.
Asserts in Go: Why don't we have them? How to implement them in a safe way.
Welcome! Hope you'll get the most of this course! Take a look at the program, let me know the missing content you want to get covered and is not in the list of topics I'm covering here. Let me help you become better at what you do by giving me feedback about your current testing needs. I'll be adding content as soon as you send the topics and they're relevant to everyone out there struggling with tests in this amazing language.
What is testing, the different types of test (in any programming language you're using, not only Go), what each type of test must and must not do, all the theory you need to have the concepts crystal clear and start improving the quality of your products.
How unit tests are defined, types of unit tests, how to implement them, how to write them and how to execute them.
Don't trust you code's quality on the coverage you get! Make real tests and ensure that you have all three steps (initialization, execution and validation) actually covered with a real and defined criteria.
How integration tests actually work. What is the difference between unit and integration tests and how you can trust these tests to ensure different layers of your application interact in the proper and expected way.
What is a benchmark and how you can implement this type of test while making sure the opportunity cost between two different approaches is the less you can take. How you can measure the performance of a given algorithm and decide whether you use it or not.
In this lesson we're working with tests where the function being tested could timeout and we should check for that particular situation.
The reason why we don't have asserts by default in Go. How you can implement your own or use an external library to do the job for you.
How you can implement REST API calls from your code. A brand new library we've released to the public and we're actually using in our 1000+ productive microservices.
How to mock and test your entire REST integration by using the current library. Make sure every dependency you work with has a mocking feature included.
How to structure your components in a way you can easily mock and test each of them within your application.
Thanks for the feedback! Based on that, I'm uploading this new lesson where you can learn how to design and implement functional tests in your application.
Hope you like the lesson! As always, let me know any comments!
In this lesson we're creating our own SQL client to use in all of our repos.
Repo: https://github.com/federicoleon/sql-client
Adding features to the SQL client library available at https://github.com/federicoleon/sql-client
If you have any questions or comments that are not particularly about the topics treated during this course you can always use the Q&A section and I'll make sure you clear your doubts by publishing content about those topics or issues as well. If you like what you're looking and getting, take a look at my website, there is a lot more in there!
OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.
Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.
Find this site helpful? Tell a friend about us.
We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.
Your purchases help us maintain our catalog and keep our servers humming without ads.
Thank you for supporting OpenCourser.