Technical Questions 2 Flashcards
1
Q
What is the purpose of a Dependency Injection (DI) in testing?
A
DI allows decoupling of components, making it easier to mock dependencies in unit tests. It enables more flexible and testable code by injecting mock or real objects at runtime instead of hard-coding dependencies.
2
Q
How do you perform database testing in automated tests?
A
I use SQL queries to validate data before and after the execution of test cases, ensuring data integrity. For automated tests, I prefer to mock database interactions to avoid affecting production data.
3
Q
A
4
Q
A
4
Q
A
4
Q
A
5
Q
A
6
Q
A