354 Lotus blogs updated hourly. Who will post next? Home | Downloads | Events | Pods | Blogs | Search | myPL | About 
 
Latest 7 Posts
Agile, agility?
Mon, Mar 24th 2014 157
Phew!
Sun, Mar 23rd 2014 190
Your language is not dead
Tue, Feb 25th 2014 257
Oh you’ve got to come to this...
Thu, Feb 20th 2014 260
ThoughtWorks release their technology radar
Wed, Jan 29th 2014 204
The Macintosh is 30
Tue, Jan 28th 2014 173
</2013><2014>
Tue, Dec 31st 2013 139
Top 10
Oh you’ve got to come to this...
Thu, Feb 20th 2014 260
Your language is not dead
Tue, Feb 25th 2014 257
ThoughtWorks release their technology radar
Wed, Jan 29th 2014 204
Phew!
Sun, Mar 23rd 2014 190
The Macintosh is 30
Tue, Jan 28th 2014 173
Off-line web apps: local Web SQL & Javascript
Wed, Jun 22nd 2011 171
The JVM in 9.0.1
Mon, Nov 18th 2013 160
Agile, agility?
Mon, Mar 24th 2014 157
</2013><2014>
Tue, Dec 31st 2013 139
Netgear ReadyNAS & OS X: fixing printing
Mon, Sep 12th 2011 126


Making code test-able
Ben Poole    

There are two things a developer needs to make his or her output testable (and therefore more robust. Hopefully):

  1. The “How would I test for xyz” mind-set, and;
  2. A fast simple development environment

That’s it, that’s all you need. The first comes with practise, and the second is pretty straightforward nowadays. Of late I have been writing a lot of PHP in Eclipse, Coda and the new kid on the block, Sublime Text 2 (check it out: very nice). All of these tools make it easy to write test-able code, because one simply pulls in the unit testing framework of choice, and then one writes code: job done, very low barrier to entry.

As a small aside, I am constantly amazed at how much PHP stuff goes out the door with minimal-to-no tests, especially when one considers the fluid nature of the language (its typing and such). This contrasts sharply with the mind-set we see amongst Rubyists, who regard their language’s dynamism as raison d’être for excellent test coverage.

