An introduction to Agile Testing with Bonfire

Last July Atlassian released one of it's new products, Bonfire! Bonfire can capture issues in the browser, take screenshots and annotate, track testing activity, making Bonfire an awesome rapid testing tool for everyone on your team and organization.

Commercieel gebruik van Open Source bibliotheken, deel vier

Als een Open Source Bibliotheek gebruikt wordt in een commercieel product moet er goed worden opgelet dat de licentie van die bibliotheek commercieel gebruik niet onmogelijk maakt door te eisen dat de source code van het product wordt vrijgegeven. In deze blogposting bespreek ik een aantal veel voorkomende licenties en de consequenties voor commercieel gebruik.


What’s new in Spring Web Services 2.0

Spring Web Services is a framework for building Web Service Endpoints and Clients in a easy way. This post describes the new features and a quick walkthrough for constructing a Web Service using Spring Web Services.

Type safe property paths using QueryDSL

Property paths are often described as string, which is not type-safe and very error prone. In this blog post I will demonstrate how to replace these string based expressions with type-safe property paths, allowing faulty property paths to be detected at compile time.

Change in jQuery

The ability to change things is very important in programming, Scrum even says one should embrace change. This gets harder when you’re talking about changing something within a framework or even a language, mostly because the number of people that will need to change will be larger. There are different strategies possible, so how does jQuery (a framework with a huge user base) handle change?

Automated database migration with Izpack and Liquibase

In a previous blog article, Willem Dekker explained how to use izpack to build an application installer. In my current project I thought it would be nice to use such an installer and let it execute the liquibase migration scripts automatically during installation. In this article I will show a way to achieve this goal.

The Dependency Inversion Principle


Controlling complexity is the essence of computer programming.



— Brian Kernigan in [Kernighan-Plauger]



JARB in practice

In a project we recently started, we introduced a 100% test-driven code coverage philosophy, including Selenium 2 tests for automated acceptance tests. As usual and expected, the development, refactorings and changes of insights in this project are handled neatly, because of the control the team has over the codebase. Robert Martin is not mistaken in his Clean Coder when he presses for 100% code coverage. This really is the way to go.

Awesome tables with CSS3

In one of the topics we talked about during our HTML and CSS workshops are CSS3 selectors and how powerful those can be. In this post I will demonstrate what you can do with an ordinary table to make it look amazing, just by adding some CSS and one very small image.

Advanced unit testing (with) your Spring configuration


If you drop XML and configure your Spring web application in Java, you’ll still want to test your application. In fact, you can now also test your configuration.
A previous blog post describes how.


REST webservices do not need integration tests


For REST webservices, integration tests have become superfluous. Not that testing them is not important (it is), but because we can fully test them using component tests.
This post continues our series to replace our Spring XML configuration with code and to fully test it and the code that uses it. As a finale, I’ll demonstrate how to test REST webservices during the unit/component test phase, thus reducing the amount of time spent testing.


Easy Installer with IzPack

Normally, when an application is completed, it is customary to give a war or zip to the deployment manager with the accompanying instructions.

Spring Data JPA with QueryDSL: Repositories made easy

Spring Data JPA removes much boilerplate from repository code and QueryDSL can be used to create clean and reusable query specifications. When combined, we can create powerful repositories with very little code.

Easy Command Line Interface coding with JCommander

Implementing a command line arguments parser can turn quickly from ‘yes it’s just one parameter’ to a heap of for loops with curious string manipulations and conditionals in-between. Try and test that. I guess we’ve all been there. Using apache-commons-cli makes life easier and has been the defacto standard for most projects that require a command line interface (cli) as it makes writing cli’s reasonably easy. However, when I discovered JCommander by Cédric Beust my way of making cli’s changed for the better!. Let me share it with you:

CSS3, lightning talks and foosball on KTM

Last Wednesday, June 22th, 42 had its quarterly KTM (acronym for Knowledge Transfer Meeting), a day packed with technology, business updates and food with drinks (or maybe the other way around).

Atlassian Summit 2011 Wrap Up

We have finally recovered from the jetlag, impressions and hangovers related to the Atlassian Summit 2011, so it is time to wrap up on all the good things we have seen and heard in San Francisco.



42 sponsors GOTO Amsterdam conference

42 Has signed up as a gold sponsor for the GOTO conference. We are very glad that a conference with this reputation has decided to expand to Amsterdam and we support its objectives to offer high-quality content and inspire the community.

Java Repository Bridge library in practice

For the past couple of weeks we’ve been blogging about the Java Repository Bridge (JaRB) project. For those who are not yet familiar with JaRB, I recomment reading our introduction post first. In previous blog posts we described the various components of JaRB in isolation. During this blog post we are going to use all previously mentioned components to create an actual Java EE application and show what kind of advantages JaRB offers.

Drop XML: configure your Spring web application in Java

