Slashdot Mirror


Java Tools For Extreme Programming

David Kennedy writes: "Java Tools For Exteme Programming: Mastering Open Source Tools including Ant, JUnit and Cactus by Hightower & Lesiecki is a welcome addition to my bookshelf at work. It tackles a gap in the Java book market in dealing with the thorny issues of testing, integration and deployment." The rest of his review is below. Java Tools For Exteme Programming: Mastering Open Source Tools including Ant, JUnit and Cactus author Richard Hightower & Nicholas Lesiecki pages 516 publisher Wiley Computer Publishing rating 8 reviewer David Kennedy ISBN 047120708X summary Practical introduction to Java tools for Extreme Programming, with an emphasis on immediate results rather than deep theory.

In recent years there has been a increased emphasis on Agile Software Development. The most prominent of these methodologies is probably Extreme Programming.

What sets Extreme Programming apart from most other Agile Technologies, in my opinion at least, is that it has provided practical, easy-to-use tools to support its way of working. Most of these tools (Ant, JUnit etc) are Open Source and freely available. However popular these tools have been with the Open Source and Extreme Programming communities, it has arguably been difficult to introduce them to traditional IT development environments. This has been primarily due to the problems of justifying spending time on 'playing' with something and the difficulties of retro-fitting new tools to an existing development environment (think projects of 150+ people which have been releasing for 5-10 years for some idea of the potential problems).

It's worth noting that when embarking on a new, large-scale project it's very difficult to find a book discussing the issues of controlled builds, integration and deployment in practical terms. The most valuable aspect of Java Tools for eXteme Programming is that it's alone in its market niche.

The book is mainly useful as (a) an introduction to the various building and continuous testing tools out there and (b) a tutorial to getting them setup and working on your computer. As the authors note, there's a critical period where the user must get some result after playing with the tool for a short period of time or just give it up as 'too difficult.'

From a technical standpoint the book is very readable, but it doesn't tackle any one subject in great depth. It certainly provides enough information to get you up and running, and also, perhaps more valuably, illustrates how to integrate the tools together. It's an excellent primer for those who want to use the tools but are unsure of how exactly to start.

What's covered? Here are the chapter headings:

  1. Introduction and Key Concepts
    1. Introduction to Extreme Programming
    2. J2EE Deployment Concepts
    3. Example applications
  2. Mastering the Tools
    1. Continuous integration with Ant
    2. Building Java Applications with Ant
    3. Building J2EE applications with Ant
    4. Unit testing with JUnit
    5. Testing Container Services with Cactus
    6. Functional Testing with HttpUnit
    7. Measuring Application Performance with JMeter
    8. Load Testing with JUnitPerf
  3. API and Tag Reference
    1. Ant Tag Reference
    2. Ant API Reference
    3. JUnit API Reference
    4. Cactus API Reference
    5. HttpUnit API Reference

If you use some of these tools already will you learn anything? Probably -- I personally have been using JUnit to test EJBs for almost nine months now but didn't know about JUnitPerf or Cactus.

Should you buy it? If you're new to the tools, then Yes. If you work in a professional but traditional IT shop, I'd buy one for the group (I have). It'd be particularly useful when dealing with management and proposing changes to working processes, or when trying to bring co-workers up to speed and sell them the benefits of agile ways of working.

You can visit the book's website at Wiley. You can purchase the Jave Tools For Extreme Programming from bn.com. Want to see your own review here? Just read the book review guidelines, then use Slashdot's handy submission form.

