In Swift, what is 'dependency injection' and why is it important for testability?
-
A
Automatically importing frameworks at build time
-
B
Passing dependencies into an object rather than creating them internally, enabling substitution in tests
-
C
Injecting code into a running process for debugging
-
D
A method of managing Swift packages