Coder Social home page Coder Social logo

gotesttalk's Introduction

Go Unit Test and Fuzz

In this talk, we will begin by introducing Collatz problem that we can start write or functions and tests. Then move on to others Go testing techniques, such as table-driven tests, activating the race detector in tests, and writing testable examples. Finally, we will cover how to use Go benchmarks to test performance and how to incorporate random inputs in tests with Go fuzz.

This Talk Slides

Table of Contents

  • Introduction to go functions and tests with Collatz Problem.

    The Collatz problem is a simple mathematical problem that involves iterating through a series of calculations to reach the number 1. In this talk, we will use the Collatz problem as a way to illustrate basic testing techniques in Go.

  • The particular test technique of Go table driven.

    Table-driven tests are a way of testing a function by defining a table of input and expected output values. This technique is particularly useful when you need to test a function with a large number of inputs or when you need to test a function with complex input and output types.

  • Activating the race detector in Your Tests.

    The Go language has a built-in race detector that can help you identify and debug race conditions in your code. By activating the race detector in your tests, you can ensure that your code is thread-safe and free from race conditions.

  • Checking performance like a test with go benchmarks.

    Go benchmarks are a way of measuring the performance of your code in a controlled environment. By writing benchmarks for your code, you can ensure that your code is performant and that it meets the requirements of your application.

  • Writing testable examples. to your documentation.

    Testable examples are a way of incorporating examples into your code documentation that can be used as both documentation and test cases. By using testable examples, you can ensure that your code examples are always up-to-date and that they provide accurate documentation of your code.

  • Random inputs in your tests with go fuzz.

    Go fuzz is a tool that allows you to generate random inputs for your tests. By using Go fuzz, you can ensure that your code can handle unexpected inputs and that it is resilient to edge cases.

References

gotesttalk's People

Contributors

andref5 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.