Monkey patching is also bad because in order to do it you must know some of a units implementation in order to patch the correct things. With dependency injection it becomes part of the interface. This way tests wont break when you change implementation.
brilliant talk...just loved the fact that the talk was very precise and also appreciate the speaker's attitude in accepting the opinions from viewers...
Is he a googler. ? I doubt tat ...Yes he has some valid points ..But for a googler his presentation is all over the place.. For example, Static methods are hard to Test ?. As we know we write helper class with static methods.. Is it hard to test the class ? no not really.... It shoud be static methods are hard to mock.. The class which consumes static methods has no way to mock that particular method.. ? Should we write helper classes with static methods then?Thats a huge topic for discussion.
He makes some excellent points, but at the same time he makes it sound like there is nothing to say about writing unit tests. That isn't true. Tests should be short, clear and focused. They should mock out dependencies and test one thing at a time. Otherwise you don't know where to look when they fail. Writing good tests doesn't happen automatically by writing testable code and writing the tests first. It takes practice and thought.
Excellent, very insightful. I've been enjoying Misko's essays for a while now.
However, in dynamic languages, I don't think it is true that static method calls cannot form a seam for testing. In Python, for example, a static method can be patched out temporarily on either the current module, or another module, for the duration of the test. We use this technique at my work all the time for testing.
I love these Clean Code Talks with Misko too, he's resolved a lot of issues for me.
View the latest one for examples of why static methods, global state and singletons make bad seams and make code harder to test. Even when you can mock the state, its an indication that something else depends on it, that tests have to be run in a specific order, and lots of other issues. It's enlightening.
I absolutely loved this talk.. Keeping seems in mind from now on!
CapumOfOuttaSpace 3 weeks ago in playlist Favorite videos
Excellent talk. Very concise and intuitive examples.
TheDerravaragh 3 months ago
Monkey patching is also bad because in order to do it you must know some of a units implementation in order to patch the correct things. With dependency injection it becomes part of the interface. This way tests wont break when you change implementation.
FlareVulca 3 months ago
Jesus... Is it from Google?
gsagula2 4 months ago
Building a car, you need a facade, users doesnt have to know how car works. So we implement the facade yes?
Likewise while testing, you can plug the tests to a facade and you can test it, you ll find out where it fails.
h2o2m3n 5 months ago
code quickly becomes hard to test if it is written .... _before_ the unit tests ;)
adg16610 6 months ago
brilliant talk...just loved the fact that the talk was very precise and also appreciate the speaker's attitude in accepting the opinions from viewers...
becku007 7 months ago
Is he a googler. ? I doubt tat ...Yes he has some valid points ..But for a googler his presentation is all over the place.. For example, Static methods are hard to Test ?. As we know we write helper class with static methods.. Is it hard to test the class ? no not really.... It shoud be static methods are hard to mock.. The class which consumes static methods has no way to mock that particular method.. ? Should we write helper classes with static methods then?Thats a huge topic for discussion.
mohrukh 9 months ago 3
Comment removed
mohrukh 9 months ago
This has been flagged as spam show
Existent latian beautiful girls dating busizz4me.info
tinajul 1 year ago
This has been flagged as spam show
We hit it off so well after another visit busizz4me.info
sadulkmali 1 year ago
This has been flagged as spam show
We hit it off so well after another visit busizz4me.info
ayasadisanyaka 1 year ago
He makes some excellent points, but at the same time he makes it sound like there is nothing to say about writing unit tests. That isn't true. Tests should be short, clear and focused. They should mock out dependencies and test one thing at a time. Otherwise you don't know where to look when they fail. Writing good tests doesn't happen automatically by writing testable code and writing the tests first. It takes practice and thought.
ayezick 1 year ago 2
This has been flagged as spam show
Need to marry you **busizz4me.info**
kutroyortana 1 year ago
Some great information. I like that you talk about things that aren't emphasized in school.
ChevailerNoir 1 year ago
that was great!
spamero2 1 year ago
when he mentioned about the evil of global state, i almost instatly thought of NWO.. :))
I think that's an analogy for the human anthropological level, and it's definitely untestable :P
johanizahri 2 years ago
Great video!
N4ll1fy 2 years ago
Great talk as for me. Just don't understand why there is no people in the end. Is this staff so obvious for Google guys?
zhabervog 2 years ago 10
Comment removed
gdichev 2 years ago
great talk!
neohubris 3 years ago 4
Keep the good Talks !
succelus 3 years ago 21
This should be part of some kind of "Google academy for software developers"
A kind of virtual course for student with, and without, CS (or related) degrees.
D3mi4n 3 years ago 4
Excellent, very insightful. I've been enjoying Misko's essays for a while now.
However, in dynamic languages, I don't think it is true that static method calls cannot form a seam for testing. In Python, for example, a static method can be patched out temporarily on either the current module, or another module, for the duration of the test. We use this technique at my work all the time for testing.
tartley 3 years ago 3
I love these Clean Code Talks with Misko too, he's resolved a lot of issues for me.
View the latest one for examples of why static methods, global state and singletons make bad seams and make code harder to test. Even when you can mock the state, its an indication that something else depends on it, that tests have to be run in a specific order, and lots of other issues. It's enlightening.
scottburton11 3 years ago