Senior
What types of testing have you done, and which ones do you know?
sobes.tech AI
Answer from AI
I have experience with several types of testing:
-
Unit testing — testing individual functions and methods. In Go, I use the
testingpackage for writing tests, often with mocks to isolate dependencies. -
Integration testing — testing the interaction between components, such as with databases or external services.
-
End-to-End (E2E) testing — testing the entire system as a whole, often through HTTP requests to APIs.
-
Load testing — to evaluate performance and stability under load.
-
Security testing — checking for vulnerabilities, for example through static code analysis and manual audits.
Here's an example of a simple unit test in Go:
func TestAdd(t *testing.T) {
result := Add(2, 3)
if result != 5 {
t.Errorf("expected 5, got %d", result)
}
}