359 Lotus blogs updated hourly. Who will post next? Home | Downloads | Events | Pods | Blogs | Search | myPL | About 
 
Latest 7 Posts
How to write a blog post
Tue, Sep 23rd 2014 541
A new path
Sat, Sep 20th 2014 999
On Kate Bush
Sat, Aug 30th 2014 251
On blogs
Thu, Aug 28th 2014 248
Nation Apparently Believed in Science at Some Point
Tue, Jul 22nd 2014 415
CSC “mini” event
Mon, Jun 2nd 2014 148
Atom
Tue, May 6th 2014 165
Top 10
A new path
Sat, Sep 20th 2014 999
How to write a blog post
Tue, Sep 23rd 2014 541
Nation Apparently Believed in Science at Some Point
Tue, Jul 22nd 2014 415
On Kate Bush
Sat, Aug 30th 2014 251
On blogs
Thu, Aug 28th 2014 248
The JVM in 9.0.1
Mon, Nov 18th 2013 213
Oh you’ve got to come to this...
Thu, Feb 20th 2014 213
Off-line web apps: local Web SQL & Javascript
Wed, Jun 22nd 2011 201
ThoughtWorks release their technology radar
Wed, Jan 29th 2014 195
Your language is not dead
Tue, Feb 25th 2014 189


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
    61 hits



    Recent Blog Posts
    541


    How to write a blog post
    Tue, Sep 23rd 2014 1:56p   Ben Poole
    There’s a lot of writing out there which I really enjoy at the moment (reading more than ever nowadays). One site that I only started following relatively recently is Wil Wheaton’s. No idea what took me so long. I rather enjoyed this little snippet in his latest post: Stephen King says that writing is a form of time travel, and I’ll take that a step further: a bookstore or library is a portal to anywhere in the multiverse; it’s Sigil made real. Read more… [read] Keywords: wiki
    999


    A new path
    Sat, Sep 20th 2014 10:31a   Ben Poole
    My, it has been a busy few months (as you can tell from how dark this site has been). In addition to normal client assignments, we at LDC Towers have been beavering away with a new product, which we call LDC Via. You should definitely check it out. At this stage the app is in active development, and we’re looking to sign up willing beta testers. The tool can be run on premises or in the cloud—you can see a pared-down version of the cloud offering running as part of our demo app̵ [read] Keywords: domino application development interface
    251


    On Kate Bush
    Sat, Aug 30th 2014 5:01a   Ben Poole
    I do not have the body of work in my past that she has—but to see a mature woman create something so idiosyncratic, risk it all in the public view and then triumph on her own terms is a joy. Read more… Hear, hear. Off to see Kate Bush in less than two weeks, and cannot wait! [read] Keywords:
    248


    On blogs
    Thu, Aug 28th 2014 2:41a   Ben Poole
    My blog’s older than Twitter and Facebook, and it will outlive them. It has seen Flickr explode and then fade. It’s seen Google Wave and Google Reader come and go, and it’ll still be here as Google Plus fades. When Medium and Tumblr are gone, my blog will be here. Google Plus is still a thing? ;-) Read more… [read] Keywords: facebook google twitter
    415


    Nation Apparently Believed in Science at Some Point
    Tue, Jul 22nd 2014 12:43a   Ben Poole
    Historians studying archival photographs from four decades ago have come to the conclusion that the U.S. must have believed in science at some point. Read more… (beautiful typography too). [read] Keywords:
    148


    CSC “mini” event
    Mon, Jun 2nd 2014 2:54p   Ben Poole
    As you may have seen, we at LDC Towers, together with esteemed colleagues at The Turtle Partnership are looking to run a second Collaboration Stack Community event, this time a “mini” session, taking an evening slot on the 16th July. As before, there will be two tracks or themes to the event, and your participation is encouraged, nay mandatory! The details: CSCEvent Evening event this July. Do take a look at the post, and register if you are interested. As ever, it’s free! [read] Keywords: collaboration community




    165


    Atom
    Tue, May 6th 2014 2:14p   Ben Poole
    I am writing this post in Github’s new “hackable” programming editor, Atom. It’s pretty nifty, and I’ve been using it for a few weeks now. For general mark-up and the like it has supplanted the old main-stay, Coda 2, which has been having some issues for a little while now (frankly, it tries to be too many things). Whether I shall ditch Sublime Text as well (which Atom is very similar to, in terms of looks and core functionality), remains to be seen. Time will tell [read] Keywords:
    167


    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
    187


    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
    189


    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




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