by Miško HeveryRecently many of you, after reading Guide to Testability, wrote to telling me there is nothing wrong with static methods. After all what can be easier to test than Math.abs()! And Math.abs() is static method! If abs() was on instance me…
by Miško HeveryGoogle Tech TalksNovember 20, 2008ABSTRACTIs your code full of if statements? Switch statements? Do you have the same switch statement in various places? When you make changes do you find yourself making the same change to the same if/s…
It is with great pleasure that I have been able to finally open-source the Guide to Writing Testable Code.I am including the first page here for you, but do come and check it out in detail.To keep our code at Google in the best possible shape we provid…
by Miško HeveryGoogle Tech TalksNovember 13, 2008ABSTRACTClean Code Talk SeriesTopic: Global State and SingletonsSpeaker: Miško HeveryVideoSlides
by Miško HeveryI think of bugs as being classified into three fundamental kinds of bugs.Logical: Logical bug is the most common and classical “bug.” This is your “if”s, “loop”s, and other logic in your code. It is by far the most common kind of bug in…
by Miško HeveryGoogle Tech TalksNovember 6, 2008ABSTRACTClean Code Talk SeriesTopic: Don’t Look For Things!Speaker: Miško Hevery VideoSlides
by Miško HeveryGoogle Tech Talks October, 30 2008 ABSTRACT Clean Code Talks – Unit Testing Speaker: Misko HeveryVideoSlides
Testability Explorer: Using Byte-Code Analysis to Engineer Lasting Social Changes in an Organization’s Software Development Process. (Or How to Get Developers to Write Testable Code) Presented at 2008 OOPSLA by Miško Hevery a Best Practices Coach @ …
by Miško Hevery After reading the article on Singletons (the design anti-pattern) and how they are really global variables and dependency injection suggestion to simply pass in the reference to the singleton in a constructor (instead of looking them u…
by Miško Hevery Dependency injection asks us to separate the new operators from the application logic. This separation forces your code to have factories which are responsible for wiring your application together. However, better than writing factorie…
by Miško Hevery
We talked about how it is important to separate the new operators from the application logic. This separation forces your code to have factories which are responsible for wiring your application together. By separating these …
By Miško Hevery(the other title: Your Application has a Wiring Problem)In My main() Method Is Better Than Yours we looked into what a main() method should look like. There we introduced a clear separation between (1) the responsibility of constructing…
By Miško HeveryPeople are good at turning concrete examples into generalization. The other way around, it does not work so well. So when I write about general concepts it is hard for people to know how to translate the general concept into concrete co…
by Miško HeverySince I have gotten lots of love/hate mail on the Singletons are Pathological Liars and Where Have All the Singletons Gone I feel obliged to to do some root cause analysis.Lets get the definition right. There is Singleton the design pat…
by Miško HeveryIn Singletons are Pathological Liars we discussed the problems of having singletons in your code. Let’s build on that and answer the question “If I don’t have singletons how do I ensure there is only one instance of X and how do I get X…