Posts Tagged “quality”
Are unit tests and unit testing on the decline? Here is an interesting blog post that discusses this very question.
My $0.02: Read the rest of this entry »
No Comments »
Andy Glover is a generally nice guy, and he knows a thing or two about software quality. He came and spoke to us at the Southeast Virginia Java Users Group once, and I was very favorably impressed.
Anyway, Andy has written a new tutorial on using Hudson for continuous integration. I have used Hudson myself and it ROCKS. Amazingly simple to install (just download and deploy the war), full-featured, easy to use, and looks nice too.
2 Comments »
Those of you who know me or who have read my earlier posts know that I am a static code analysis fan, and some of my favorite tools are PMD, Checkstyle, FindBugs, and JDepend, for their excellent feedback on the state of the quality of your code. In fact, I regularly use all of them and usually in combination with other tools (such as JUnit, Emma, etc) to gather code metrics.
The reports from each of these tools naturally identify problems — why else would you run them? And once you see a problem, you naturally want to run right out and fix them. The report shows them all, rated by severity, with counts and everything, and you can see the types of errors. It’s just a simple refactoring, right?
Better think twice before activating that refactoring in your IDE.
Read the rest of this entry »
No Comments »
In a previous job, I had a trainer for a CASE tool who gave me a phrase that has stuck with me for the past 15 years: “A fool with a tool is just a faster fool.” The truth of this is obvious on the surface, of course, but many times we developers don’t see it happening to us as it happens - the onset is too gradual. I am beginning to see an emergent anti-pattern, particularly among my less experienced colleagues, which has cropped up as a result of Eclipse usage - something I call “Squiggly-Driven Development”.
Read the rest of this entry »
No Comments »
While preparing a training class this past month on Effective Exception Handling for a client, I came up with a list of “Ten Commandments of Exception Handling.” Some of them were the basic, standard items (”Thou shalt not catch or throw java.lang.Throwable”, “Thou shalt not throw raw java.lang.RuntimeExceptions–thou shalt throw a subclass instead”, “Thou shalt not catch an Exception unless thou art going to truly handle it, or are going to wrap it in another Exception”). Other items on the list were specifically tailored for the client. I liked one of the “commandments” better than the others, however:
“XIII: Thou shalt not catch any Exceptions in JUnit tests, unless testing that your code under test throws the Exceptions the API says it does.”
If you read this and say, “well, duh, Matt!” then you and I are thinking alike and I am preaching to the choir. If this statement has even a whiff of controversy to it, however, read on.
Read the rest of this entry »
No Comments »
In a previous blog entry I mentioned that I like emma for measuring code coverage in my JUnit test suites. In this entry I will discuss several items that make some JUnit test suites stronger than others. In this entry I am discussing JUnit 3.8.1.
How do you measure the quality of your JUnit tests and put a number
on it? This is a very good question with no quick and easy answers,
I’m afraid. I can tell you two answers that are NOT measures of test quality:
- “We have 100% success rate in our test suites every night.”
- “We have 100% code coverage”
Read the rest of this entry »
No Comments »
The movie The Untouchables had Robert DeNiro as Al Capone deliver a great line: “You can get a lot further with a kind word and a gun than you can with a kind word.”
Now, I’m not promoting the violence, but in the world of corporate computing there will always be times of competing claims. You’ve seen it. The systems guys will claim your application crashed their database. Another developer will claim that you’ve broken their code. Your project manager will claim that you should be able to complete a task in a certain amount of time that they’ve pulled out of thin air. You obviously think differently, but how do you make your case?
Well you can get a lot further with a kind word and a gun than you can with a kind word, and that gun is a number. A quantitative measure. In short, a metric.
Read the rest of this entry »
No Comments »
Sometimes you may find your team continually doing something that you wish they wouldn’t do. For example, you may find them continually hardcoding references to their c: drive in code, when the code eventually needs to run on a Linux box, but they never work on anything but Windows.
When cases like this arise, it’s almost obscenely easy to write a custom PMD rule to do code reviews for you to look for and flag these problems. PMD (pmd.sourceforge.net) is a tool for doing static code analysis and producing XML output files which can be transformed into useful outputs (such as HTML reports) for later perusal. Plug-ins for most major IDEs are also available.
Read the rest of this entry »
No Comments »
|