Open Source Testing
I went looking for free and/or open source coverage testing tools as alternatives to Clover and jcoverage and found Open Source Testing. Handy.
22 Dec 2003 Sam comments off
I went looking for free and/or open source coverage testing tools as alternatives to Clover and jcoverage and found Open Source Testing. Handy.
22 Dec 2003 Sam comments off
I’ll have to collect my thoughts later, but a quick few notes on the Government IT Symposium. I kinda hate to unceremoniously dump these notes here without taking the time to think things through, but some things didn’t make it into my written notes, so they end up here.
Okay, now off to sleep. More sessions tomorrow.
10 Dec 2003 Sam comments off
Starting tomorrow I’ll be at the Minnesota Government IT Symposium. If you’ll be there, drop me a line (sam at afongen dot com). Or just look for me: I’ll be the hostile-looking guy in the corner, wishing there weren’t so many frelling people.
I see that there will be a wireless network. Good; I was worried. In fact, “the network will blanket the RiverCentre and extend up to 30 miles away!” Show-offs. Now I can take notes with SubEthaEdit and see if anyone joins in. ‘Course, how much do you want to bet that I’ll be the only one there with a Mac?
The Symposium itself looks mostly worthwhile. I just couldn’t bring myself to attend the day-long seminar on government web sites (“Usability, Ethics, and Accessibility”): I would have been bored out of my mind. I figure the project management seminar will be more useful for professional development. I’m still trying to make my mind up about some of the shorter concurrent sessions. As usual, there are some times when none of the sessions grab me, others where I can’t decide between several.
Speaking of conferences, it’s been suggested that I submit a proposal to do a session on web accessibility at an upcoming conference. It’s a good idea ⅀ I’m all for faculty learning more about how to make their online course materials more accessible, and I know that I could do a compelling session — but I don’t think that I’ll submit a proposal. My mind is so very elsewhere right now, mostly immersing myself in the fun-filled world of Java web development. Maybe I’ll try to do something at ITeach, which comes later this spring.
09 Dec 2003 Sam comments off
I’ve been waiting for this for months, and here it is. Battlestar Galactica just started on the Sci Fi channel. I have only vague memories of watching the original as a kid, and they’re campy memories at that, so I can’t be too disappointed. Heh. No, I’m being unfair, it looks very cool. I mean hey, Cylons can have sex.
08 Dec 2003 Sam comments off
Macromedia have open-sourced Spectra, their ColdFusion-based content management system (originally Allaire Spectra). They’re no longer developing or selling it, so why not release the source?
Of related interest: FarCry, an open source CMS using ColdFusion MX.
06 Dec 2003 Sam comments off
private
isn’t.
On Friday I was getting a crash course in the JBoss/Spring/Velocity combination that we’re experimenting with at work. We started with a trivial class, something like this:
public class Person {
private String firstName = "Peter";
private String lastName = "Penguin";
public String getFirstName() {
return firstName;
}
public String getLastName() {
return lastName;
}
}
The template did something like this:
<p>Name: $Person.getFirstName() $Person.lastName</p>
We used both the getFirstName()
getter method and the lastName
variable to demonstrate that it worked both ways. But I didn’t really understand how, since lastName
is private
. I vaguely remembered some way around this security restriction but couldn’t remember the details. Not that it mattered, since it was unlikely that the technique was being used in Velocity, or even that it would work in a web environment.
So what’s going on? I renamed getLastName()
to getLname()
and the template stopped working. Ah ha! Turns out that the template engine sees the lastName
variable and makes a reasonable stab at the getter method’s name. That’s a handy technique to keep in mind.
But what about this security restriction workaround that I thought I’d seen? Was I out of my mind? Amazingly, no! In “Subverting Java Access Protection for Unit Testing” Ross Burton writes about something that I’ve been wondering for some time: how to do decent unit testing in Java without making all my variables and methods public
or subverting my design just to make them available to test code in the same package.
The Java Reflection API allows the program to introspect arbitrary classes at runtime, accessing members at will. Most competent Java programmers should know this much, but what many don’t know is that the security layer preventing you from accessing
private
members is only optional, and can be turned off. This allows the system code to be written without explicitly planning the unit tests, and if the unit tests really do need to access aprivate
orprotected
member, they can.
Excellent. This makes proper unit testing so much easier, as you aren’t restricted to “black box” testing of just public methods. Wonderful. Maybe reading the fine print in the API documentation is worthwhile, after all.
06 Dec 2003 Sam comments off
Don’t worry, I don’t actually have anything of the sort. But I can relate.
02 Dec 2003 Sam comments off
I really have to set up a linkblog.
01 Dec 2003 Sam comments off