Basics of Testing
- What is testing, and why is it important in backend development?
- What are the different types of testing in software development?
- How do you write a basic test in Golang? Can you explain the structure of a test function?
- What is the
testing
package in Golang?
- How do you run tests in Golang?
- what is the meaning of this command? "go test -cover”
- How do you handle test failure in Golang? (running test in isolation is discussed here)
- How can you measure code coverage for tests in Golang?
- What are sub-tests in Golang, and how do you use them?
Unit Testing
- What is unit testing, and how does it differ from other types of testing?
- How do you test functions with multiple return values in Golang?
- How do you test a function that interacts with an external dependency (e.g., a database)?=======
- What is a table-driven test, and why is it used in Golang?
Mocking
- What is mocking, and why is it important in backend testing?
- "How do you test a function that interacts with an external database? give example using testify mock and testify assert
Integration Testing