Continue reading: Readable Java system tests with good old JUnit

Readable Java system tests with good old JUnit

This article is the third in a series about system testing:

  1. Dockerized testing vs end-to-end testing
  2. How to setup Dockerized testing
  3. Readable Java system tests with good old JUnit

JUnit is poorly named. Given the name, people tend to think that it should only be used to write Java unit tests. And then people feel a bit hesitant about writing their integration tests with JUnit too. When they start with system tests, they often think they need another driver for their tests. Sure, maybe using another abstraction layer and a custom domain specific language (BDD), you can make the tests more readable for a non-programmer. That often comes at the cost of making the tests less readable for the programmers. And if we are honest, who’s going to read the tests the most? Perhaps just naming test classes and methods well and writing readable code can suffice?

Continue reading

Continue reading: Slides from JDays

Slides from JDays

I talked about some overlooked (and quite new) features of JUnit at JDays in Gotherburg. My presentation was a tour that started with boring example tests, and then proceeded through parameterized tests, theory tests, and generative testing. At the end of this tour, I spoke about fundamental, yet again overlooked, testing techniques such as finding

Continue reading
Continue reading: Mönster för flertrådade enhetstester

Mönster för flertrådade enhetstester

Detta är ett designmönster för hur man skriver ett enhetstest som utför samma test samtidigt i flera trådar.

Genom att utnyttja java.util.concurrent på ett smart sätt säkerställer man maximal samtidighet, vilken kan avslöja trådbuggar.

Kom ihåg: det går inte att bevisa att ett program är fritt från trådbuggar. Det handlar om att göra det sannolikt att det fungerar i en flertrådad miljö.

Nyfiken? Läs på…

Continue reading
Continue reading: Detta har hänt i sommar

Detta har hänt i sommar

För er som inte knarkar tekniknyheter lika okontrollerat som jag gör har jag nöjet att få summera de senaste 5-6 veckorna inom områdena Java, Ajax, Scrum och annat av intresse. Tro mig, jag har gallrat stenhårt. JUnit 4.4 släpptes nyligen. Nyheterna var inte speciellt upphetsande. En av mina favoritbloggare, Cederic Beust, har skrivit om dynamiska

Continue reading
Continue reading: Bra kort artikel om det nya i JUnit 4

Bra kort artikel om det nya i JUnit 4

JUnit 4 släpptes för ett tag sedan, efter att ha varit i praktiken abandonware några år. De tvingades röra på sig, efter att TestNG kom som ett direkt hot mot de-facto-standarden. Själv har jag inte haft tid att följa upp vilka ändringarna är i JUnit 4, tills jag hittade denna mycket informativa artikel. Det är

Continue reading