In my last post, I started porting the RPN calculator example from Java to Clojure, moving a functional program into a functional language. In this post, I finish the work and show how the Clojure calculator models both state and calculator commands.
If you’ve never played it before, a hand of manual testing misery poker plays out something like this:
We automate functional testing for a reason: the alternative is tedious, resource-intensive, and expensive. So why do test suites still comprise so many manual tests? Continue Reading…
So far in this series, I’ve taken a basic calculator written in Java and transformed it from a command-oriented procedural design into a more functional style. In some ways, this has made for simpler code:
Despite this difficulty, there is value in the functional design approach; What we need is a new notation. To show what I mean, this article switches gears and ports the latest version of the calculator from Java to Clojure. This reduces the size of the code from 327 lines down to a more reasonable-for-the-functionality 82. More importantly, the new notation opens up new opportunities for better expressiveness and further optimization. Building on the Clojure port, I’ll ultimately build out a version of the calculator that uses eval for legitimate purposes, and compiles calculator macros and can run them almost as fast as code written directly in Java.
In my last post I wrote that the reality of automated functional testing has so far failed to live up to my expectations. In this post I’ll define what I mean by functional testing. What follows might not be the definition you’re familiar with, and I don’t mean to suggest that this is the only valid definition. It is certainly influenced by the industries I work with, where:
From my first encounter with HTMLUnit over ten years ago, I had high hopes for automated functional testing for web applications. Comprehensive test suites would run continuously and unattended, and notify us promptly of incipient problems. We would dazzle our customers and quality auditors with slick, comprehensive, and electronically signed hypertext reports. We would dispense with hundreds of person-hours of manual testing, and pass the cost savings on to our customers. We would retire waist-high piles of paper test scripts and reports to long term storage and, after the obligatory retention period, dance around the bonfire where they burned. Continue Reading…
One nice aspect of the Freemarker template engine is the way that it intelligently displays typed model data. Dates, for example, are presented in a human-readable format which can be controlled in the view using Freemarker builtins. This works well, and is good for helping view concerns stay in the view code. However, one difficulty with this feature is that Freemarker doesn’t understand all domain types out of the box. joda-time DateTime objects are a good example, and this article shows how to teach Freemarker how to render that type of value.
Sometimes, it’s easy to focus so much on the architecture of a system that the details of its implementation get lost. While it’s true that inattention to architectural concerns can cause a system to fail, it’s also true that poor attention to the details can undermine even the best overall system design. This post covers a few minor details of code structure that I’ve found to be useful in my work:
In this post I will explain how to use Sonatype Nexus Repository Manager as your Sencha Package repository.
If you use Sencha Touch or ExtJS for development, Sencha has provided a tool called Sencha Cmd which “is a cross-platform command line tool that provides many automated tasks around the full life-cycle of your applications from generating a new project to deploying an application to production.” One of the new features is the ability to have “packages”. If you come from the Java world like I do a package is the equivalent to a JAR library file. A re-usable block of code that can be versioned and stored for others to use. Sencha Package Manager is designed to solve two basic problems: consumption and distribution.
I’ll get back to rpncalc shortly, but before I do, I wanted to take a post to talk about a surprising problem I recently had with lazy sequences. As part of my day job, I am developing a Clojure based system for accumulating and displaying time series data on a web page. One of the core algorithms in my
While trying to teach myself Sencha ExtJS MVC framework, I decided to use Java as the server side language for the REST services that would support the application. I also thought it would be a good time to exercise what I have learned from working with other web frameworks and try and apply those same principles. Much to my surprise, when looking around for articles on ‘Securing ExtJS’ I could not find exactly what I was looking for.