testing-benchmark

module
v0.0.0-...-4d7ac9f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2023 License: Apache-2.0

README

Testing and Benchmarking

Testing

There are two main kinds of tests

  1. Functional Testing types

    • Unit Testing
    • Integration Testing
    • System Testing
    • Sanity Testing
    • Smoke Testing
    • Interface Testing
    • Regression Testing
    • Beta/Acceptance Testing
  2. Non-functional Testing

    • Performance Testing
    • Load Testing
    • Stress Testing
    • Volume Testing
    • Security Testing
    • Compatibility Testing
    • Install Testing
    • Recovery Testing
    • Reliability Testing
    • Usability Testing
    • Compliance Testing
    • Localization Testing

We will be mainly looking at unit testing our REST API in this section. Some of these testing are out of scope for our code altogether. For example, System Testing or Regression Testing.

Unit Testing

Unit test checks the functionality of single unit of code and confirms agains know output that the result is consistent.

Go has a built-in package httptest for testing http methods.

Look at courses_test.go for some examples of http tests in go. I leave writing test for the other handlers as an exercise you you.

Running the Test

To run the code in this section

git checkout origin/testing-benchmarking-01

If you are not already in the folder

cd testing-benchmark
go test -v ./...

Directories

Path Synopsis
cmd
web command
internal
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL