By Miško HeveryBest way to learn TDD is to have someone show you while pairing with you. Short of that, I have set up an eclipse project for you where you can give it a try:hg clone https://bitbucket.org/misko/misko-hevery-blog/Open project blog/tdd/0…
By Miško HeveryA lot of people have been asking me lately, what is the cost of testing, so I decided, that I will try to measure it, to dispel the myth that testing takes twice as long.For the last two weeks I have been keeping track of the amount of…
By Miško HeveryOnce upon a time Java created an experiment called checked-exceptions, you know, you have to declare exceptions or catch them. Since that time, no other language (I know of) has decided to copy this idea, but somehow the Java developers…
by Miško HeveryI would like to make an analogy between building software and building a car. I know it is imperfect one, as one is about design and the other is about manufacturing, but indulge me, the lessons are very similar.A piece of software is l…
by Shyam SeshadriBefore I jump into how exactly you can perform super fast and easy JS testing, let me give you some background on the problem.Javascript is a finicky language (Some people even hesitate to call it a language). And it can easily grow an…
by Miško HeveryEveryone seems to think that they are writing OO after all they are using OO languages such as Java, Python or Ruby. But if you exam the code it is often procedural in nature.Static MethodsStatic methods are procedural in nature and the…
by Shyam SeshadriNowadays, when I talk with (read: rant at) anyone about why they should do test driven development or write unit tests, my spiel has gotten extremely similar and redundant to the point that I don’t have to think about it anymore. But e…
by Miško HeveryYou hear people talking about small/medium/large/unit/integration/functional/scenario tests but do most of us really know what is meant by that? Here is how I think about tests.Unit/SmallLets start with unit test. The best definition I …
Take your average developer and ask “do you know language/technology X?” None of us will feel any shame in admitting that we do not know X. After all there are so many languages, frameworks and technologies, how could you know them all? But what if X i…
by Shyam SeshadriWe all have separation anxiety. Its a human tendency. We love inertia, and we don’t like change. But why should your code have separation anxiety ? Its not human (even though it might try and grow a brain of its own at times)!I bring…
by Miško Hevery & Jeremie Lenfant-engelmannDid you notice that there are a lot of JavaScript testing frameworks out there? Why has the JavaScript community not consolidated on a single JavaScript framework the way Java has on JUnit. My feeling is …
by Miško HeveryThere seems to be two camps in dependency-injection: (1) The constructor-injection camp and (2) the setter-injection camp. Historically the setter-injection camp come from spring, whereas constructor-injection camp are from pico-contain…
by Miško HeverySome of the strongest objections I get from people is on my stance on what I call “defensive programming”. You know all those asserts you sprinkle your code with. I have a special hate relationship against null checking. But let me expl…
by Miško HeveryA great question from the reader…The only thing that does not fully convince me in your articles is usage of Guice. I’m currently unable to see clearly its advantages over plain factories, crafted by hand. Do you recommend using of Gu…
by Miško HeveryShahar asks an excellent question about how to deal with frameworks which we use in our projects, but which were not written with testability in mind.Hi Misko, First I would like to thank you for the “Guide to Writing Testable Code”…