Technological Musings


Thoughts of a technology enthusiast

Beyond Functional Testing: Web Consistency Testing

Functional testing done correctly is very powerful, but it is limited. It verifies that the system is functioning correctly (a very important attribute), but it doesn’t do any verification of usability or appearance.

Enter Web Consistency Testing. The video on the main page gives a very good view into the approach.

Currently, most developer’s develop in their favourite browser until the site looks the expected way. Once that is complete, the site will be checked against another browser and any discrepancies corrected. Continue this process across supported browsers (or wait until someone else notices an issue).

Needless to say this process is very time consuming, prone to errors, and not as thorough as it could be.

Web Consistency Testing is about automating this process. Attempts have been made to do this using image comparison, but depending on site changes (think rotating ads, carousels, browser differences), image comparison can be very fragile. The BBC has written a framework for image comparison that works well for them https://github.com/BBC-News/wraith, but it does require a number of servers, and compares two environments, highlighting differences.

Some problems with this approach include false negatives and difficulty narrowing down the actual discrepancy.

Web Consistency Testing uses the DOM for comparisons. It will parse the DOM, determine locations of items, and use that for comparison. It will also use offsets so that if an item higher in the DOM is out of position, all items below will be offset accordingly so that they are less likely to produce an issue. This really assists in finding an actual discrepancy.

A specific implementation is available at Mogotest. Mogotest leverages a number of open source projects, as well as Cloud servers to evaluate across various browsers, including mobile. It attempts to mimic the developer workflow by using one browser’s rendering as the reference, and then reporting on discrepancies from one run to the next, as well as discrepancies across browsers.

Because it’s leveraging Cloud, it is also able to support many browser/OS combinations, including mobile.

One could duplicate Mogotest’s functionality as it’s primarily built using open source technologies, and readily available Cloud Services.

A very interesting approach to visual verification of a site, and one I will be investigating further.


Java: Optional.isPresent() is not the best usage of Optional

Using the Optional class from Guava or JDK8?

The TL;DR: If you’re using isPresent(), you’re not taking full advantage of Optional.

Optional allows one to explicitly state that a variable may not have a value rather than relying on comments/code convention and null values.

It provides a number of helpers for constructing Optional items. Optionals are basically a wrapper around an object, and can either be ‘absent’ or ‘present’.

Optional provides an ‘isPresent’ method, but if you’re using it, you aren’t taking full advantage of Optional. Using isPresent isn’t really any different than using {var} != null from a coding perspective.

The Guava Optional provides several methods for retrieving items. If you know it will always have a value (likely due to previous checks), you can use get().

If you’re not sure if it will have a value or not, and want the default returned to be null, use orNull(). There is also an or(defaultValue) that will return defaultValue if it isn’t defined and an or that will return a different Optional value.

The JDK8 version of this is more powerful, but this at least gets one started. Here’s a great post about the JDK8 Optional:

http://www.oracle.com/technetwork/articles/java/java8-optional-2175753.html


Let's Remember the Real Agile Manifesto

Inflexible Agility. This article is true too often. The focus in agile is not the process, and yet process is talked about more than people, interactions, working software, customer collaboration and responding to change.

Let’s remember those, and not focus on processes. Processes can help, but are secondary.

http://java.dzone.com/articles/inflexible-agility


Groovy for Android Development

Apple recently announced the new programming language for iOS called Swift. One of the languages mentioned by Apple as providing inspiration was Groovy.

Here’s a presentation showing how to use Groovy for Android development. Looks a lot nicer than using Java for it. Take a look and see what you think. I’ll be investigating this for any Android development I have to do.

http://melix.github.io/blog/2014/06/grooid.html


JUnit: With Java8, do we need Hamcrest anymore?

A very interesting examination of alternative methods for test assertions that leverage lambdas rather than the hamcrest matchers.

Very interesting, and something to keep in mind if you’re fortunate enough to be using Java 8.

http://java.dzone.com/articles/most-internal-dsls-are


Estimation: Story points or story counting?

A very interesting read about estimating and Story Points. Do they truly add value over just counting stories?

In the author’s experience, estimating and Story Points didn’t provide any additional information over counting stories.

There is value in the discussion around stories, and ensuring that stories aren’t too large, but discussing whether it’s a 1, 2, 3 or 5 doesn’t add huge value.

http://softwaredevelopmenttoday.blogspot.co.uk/2012/01/story-points-considered-harmful-or-why.html


Fallacies that impact our development

An excellent video by Venkat Subramaniam where he discusses how human biases, and the languages we use for development harm us.

Discussions of human nature and conformance, biases and commonly held beliefs that are fallacies.

One example. He asked how many people use Eclipse. He then asked who would pay $500 for Eclipse. Needless to say, most of the participants said no. People pay that much for IntelliJ. Tell you anything about what they think of the IDE? Don’t let free determine your solution, as what else are you potentially giving up?

Another example was effectively ‘no one got fired for buying IBM’. His phrasing was ‘it must be good as it is from a large corporation’. We all have had experiences that disprove that.

All developers are to blame for frameworks getting bloated. A framework exists that solves a problem really well, but hasn’t been updated recently. Instead of still using it, developer’s will seek the item that’s been updated in the last 20 days. So, a product reaches maturity. What’s a company to do to ensure it keeps getting purchased? Enhance it. All we have to do is look at the Office Suites and most other software like that.

Many other examples in here, and as always, some examples of what we put up with coding in Java that we shouldn’t tolerate.

video link: https://www.youtube.com/watch?v=lfmKvRaNnUs#t=398


Have we learned anything in the Software Development Industry in the last 30 years?

This book (https://www.goodreads.com/book/show/2383920.Software_Reliability) was tweeted about recently. It was written in 1976.

The review by Steve Losh is well worth reading. It was at the top the last time I looked.

The depressing/frustrating part is that a lot of the lessons/issues listed here are STILL relevant… We haven’t learned much in this industry in 30+ years. Too much chasing the latest/greatest, and ignoring the past as irrelevant and ancient history…

And for anyone that thought VM’s and Hypervisors are ‘new’, they were being used before this book was written. We’re just going in circles, but with everything looking better.

Are you doing your part to make things genuinely better?

Twitter reference: https://twitter.com/stevelosh/status/434543430987812866


The DHH Problem

An excellent lightning talk bringing a clear point of view around the controversy created by DHH lately regarding DHH.

Short, and worth the watch.

http://codon.com/the-dhh-problem


Evernote: Linking notes to each other

Just discovered that if you’re using the desktop client (at least the one on Mac, haven’t tested in Windows yet), you can create links to other notebooks. Select the note you want to link to. From the Note menu, select ‘Copy Note Link’.

Now goto the Note you want the link in. Paste the link and it should appear highlighted and underlined. Clicking this link will open the note. The pasted link also appears to work correctly in the Web App even though I haven’t found a way to create them using the Web.