Thomas Sundberg

April 2, 2013

Teaching – the difference between a lecture and a conversation

Filed under: Programming, Teaching — Thomas Sundberg @ 06:36

There is a big difference when teaching a large group and teaching a small group. I recently had the pleasure of teaching the same material in a few different scenarios. One of them with a large audience of about 70 participants. It took me approximately 2.5 hours to go through all slides and coding an example. Two other scenarios was with small groups with less than 10 participants. The exact same material took a little over a little over 3 hours to complete.

(more…)

September 28, 2012

Test drive an implementation using an Executable Specification – revisited

An example is perhaps the best way to describe something. Concrete examples are easier to understand than abstract descriptions.

I will show how Cucumber-JVM can be used to specify an example and how the example can be connected to the system under test, SUT. The example can then be executed using any IDE or using Maven.

(more…)

November 29, 2011

The simplest possible solution

Filed under: Agile, Clean Code, Java, Programming, Software Craftsmanship, TDD, Teaching — Tags: , — Thomas Sundberg @ 22:02

The simplest possible solution that could work. Ever heard that expression? What does it mean? Really?

The answer is obviously something that in a really simple way satisfies the test you currently are working on. Nothing more, nothing less.

(more…)

October 18, 2011

Testing a web application with Selenium 2

Selenium a great tool for testing web applications. The current version, Selenium 2, is a merge between Selenium and WebDriver. I will walk you through an example where we test a web site using Selenium in a few different ways. This is the same example as I demonstrated at Scandev on tour in Stockholm 18 October 2011.

(more…)

August 5, 2011

What is the difference between i++ and ++i?

Filed under: Clean Code, Java, Programming, Teaching — Tags: , , , — Thomas Sundberg @ 18:27

During a coaching session I got a question about a loop.

Would there be any difference in the output from a loop defined as

for (int i = 0; i < 3; i++) {
    System.out.print(i + " ");
}

and a loop defined as

for (int i = 0; i < 3; ++i) {
    System.out.print(i + " ");
}

in Java?

(more…)

July 28, 2011

Magic numbers

The other day a colleague asked me, what is a magic number? He had noticed that one of the things our Sonar was complaining about was Magic numbers. I got a great teaching moment and told him my view of Magic numbers.

Magic numbers are any numbers in the source code that just appears without any explanation.

(more…)

May 22, 2011

A Generics example

Filed under: Java, Teaching — Tags: , , , , , , , — Thomas Sundberg @ 22:15

Generics has been a a part of Java since Java 5. It will allow you to write code that handles types without deciding which type upfront. This is of course very useful for collections. It used to be done using the inheritance system and casting Object to the type you knew should be used.

(more…)

February 11, 2011

Maven and Antrun

Filed under: Maven, Teaching — Tags: , , — Thomas Sundberg @ 22:32

A friend of mine needed an example of how to use the Antrun Maven plugin.

This is a simple example that will show how to execute any Ant targets from a Maven build during the install phase.

(more…)

December 21, 2010

Automatically integration test an ejb with Maven

We want to perform an integration test of a system using Maven. The application must be deployed on an application
server and the application server must be started before we can perform the integration tests. The application
should be undeployed and the application server should be terminated after the integration test has been performed
no matter what the result of the test was.

How can this be achieved with Maven?

(more…)

July 11, 2010

Parameterized JUnits tests

We want to run the same test more than once and only vary the parameters. The solution is to use JUnit and run our
tests with the Parameterized JUnit runner.

(more…)

Older Posts »

Theme: Customized Silver is the New Black. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 39 other followers