RSS RSS feed | Atom Atom feed

Canned Wicket Test Examples

Can of worms, can it be?

Unit testing of the GUI is not the same as unit testing through the GUI. We are interested in the logic of the GUI rather than the placement and order of the GUI widgets on screen.

Testing the logic makes the tests less sensitive to changes in presentation but introduces the problem of JavaScript dependent features. AJAX is in the vogue so we wish to be able to do testing of that too without being forced to start a browser. There is some support for AJAX in Wicket that may be reached using the test framework that is part of Wicket. However, it is not straightforward to use and there are some pitfalls.

Here are three examples of avoiding those, one for each of the check box, drop down and radio group controls.


Read more...

Tags :

Some Gotchas for Java Developers Learning JavaFX

Experiences from a workshop

In an earlier post, I had attached slides from a presentation on JavaFX that contained some code examples. I discovered that at least one of them, the ball game, stopped working when I switched to JavaFX 1.3.

I would say it is a quite subtle difference.

What happened was that the onKeyPressed and onKeyReleased were not called. My immediate reaction was that it was due to some bug in JavaFX but yesterday I realized what had happened.

Read more...

Agile and Architecture

Slides from my presentation

Yesterday I held a presentation on the subject "Agile and Architecture" at EDB. They have an internal competence network which meet regularly and discuss agile processes and methods.

My point in this presentation was that every system has an architecture that determines the qualities of it. Given a set of functions, different architectures will give these functions different qualities, such as performance and cost of maintenance.

This is still true, no matter if you do waterfall, RUP or Scrum.

Read more...

Lean vs Traditional Project Management

IMHO

This week, we have Mary Poppendieck with us. She held an evening seminar which inspired me to think about the differences between Lean and traditional project management. I also am inspired by the questions I get from my spouse on this.

I thought that it would be interesting to do a side-by-side comparison between the two. I am no process expert, I am just a programmer who has been the subject of 30 years of different processes. I have seen DOD 2167, RUP, PROPS, PEJL, XP, Scrum and a few others. So this is just my humble opinion.

Aspect Traditional Project Lean Comment

Read more...

Jada jada JavaFX – Why I Love the Idea

New ways required

The other day I held a three-hour workshop, an introduction to JavaFX for some colleagues. The great thing about doing it, is that it forced me to answer the question: why is it necessary to create a new language just for GUI?

Read more...

The TDD Tetrahedron, version 1.0

Now for you to download

The TDD Tetrahedron has reached version 1.0.

As I write this, we have a course on advanced TDD with Robert C Martin as teacher.  I took the opportunity to introduce the first version to the participants.
 Uncle Bob and the TDD Tetrahedron
Uncle Bob and the TDD Tetrahedron.

Read more...

TDD Illustrated

Do you see what I mean?

I am planning an introductory course on TDD. In that process I have been thinking about how to convey the productivity gain with TDD.

Being a visual person, I had an idea that would illustrate this in a few pictures. Here they are for your scrutiny and enjoyment!

Read more...

Tags :

The TDD Tetrahedron

Best thing since sliced bread

Are you looking for some concrete expression for Test Driven Development? Let me give you a glimpse of what I am working currently on – the TDD Tetrahedron.

The idea originates from when a colleague at Crisp, David Barnholdt, wrote about not focusing on one step at the time. So I thought for a while and came up with this idea, a tetrahedron where each side displayed “failing test”, “implementation” and “refactor”, respectively.

tdd tetrahedron

You turn it and look at the first side where you read “failing test”. You write a failing test and turn it again, reading “implementation”. Write the implementation and run the test to get the green bar. Once again you turn the tetrahedron and read “refactor”. You look for something to refactor, confident that if you do, you will be supported by unit tests all the way.

Or the thing just sit on your table to tell everyone how cool you are as being a TDD programmer. At least wish to be. :-)

Anyways, here are some sneak preview pictures of the greatest thing that ever happened to the world of programming, ta da – the TDD Tetrahedron!

Read more...

Change Based Configuration Management

The simplest advanced branching strategy

Configuration Management (CM) is crucial to any software project as neglecting it will easily get you in big trouble. It may look like bad luck, but it is not.

A CM-plan will deal with several matters, from simple to decide things, such as naming of releases to more advanced subjects, such as branching strategy. I will talk about the latter today.

There are of course different ideas about what a good branching strategy should be. It is my firm belief that it must be aligned with the subject at hand, namely changes.

Read more...

Beyond Basic TDD

Where are you now?

This coming spring we will host a course with Robert C Martin on advanced TDD. I would really appreciate the input from my experienced TDD readers on what they consider to be the largest obstacles when it comes to TDD. This is your chance to shape the event so that it is customized to meet your needs.