7 of 175 comments (clear)

  1. Java Refactoring Browsers by Frums · · Score: 4, Informative

    I'v enot read the book, but looking at the chapter headings they seem to have leftout one great tool for XP in Java - the various refactoring browsers that are now hitting stride for Java, including JRefactory, IDEA (my favorite IDE period), jFactor, and X-ref (for the Emacs lovers)

    With the XP RefactorMercilessly principle, IDE support for for refactoring is a must on big projects. Custom writing a Perl, sed, or awk script to move a method from one class to another (in its argument list) is possible, having IDEA or another refactoring tool handle all the updates across 2000 changes in 700 files is a lot nicer.

    -Frums

  2. Naked objects by fuzzbrain · · Score: 4, Informative

    One extreme programming tool written in Java which I haven't seen mentioned here is that of Naked Objects. I had play with it the other day and thought it quite a neat idea.

  3. Re:Read the book... by thenerd · · Score: 4, Informative

    XP is for hackers who want to improvise, and upon whom nobody relies for their survival. If people built houses, bridges and planes this way we'd all be up in arms about the lack of quality.

    This isn't true - XP is no more for hackers than any other type of programmer. At the core of XP is building quality in from the first stages. For example, one of the XP techniques, pair programming, though very intensive, increases quality through a continual peer-review - you have two coders going at the same code on one machine - any line of code that doesn't cut the mustard is more likely to be found.

    Additionally, XP tends away from 'big-bang' integration scenarios by having early releases, regardless of size - this means the system is all working together from the beginning, and that bugs residing in different definitions of what an interface 'really' means are found early before they cause problems. If that wasn't enough, there is also a large concentration on testing - before writing the code, XP users are thinking 'how are we going to test this? Exactly? What are the exact criteria for success of this unit?'.

    It isn't a tenet of XP that you 'continually change each piece'.

    XP isn't a tool for hackers, it's got nothing to do with it. Nobody is saying 'don't design the architecture of your system', nor is anyone saying 'change things around until they work'.

    thenerd.

    --
    The camels are coming. I'm in love.
  4. Re:JUnit advantage? by tdrury · · Score: 3, Informative

    JUnit is amazing. It's incredibly easy after you've written your first unit test. Here is a prime example of its use: I had about 50 classes spread out over a couple packages one of which is "core" to all the others. I had unit tests for all the code. I wanted to totally redesign how I implemented one of the core classes which is inherited by a number of other classes. I think people that don't have unit tests would shy away from such a large change. I simply backed up the old source file, put in the new file, and ran my ant script which builds, deploys (on appserver) and runs junit. After about 20 minutes of cranking through the unit tests, it finished with no failures. At that point I was 100% confident that my change worked and I wouldn't be surprised by a suble bug later. That is what junit is good for - peace of mind and confidence. You'll allow yourself to make changes to code (for the better) that you may otherwise have though too complex to attempt.

    As for your first unit test, it isn't that hard. Use a standard naming schema like "FooTest.java" or "FooJUnit.java" for your test cases - this way ant can filter on those name and run junit against them while keeping your unit tests out of your distribution jars. Extend TestCase and overload setUp() and tearDown() - often you won't need those. Name your methods testXYZ() and junit will run them. Inside your test methods call Assert.xxx() on the things you want to test. You can test for null, compare to known values, etc. You can test to make sure exceptions should be thrown or not. Sprinkle in a little log4j and you can get more detailed progress of the tests.

    -tim

  5. Re:java in pratice by Phoukka · · Score: 4, Informative

    Been under a rock for a while, haven't you? ;)

    Okay, all ribbing aside, as someone who programs Java for money, let me give you the skinny: Java applets bite. More specifically, they are slow to download, prone to crashing, and subject to problems due to lack of control over the Java runtime available to the browser.

    Java has, instead, found its niche on the server. Server-side programming is where Java works really, really well. Development is generally faster than with C/C++, and Sun and others (go Apache! :) have provided some seriously amazing libraries/frameworks/etc. that help programmers avoid reinventing the wheel -- or the bucket seat, the 5-speed automatic transmission, or even the 10-disc CD changer.

    The other benefit that Java on the server provides is that web designers don't have to monkey with the code, and programmers don't have to deal (so much) with HTML.

    Needless to say, everything above is a generalization, all generalizations are false (including this one), and YMMV.

  6. Re:Catchphrase whoring by yog · · Score: 3, Informative

    Well, "extreme programming" is part hype and part common sense. The hype part is to educate management into the methods lots of people have been using for decades. Codifying it and giving it a sexy name helps legitimize these practices. Code reviews **are** useful sometimes as is pair programming, rigorous unit testing, etc., but this stuff has been happening all along with or without management approval.

    Now if you're sitting next to your buddy, watching and commenting as he or she steps through some code, and your manager asks you why you're not at your own desk doing real work, you can explain that you're "pair programming" or code reviewing or what have you. Whatever. It's just a name for something everyone already does from time to time.

    If you think the hype's a "load of crap" then I would tend to agree, but if it's the practice you object to, then you're obviously a rank beginner.

    --
    it's = "it is"; its = possessive. E.g., it's flapping its wings.
  7. Re:Why Ant? by Orville · · Score: 4, Informative
    Well, a couple of years ago I was on a project where I was assigned the informal (at the time) job of 'build engineer'. I started off with Make, and adopted and 'fell in love' with Ant (so to speak). Here's why:
    • On the project, we had a large number of objects (near 500, if I recall correctly), including GUI, EJB, and 'normal' object classes. Just maintaining manifest files was beginning to be a problem.
    • Unfortunately, we had cross-platform issues. The 'main' builds were being done on a Solaris machine, but most development was being done on Windows machines. (JBuilder at the time was a Windows-only toy.) Installing versions of 'make' (even cygwin/gnumake) was not going to be practical. Any other version cost $$$.
    • I soon found out the true strength of ANT: it is extremely flexible and extensible to make 'hard' tasks very simple. Automated deployment to servers, unit testing, and release management can be done without knowing sometimes cryptic Makefile commands.)
    • Ant is initially geared towards Java, but can be used to compile anything that has a command line compiler. (I saw a talk given by Martin Fowler where he joked about annoying a Microsoft engineer by creating an Ant process that would automate builds and tests of Visual C++ files!)

    Ant isn't really 'reinventing' the wheel, but making the wheel easier to manage (one file) and extend (ant tasks). It's a neat tool to have in the arsenal; I personally have found it easier and more intuative than Make for more 'complicated' projects. (Now, if I could just create an Ant script to automate and test builds of Oracle Pro*C programs...)