Since Spring 3.0, configuration of your application context is possible in Java (using the @Configuration annotation). But it is only now maturing to a point where you can fully configure your web application, with the coming release of Spring 3.1 (milestone 2 was released just a few days ago). This blog post describes how.


Using database constraints in Java

It is very common to define constraints on databases to ensure that only “valid” data is stored. Yet we do very little with these (powerful) database constraints in our Java applications. Often we duplicate the constraints in our application, for example by using JSR-303 constraint annotations.

The idea behind JARB - JAva Repository Bridge

The object-relational mapping philosophy has to deal with the problem of setting two different paradigms up for a workable relationship. Not the easiest of tasks. Hibernate has done a good job at this, being the de facto implementation for the Java Persistence Architecture (JPA). Still, there are some itches to be scratched, especially from a Test Driven Development point of view.

Introducing a security layer in your application architecture

Though of course it varies, in most applications you will encounter at least a view layer, a service layer and a data layer. Security will typically be applied on both the business layer as well as the view layer.

Mock frameworks

Mocking frameworks are quite popular in java, and have matured a bit in recent years. Now is a good time to take a look at the top frameworks, and decide which one is best in certain circumstances, and to see why older or home-brewed variants aren’t as solid as these frameworks. Since I think I built up a slightly alternative view on the subject, I felt obliged to share it with the world. So I’ll try to give you my perspective on what I will (try to) use.

Leveraging the Spring MVC 3.1 HandlerMethodArgumentResolver interface


A familiar problem when implementing a REST server, is that your framework limits what you can do. Sometimes, this problem can be mitigated (not solved) by reformulating (i.e. changing) your business needs. For example, you can reformulate save multiple changes to an invoice and its invoice lines with one click on a save button to save each of multiple changes to an invoice and its invoice lines as separate UI actions. Unfortunately, this change increases your audit trail and thus technology trumps business needs.


Testing RESTful applications

Developing a RESTful application basically comes down to developing one server- and one or more client applications. A recurring phase in application development is testing. When developing automated tests involving client-server communication the need for “mocking” will soon rise as the client and server applications must each be tested in their own development cycle.

Bridging the divide between Java and the database with Liquibase

The refactoring movement has largely passed unnoticed in a critical part of the Java domain; the database. Whereas the last couple of years have brought great improvements in Java refactoring, databases still subscribe to the same top-down design model. Worse, the denizens of the two worlds hardly cooperate.

Automate Liquibase migrations

Liquibase migrations can be automated using a DataSource wrapper, provided in JaRB.

HTML and CSS workshop for JAVA developers

When it comes to writing Java applications, 42 maintains a high standard of quality. Strict coding standards, (aiming for) 99% test coverage and constant code reviews has brought our Java development to a completely new level. Having reached our goals for the Java side of things, it was time for us to focus on the front-end aspect of software development.

Using Speakeasy for integration

Speakeasy is a new extension mechanism for Atlassian Products, like JIRA and Confluence, which could be compared with a combination of Gmail Labs and Greasemonkey. Speakeasy allows you to write easy and lightweight extension using HTML, JavaScript and CSS. Speakeasy is an addition to the normal plugin system, the normal plugin system can and should still be used for heavy modifications and full applications on top of the products. Although Speakeasy isn't released publicly yet, a developer preview is available.

Spring Security: accessing Spring beans from your security annotations

This post describes how you can integrate advanced security in your applications using Spring Expression Language and Spring Security.

Combining JPA and Excel to generate testdata for the database

The situation may be all to familiar: you have one or a number of SQL scripts to generate testdata for your database. However, the scripts have a tendency to grow stale quickly whenever the database and model change. Furthermore, the testdata has not been validated by the model and could conceivably be "impossible", such as a status that cannot exist or a value that is stored in the wrong format. The scripts are dragged along during the life of the application and often locally replaced by other solutions, such as in-code Java testdata.

Heeft Java nog toekomst, of gaan andere talen de rol van Java overnemen?

Dit is een interessant verhaal van Steve Vinoski over functionele talen en de manier waarop Java langzaam achter de horizon gaat verdwijnen.

Vooral deze passage:


"Imperative languages such as Java and C++ have come to be known as "high ceremony" languages because of the often mind-numbing amount of syntactic boilerplate and complex object interaction patterns they impose just to get relatively simple applications up and running. Many developers turn to interactive development environments (IDEs) to help them manage this verbosity and complexity, but, in my opinion, this just works around the real problem rather than solves it."


en:


"Using the wrong languages like this can impose a much larger tax on development efficiency than you might realize. Like the proverbial frog in the pot of water on the stove, eventually boiling to its demise as the water temperature slowly increases because it can sense the changes until it's too late, developers who primarily use popular imperative languages like Java and C++ can become so accustomed to the boilerplate, verbosity, and ceremony these languages require that they simply don't realize just how inefficient their development efforts really are. Given how defensive such languages' users can often be, perhaps this form of programming language loyalty is a less sinister variant of Stockholm syndrome, where captives counterintuitively develop a sense of devotion and emotional attachment to their captors."


