August 2019
Beginner to intermediate
798 pages
17h 2m
English
The Go standard library offers the testing/quick package, which can be used for black-box testing and is somewhat related to the QuickCheck package found in the Haskell programming language – both packages implement utility functions to help you with black-box testing. Go can generate random values of built-in types. The testing/quick package allows you to use these random values for testing, which saves you from having to generate all these values on your own.
A small program, which is saved as randomBuiltin.go and illustrates how Go can generate random values, is the following:
package main import ( "fmt" "math/rand" "reflect" "testing/quick" "time" ) func main() { type point3D struct { X, Y, Z int8 S float32 } ...Read now
Unlock full access