1 / 7

Testing in Golang

<br>Golang is a lightweight, new open-source language which has several features that make automated and manual testing easier. Due to feature-rich standard library support, it provides a desirable environment for running and writing tests.

Download Presentation

Testing in Golang

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Benefits of testing in Golang

  2. Introduction • Go is a modern open-source language that has several features which make manual as well as automated testing easier. • Go Test tool conducts writing tests at development time. • Golang provides code coverage analysis, displaying exact lines exercised by tests. • Following are some of the advantageous features Golang brings to testing environment:

  3. Logrus Logrus is a feature-rich structured logger for Golang. We can write logs asynchronously to avoid extra overhead on the system. Benefits: •  Due to asynchronous logging important resources can be saved for other priority tasks. •  Service Hooks such as Airbrake help in quick bug fixing and superior test code quality while Redis features in-memory data set. •  Efficiently track and write logs that result in neat and well-written code.

  4. Golang Benchcmp • The benchcmp command displays performance changes between benchmarks. Benchcmp parses the output of two 'go test' benchmark runs, correlates the results per benchmark, and displays the deltas. • By setting benchmarks we can easily compare system calls by understanding which piece/version of code performs better. Benefits: • Implement superior quality code which is free of any performance bottlenecks.

  5. Uber Go-Torch • Uber Go-Torch is a tool for stochastically profiling Go programs. It collects stack traces from Golang’s built-in pprof library and synthesizes this information into a flame graph. The flame graph generates data sets about Time consumption, Memory Consumption, CPU Usage and more. Benefits: • With so many inputs at their disposal, Uber Go-Torch helps developers to understand and optimize the code to improve system performance to the function level. • The resulting code is optimized for speed, CPU usage, memory usage, performance and time.

  6. Golang Pprof Golang Pprof is Golangs built-in Library. It continually generates data. By utilizing the Pprof tool we are able to perform CPU profiling of the system. It helps us analyze the CPU dump and then generate reports on performance in the CPU by generating a flame graph. Benefits: • When used in collaboration with Uber Go-Torch, Golang Pprof helps develop code that performs at an optimized level.

More Related