Prachtig! En ook herkenbaar.


Het is een proces wat zich in alle technologische gebieden voltrekt, maar in de software engineering met een hoge frequentie, omdat gebied zo snel verandert. Software engineers werken met een bepaalde techniek (omgeving, programmeertaal, tool, etc), specialiseren zich daarin, en investeren zichzelf erin. Als er dan iets nieuws of anders langskomt, is de neiging groot om dat als flauwekul, onzinnige nieuwlichterij of zo af te doen. Logisch, begrijpelijk, en meestal nog terecht ook. Want heel vaak zijn die nieuwigheden helemaal niet zo goed, zitten er verborgen nadelen en, en hoe dan ook leveren ze niet de extra productiviteit die het zinnig maakt om van de bekende technologie af te stappen.


Maar van tijd tot tijd moet dat toch gebeuren. Het is duidelijk dat het Web als platform zoveel nieuws heeft gebracht dat een deel van de gangbare tools en talen wel eens aan vervanging toe zou kunnen zijn.


Overigens roept Vinoski's verhaal wel vragen op. Bijvoorbeeld:
Zijn die FPs echt beter? Hoe belangrijk is de relatie met REST in dit verband? Hoe verhoudt OO zich tot dit verhaal?


En is Java echt aan het einde? Zo ja, komt er dan weer een "nieuw Cobol", een taal die min of meer algemeen wordt gebruikt zoals Java nu? En welke zou dat dan zijn?


Een goede reden om eens te kijken naar de mogelijkheden van talen zoals het door Vinoski genoemde Ruby, of Python, of Scala, maar misschien ook wel naar bv het nieuwe Go. Of hebben we zo''n taal niet meer nodig?


Maar dat een andere keer.


(dit verhaal is elders in andere vorm eerder gepubliceerd).

Unit testing Spring beans with mocked dependencies

When overriding dependencies of Spring beans with mock objects, all tests except the first will fail. This blog post explains why and provides a simple solution.


When Random isn't as Random as expected

I like to write computer games and games tend to be more fun with some random chance throw in. However I also like to write unit tests and unit tests and random behavior don’t mix very well. Fortunately is the java.util.Random class a pseudo random generator and as long as you put in the same initial value (the so called seed) you get the same sequence of ‘random’ numbers.


Confluence 3.5 Released: Embed Multimedia and Code

Confluence 3.5 delivers HTML5 supported Drag and Drop, a new Multimedia Macro and a vastly improved Code Macro letting you create richer content, faster, to share with others.

Javascript eval problematiek

"Eval is evil" is een van de belangrijke uitspraken van Douglas Crockford, en toch kom je het eval-statement nog wel eens tegen. De laatste tijd ben ik het 2 keer tegengekomen, en bij beide keren leerde ik een nieuwe reden om eval evil te noemen. Dus hierbij deel ik die ervaringen.

Matching made easy - Hamcrest

Hamcrest is a framework that enables the usage of “matchers”. Matchers, also known as specifications, are used to describe (business) requirements, on which objects can be checked.

Sneller Wicket Applicaties maken met de Qwickie Eclipse Plugin

Standaard heeft Eclipse geen ingebouwde ondersteuning voor het Wicket framework. Gelukkig is er nu de Qwickie plugin die het leven vereenvoudigd. Voor veel van de projecten die we binnen 42 doen gebruiken we het Wicket framework voor de web gebruikersinterface omdat je daarmee makkelijk componenten kunt hergebruiken. 


Persistence API’s - JDO vs. JPA

JDO kent een aantal voordelen ten opzichte van JPA, die op geen enkele manier zijn te bereiken met JPA. Deze features van JDO zijn echter niet nodig een webapplicatie; je kunt altijd zonder (zonder verlies van gemak/functionaliteit). Sterker nog: zonder het gebruik van deze exclusief-voor-JDO-features zijn de uiteindelijke kosten van software lager.


JPA Metamodel Generatie

In navolging van onder anderen Hibernate en Toplink is de Java Persistence API in versie 2.0 gekomen met een eigen criteria api. Dit artikel gaat in op de ondersteuning van typesafe queries door het gebruik van het metamodel. Ook wordt uitgelegd hoe de automatische generatie van dit metamodel te configureren met behulp van maven en hoe deze configuratie samenwerkt met een IDE als Eclipse.

Een wiki in je bedrijf!

Voordat ik van wal steek over wat een wiki kan bijdragen aan een bedrijf en hoe je met de introductie hiervan moet omgaan doe ik er waarschijnlijk verstandig aan om wat uitleg te geven over een wiki en met welk doel deze over het algemeen ingezet worden (of zouden moeten worden).

Veiligheid van web applicaties

Gevaren voor web applicaties hebben een lange geschiedenis. Veel vermeende gevaren zijn academische exercities, anderen vormen onderdeel van een uitgebreide FUD campagne (angst verkoopt) en weer anderen hebben hun grond in daadwerkelijke ervaring.