A few months ago we hosted a very popular course with Michael Feathers. He talked about refactoring legacy systems and of course, unit tests which are an essential part of that. But the crowd cried out for more.

I have been practicing TDD for two years. I program in Java and frequently use Mockito and Wicket. The latter has support for unit testing web interfaces and it is great although it has its quirks.

But what is everyone else doing?

Read more...

Tags :

Not the Fixed Price Contract

Happy Together

The fixed price contract has been discussed here at the Crisp blog by others. It is broken by design as it creates more problem than it fixes.

On the way from JAOO I talked to Udi Dahan and that made it fall into place in a different fashion. Not that this is what he said, this is what he sparked.

The fixed price contract is not necessarily fixed price, a contract or evil.

Read more...

Design Principles for Error Handling

I Said Principles

Besides understanding the most important structures of a system, it is an architect's responsibility to understand and influence the design principles.

One common and important set of principles are those of error handling. It is good to have the same principles throughout the system as it produces fewer surprises and mistakes.

In this post, I will discuss some principles that including checked exceptions and Null Object, which you may not fancy. But it is always good to think this subject through, so please come along.

Read more...

The Last on Code Review

How fun are you to be with?

Code quality. It has been haunting me for so long I forgot when I started to think about it. Do other people think about it? For sure. Do everyone? Certainly not.

I was doing RUP and before that some waterfall process from DoD. Before that I was programming Fortran. Now, what has been my single most important recommendation for reaching code quality?

Peer code review.

But enough. It just struck me how much I do not miss code reviews.

I'll tell you why and I'll tell you what is the replacement, because there should be one.

Read more...

Tags :

Modal Windows Considered Harmful

Cornering the user is bad style

On the Wicket user's mailing list there was a question about modal windows and it set me off. Since my excellent wisdom ;) is larger than just modal windows and Wicket, I thought that it would be of interest to all of you, dear readers.

I have discovered that the modal windows that was gone when web applications started to spread, are starting to come back. And they are bad, even if they are not as bad as the goto statement that was accused the same way as I just did: harmful.

A modal window is something that pops up in the face of the user, screaming its importance by not letting the user touch anything else until the modal window had its way.

Read more...

Tags :

Stable Interfaces - any good?

Stability for your flexibility

I once worked in a rather large project, about 1000 persons. There are many stories about that project but the one that I'm thinking of now is that we loved to say "stable interface, we must have stable interfaces".

Now, stable means not changing which means nothing gets better. So why would anyone want stable interfaces? And what should we say about the opposite, "unstable"?

Stable interfaces is a cornerstone in tactics for modifiability, so how do stability and modifiability go hand in hand?

Do you see my finger?

Read more...

Requirements Specification is Waste

Time to Talk about Emperor's Clothes

Eclipse trashed some code for me today and I had to recreate the workspace. On such days, I can get a bit edgy and maybe I was, when commenting Richard Kronfält's blog on Scrum and traditional QA.

Sorry about that, Richard, but you are a viking so I guess I can get away with a glass of mjöd if I ever bump into you.

But my point is still, requirements specification is waste. It follows from that the issue tracking is as well. Well, not always.

Read more...

Mock the Clock

Take Time to Throttle Testability

Your unit test should have no dependencies on anything external, you know that already. So you try not to read any files or connect to a database server.  But what about time? Recently we had some unit tests that failed during nightly build due to daylight saving. Suddenly the distance between two days was 23 hours.

But it doesn't stop at unit tests. System tests, too, may depend on time.

You should have a strategy for how your system perceive time. Read on.

Read more...

Tags :

Understanding a System

What do you do to understand?

I teach a course on System Architecture. It is a three-day course attended by experienced developers who want to go further in some respect.

What strikes me most is that the majority has never read any architecture document. Since writing such documents is one of the main topics of the course, I have a long road for them as they haven't read any.

So, when you are faced with a system that you are about to change, how do you go about to understand it?

Read more...

A Lean Simulation in JavaFX

Nothing beats visual models

My collagues are talking a lot about Lean these days. I thought it would be interesting to simulate one of their examples using JavaFX.

Here is a picture:

Lean Machine Simulator

Read more...

Don't let Java ruin your JavaFX

The new kid on the block is not thread safe

Me and Oscar is currently working on a small project, just to learn JavaFX.

We stumbled on some nasty crashes which we at first did not understand.

ArrayIndexOutOfBoundsException? Is there a bug in JavaFX?

It turned out to be a callback from Java. Let us see how we got there.

picuture if the application

Read more...