So a diligent approach to testing is one thing, but contrast my comments about editors above with other recent experiences writing Java in an Eclipse-based editor called Domino Designer (some of you may be familiar with it). Making that code test-able has been more problematic, given DDE’s reluctance to play nice with plug-ins like JUnit, and the way a typical Java agent is structured. So, a couple of tips:

  1. Abstraction is key: write as much of your Java code as you can abstracted away from the Domino object model. This way you can code in a proper Eclipse instance, and you can write easy test cases. Break up big problems into small solvable components, and test them. Your Java agents should be very “light”—minimal code perhaps just looping a collection or whatever. Let your custom, tested classes do the heavy lifting.
  2. If you’re like me, and not at Lotusphere, you will be missing out on a session from Messrs. Myers and Robichaux covering effective Java in the Domino environment. As soon as their presentation is made available, I have it on good authority that you will want it, and that the Wookiee has some tricks up his sleeve when it comes to JUnit :-).
  3. (Finals words of “wisdom”: it is a lot quicker, and simpler, to write test-able code up-front. Adding tests after the fact is always more burdensome).



    ---------------------
    http://benpoole.com/weblog/201201170736
    Jan 16, 2012
    36 hits



    Recent Blog Posts
    157


    Agile, agility?
    Mon, Mar 24th 2014 12:34p   Ben Poole
    One of the architects of the agile manifesto, Dave Turner, has written an eloquent piece on how the term “agile” has been horribly misappropriated: The word “agile” has been subverted to the point where it is effectively meaningless, and what passes for an agile community seems to be largely an arena for consultants and vendors to hawk services and products. Sadly, this mirrors my experience, and probably that of many other IT practitioners out there. The term has been [read] Keywords: collaboration community
    190


    Phew!
    Sun, Mar 23rd 2014 2:50p   Ben Poole
    Well that was a fair few weeks of effort on all fronts. As some of you will know, we recently co-hosted the inaugural Collaborative Stack Community event and good fun it was too. The venue was fab (the Soho Hotel, picked out by good chum and colleague Abigail Roberts at Ravendesk), the attendees were in good voice, our speakers were great, and as ever Gab and Mike organised things wonderfully. Me? I just turned up and looked pretty. Many thanks to everyone who took part, and keep your eye on t [read] Keywords: community twitter
    257


    Your language is not dead
    Tue, Feb 25th 2014 3:34a   Ben Poole
    This: Meanwhile, I suspect 80% of programmers are still working on problems where their development velocity is a much bigger problem than how many hits their server can take before falling over. I dunno, maybe my view of the industry is skewed. I just don’t think there are really that many developers, statistically speaking, who can cite system capacity as their current problem #1. Or #2, or #3. Excellent exposition of those interminable “language blah is dead” memes that just w [read] Keywords: lotusscript development server
    260


    Oh you’ve got to come to this...
    Thu, Feb 20th 2014 2:08p   Ben Poole
    If you read the sites of my good friends and colleagues the Turtle Partnership, Matt White and the Wookiee (and why, pray, would you not?), you will be aware of a new, free event taking place in a month. On Friday, March 21st we are holding an informal techie(ish) get-together for those interested in collaborative technologies. This will take place in Soho, London, and will not be a sales-fest in any way—nor will it be vendor / platform-specific: come one, come all! CSC Event will most d [read] Keywords:
    204


    ThoughtWorks release their technology radar
    Wed, Jan 29th 2014 1:43a   Ben Poole
    The ThoughtWorks technology Radar is out, and it makes for interesting reading. Some of the “Adopt” languages and frameworks are new to me, and one in particular warrants further investigation: Dropwizard is an opinionated combination of several lightweight Java tools and frameworks, many of which would merit mention in their own right. The package embodies many of our favorite techniques, including an embedded HTTP server, support for RESTful endpoints, built-in operational metrics and hea [read] Keywords: java server
    173


    The Macintosh is 30
    Tue, Jan 28th 2014 1:45a   Ben Poole
    The Mac turned thirty this weekend, but you could be forgiven for missing that. Very little in the way of hoo-hah. Here are a couple of the more worthwhile links out there: Stephen Fry has turned in a wonderful piece of writing about the Macintosh, and his experience buying just the second one available in Europe, back in 1984: From the very first the Apple Macintosh team included archeologists, classicists, and, famously, Steve’s passion for the print art of fonts was built into the very fi [read] Keywords: apple development mac macintosh




    139


    </2013><2014>
    Tue, Dec 31st 2013 4:47a   Ben Poole
    Where does it go? Where does it go?? So, time to bid farewell to another year. And another year of blog neglect. Tsk. No promises from me. Lots to write about, not enough hours. I’m hoping for a little more time in 2014 as I ease back on the work a little, but who can say what will happen? I started 2013 with a lovely jaunt to Connect / Lotusphere, my first since 2010. That was tremendous fun, and I have posts about that on the site already. I can’t post about Lotusphere-that-was without [read] Keywords: domino lotusphere bug java
    160


    The JVM in 9.0.1
    Mon, Nov 18th 2013 2:32a   Ben Poole
    With the release of version 9.0.1, IBM have updated the Domino JVM to release 6 SR14. This is important, because SR14 brings some new security requirements with it. You can read the detail in the relevant technote, Security Bulletin: IBM Notes & Domino fixes for multiple vulnerabilities in IBM JRE. When I tried to run some code that uses FOP to render a PDF, I felt the impact of this change. Given that XML processing is a pretty common requirement in Domino Java agents the world over, you ma [read] Keywords: agent domino ibm notes java oracle properties security xml xslt
    121


    Singletons and Java
    Mon, Nov 11th 2013 3:23a   Ben Poole
    As a pattern, it’s probably fair to say that the singleton has fallen out of favour somewhat. It is no longer the thing in these days of dependency resolution or injection, and like anything that is easy to understand, it has been thoroughly abused over the years. However, I still think it has its place, and the only thing that’s stopped me using it in my code is (a) perceived disdain from other developers and, (b) the amount of boiler-plate guff required in a language like Java to implemen [read] Keywords: google java wiki
    104


    Thank you Bruce
    Wed, Oct 2nd 2013 8:20a   Ben Poole
    This will embarrass him mightily and / or swell his head to epic proportions. Either way, I’m doing it. As many will know, Bruce is finally taking his leave of all things OpenNTF, and it would be deeply remiss of us not to mark his parting. Should I tell a story? List his many accomplishments to date? Generally simper? No. I’m British. Instead, allow me to express how very fond I am of Bruce. He is many things: husband, father, businessman, advocate, developer(!), leader, employer, [read] Keywords: openntf




Created and Maintained by Yancy Lent - About - Blog Submission - Suggestions - Change Log - Blog Widget - Advertising - Mobile Edition