Just A Little Bit Better
Test-first development without the fanaticism
Have some test-driven development advocates gone so far with their cause that they've actually turned off some developers? Are the doctrines, or how they're espoused, driving some developers away?
John FergusonÂ Smart doesn't cite any particular argument or dispute in his latest blog, but with a title like Tests first or tests last - come on, who cares?, you have to wonder if he's responding to someone, somewhere, who's become dogmatic in declaring that you must write your tests before you write any code. John writes:
Let's not be pedantic. Write unit tests before you code a method, or after it - in my experience, it matters little, as long as you think about and write the tests at roughly the same time as you write the code. It's comming back to do the tests later (or not coming back at all) which causes problems. Personally, I like to write unit tests just before or immediately after writing small chunks of code - it doesn't break the flow, because it is part of the flow.
Still, it's not like he's saying you get a pass on writing your tests as part of the coding process. Writing them at the end doesn't work:
In my experience, when people set out to write unit tests after the fact, they write them poorly, as an afterthought ("I've finished all the code, now I just have to write the unit tests"). Or not at all. In this case, is the code really finished? Well, if it works perfectly, it is, in which case, writing the unit tests looses a good chunk of its value proposition. But often it doesn't, and the unit tests written afterwards will be superficial, and will not always test the code well. Or, developers run out of time and don't bother with testing at all.
Does this match with your experience? Do you write tests early and does it work for you? Or do you not use TDD, and do you wonder if you should?
Also in today's Weblogs, FelipeÂ Gaucho wonders aloud Should I use EJB3 as web-services?
"EJB3 makes it really easy to create web-services but sometimes I feel unsafe to expose my business components unfiltered on the web. That is the first of a series of open questions I plan to discuss during Jazoon'08."
Finally, DanielÂ Wildt offers
Tools for Java projects using Agile Methodologies - Presentation from RSJUG Day.
"The use of Agile Methodologies practices can get some help from java tools. In this post I'm talking about a presentation in an event from RSJUG, the Rio Grande do Sul Java Users Group about Tools for Java projects using Agile Methodologies."
In Java Today,
the Early Draft Review phase has just started for JSR 314, JavaServer Faces 2.0, the first major revision of the JavaServer Faces specification since JSR 127. The major goals of the JSR are ease of development, inclusion of new features (including Ajax awareness and bookmarkability of JSF pages), performance, scalability, and technology adoption. The draft can be downloaded from the JCP home page, and the review period continues through July 2.
A new PDF from DZone's "Refcardz" offers an overview of Dependency Injection in EJB 3 by Oracle's Debu Panda. "With EJB 3, dependency injection has greatly simplified accessing EJB, JPA Entity Manager, resources such as JDBC DataSource and JMS Objects, and services such as Timer, User Transaction, and Web Services. You will find this reference card useful when building enterprise Java applications with EJB 3 and JPA. This reference card lists all metadata annotations, describes them and provides examples. It also provides descriptions for XML elements that you can use for injection."
The latest edition, issue 170, of the JavaTools Community Newsletter is out, with tool-related news from around the web, three new tools in the community, and a Tool Tip on Enerjy, a free static code analysis tool for Eclipse.
In today's Forums,
paulbakker hopes to make a
"What would be the easiest way to implement a glasspane using JavaFX? I was playing around with using the frame.getJFrame().setGlassPane() method. This works, but you can only set a JComponent (which makes sense, because it's just a Swing class). The point I got stuck was by implementing the glasspane class itself. This is possible using pure Java and Graphics2D, but not really what I want. When using JavaFX I have the problem that I can either create something that extends Node, which isn't a JCompnent so it can't be used, or I have to create a JavaFX class that extends JComponent somehow. By doing this I seem to lose functionallity to set opacity for example."
Bill Foote explains the limits on Blu-Ray and interactive TV app deployment, in
Re: [BD-J-DEV] How can an Xlet application be deployed to the TV receivers independently?
"So, generally speaking, you can't "install" an app on any of these boxes, and then run it on top of content you don't own. This isn't due to a technical limitation; rather, it's due to a security model that was intentionally put in place to protect the rights owners. Of course, if you have content yourself, and you want to let people put applications on top of your content, there are zillions of ways you can enable that in Blu-ray, and if you care to negotiate carriage with IPTV or cable service operators, you could duplicate the experience over there."
aefremovwould like to know
how to enable snmp for a custom Mbean.
"I'm looking for a way to enable snmp management of ear module in glassfish. It seems obvious to write MBean. But I can't find any snmp connector for glassfish."
Current and upcoming Java
- JuneÂ 6-8 - Lone Star Software Symposium 2008: Dallas Edition
- JuneÂ 18-20 - TheServerSide Java Symposium-Europe
- JuneÂ 20-22 - Research Triangle Software Symposium 2008
- JuneÂ 23-26 - Jazoon'08
- JulyÂ 11-13 - Lone Star Software Symposium 2008: Austin Edition
- JulyÂ 18-19 - Salt Lake Software Symposium 2008
- JulyÂ 25-27 - Central Ohio Software Symposium 2008
- JulyÂ 25-27 - Desert Southwest Software Symposium 2008
Registered users can submit event listings for the
href="http://www.java.net/events">java.net Events Page using our
href="http://today.java.net/cs/user/create/e">events submission form.
All submissions go through an editorial review before being posted to the
Archives and Subscriptions: This blog is delivered weekdays as
Today RSS feed. Also, once this page is no longer featured as the
front page of java.net it will be
archived along with other past issues in the href="http://today.java.net/today/archive/">java.net Archive.
Test-first development without the fanaticism