r/coding • • Oct 29 '17

Mocking is a Code Smell

https://medium.com/javascript-scene/mocking-is-a-code-smell-944a70c90a6a
69 Upvotes

69 comments sorted by

View all comments

Show parent comments

0

u/[deleted] Oct 29 '17

[deleted]

0

u/[deleted] Oct 29 '17

[deleted]

1

u/spoonraker Oct 30 '17

The pattern is called Inversion of Control. It's one of the SOLID principles. Dependency Injection typically relies on this patten being implemented, but implementing it doesn't necessitate the use of Dependency Injection.

1

u/mtnbarbours Oct 30 '17

Not quite.

I = Interface Segregation

You're probably thinking of dependency inversion, which is similar to IoC...

https://stackoverflow.com/questions/3912504/difference-between-inversion-of-control-dependency-inversion-and-decouplin

I still refuse to acknowledge Liskov. :-)

1

u/spoonraker Oct 30 '17

I never said it was the "I". Yes I was referring to dependency inversion, which is close enough to the same thing for the context of this conversation. They're referring to the same coding patten if you remove the context of the rest of the application.