How do programmers work together on a project?

Actually, there are as many variations on these processes as many companies there are. Meaning: every company has a little bit different conventions than others, but there are some common best practices that are generally used in most places. Best practices that are always useful All the source code of the project and anything that … Read more

How deep are your unit tests?

I get paid for code that works, not for tests, so my philosophy is to test as little as possible to reach a given level of confidence (I suspect this level of confidence is high compared to industry standards, but that could just be hubris). If I don’t typically make a kind of mistake (like … Read more

Should Private/Protected methods be under unit test? [closed]

No, I don’t think of testing private or protected methods. The private and protected methods of a class aren’t part of the public interface, so they don’t expose public behavior. Generally these methods are created by refactorings you apply after you’ve made your test turn green. So these private methods are tested implicitly by the … Read more

Any suggestions for testing extjs code in a browser, preferably with selenium?

The biggest hurdle in testing ExtJS with Selenium is that ExtJS doesn’t render standard HTML elements and the Selenium IDE will naively (and rightfully) generate commands targeted at elements that just act as decor — superfluous elements that help ExtJS with the whole desktop-look-and-feel. Here are a few tips and tricks that I’ve gathered while … Read more

maven :: run only single test in multi-module project

I assume you’ve read the docs about running a single test under surefire? What they don’t tell you is how to do that in a sub-module: mvn test -Dtest=testname -pl subproject Where subproject is the project containing that test. From the mvn man page: -pl,–projects arg Comma-delimited list of specified reactor projects to build instead … Read more

What Makes a Good Unit Test? [closed]

Let me begin by plugging sources – Pragmatic Unit Testing in Java with JUnit (There’s a version with C#-Nunit too.. but I have this one.. its agnostic for the most part. Recommended.) Good Tests should be A TRIP (The acronymn isn’t sticky enough – I have a printout of the cheatsheet in the book that … Read more