Category Archives: Observation

How Jenkins CI parses and displays jUnit output

Now that I’ve had the opportunity to work on a continuous integration infrastructure for both Mirth Connect interfaces and a MarkLogic-powered REST API.  The Mirth interface testing software was built with Perl and TAP (Test Anything Protocol).  The ML REST API testing software was built on MarkLogic itself.  What they both had in common is that Jenkins was used to build the environments and run the tests.

I’ve really come to appreciate how useful Jenkins can be.  Jenkins can aggregate jUnit style reports out of the box, and Jenkins can give you meaningful textual and graphical representations of those reports.  It will tell you how many tests failed, how many tests passed, what class and packages were being tested, and it give you this information over the course of many builds.

However, since neither CI testing software was actually built on Java, I was unable to leverage the actual jUnit testing framework.  In addition, neither the Mirth Connect interfaces nor MarkLogic/Xquery have a concept of grouping code into packages and classes as a Java programmer may expect.  Because of these two issues, I had to generate jUnit output programmatically.  Even though I was able to start with someones stab at the jUnit XML schema, I found that Jenkins does not parse and display the jUnit output exactly as I would have expected.  For the time being, it is probably easier to ignore the jUnit schema and instead listen to what I’m about to say 🙂 Read more »

Big Data and how Isaac Asimov will have successfully predicted psychohistory

A couple of weeks ago, I had the opportunity to attend MarkLogic World 2012.  The overall theme of the conference was converting Big Data into Big Ideas.  Big Data is a paradigm shift for many in the IT industry; briefly, Big Data saves everything, whether it’s usefulness is obvious or not, in hopes that decisions can be made on that data.  In theory, the traditional data model would be unable to make informed decisions because the data set would not be large enough accurately describe super-complex issues.

Psychohistory, then, as defined by Isaac Asimov in his novel Foundation, goes something like this:

Branch of mathematics which deals with the reactions of human conglomerates to fixed social and economic stimuli; implicit in all these definitions is the assumption that the human conglomerate being dealt with is sufficiently large for valid statistical treatment.

Read more »

Introduction to memoization with Javascript

Memoization is a function optimization technique used to avoid remaking calculations in subsequent function calls.  The classic example, which we’ll demonstrate here, is the factorial function.  5! = 5 * 4 * 3 * 2 * 1… factorials are recursive in nature if we give it some thought.  5! = 5 * 4! and 4! = 4 * 3! and so on.  By recognizing this pattern, we can also recognize that if we calculate 5! and save the results, then we should not have to recalculate it when we do 7!.  Instead of calculating 7! by 7 * 6 * 5 * 4 * 3 * 2 * 1, we’ll calculate it by 7 * 6 * 5!.

We’ll first examine the naive approach and then the memoization method.  All in Javascript, and all with code samples…
Read more »

A visual comparison of the good and bad parts of Javascript

Javascript can be very expressive and powerful in the right hands.  It isn’t without it’s faults, though.  For an actual dissection of both the good parts and the bad parts of the language, I recommend Douglas Crockford’s book, Javascript: The Good Parts.  In the mean time, take a look at this picture.  The difference in page count between the Javascript reference and The Good Parts is pretty accurate 🙂