Why should the step definitions be separated from the driving JUnit class when using Cucumber for Java?
October 31, 2011
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 18 October 2011.
October 14, 2011
October 6, 2011
Why isn’t my tests being executed?
Have you ever wondered why your Maven project doesn’t find and execute your tests?
September 16, 2011
Test drive an implementation using an Executable Specification
An example is perhaps the best way to describe something. Concrete examples are easier to understand then 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.
August 7, 2011
Test drive the implementation of a database layer
Development guided by test is perhaps the best way to make sure that your solution works and is possible to verify. I will show how you can develop a database layer guided by tests. It will be divided into two parts. The first part will be an in memory solution and the second part will be implemented using Java Persistence API, JPA, and Hypersonic. The second implementation is supposed to replace the first one guided by the tests developed for the in memory solution.
August 5, 2011
What is the difference between i++ and ++i?
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?
July 28, 2011
Do not return null
Using your IDE to automatically create methods for you maybe a disaster waiting to happen.
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.
June 10, 2011
Install a 3:rd part lib in Maven
Supose that you have a dependency that looks something like this:
<dependency>
<groupId>foo</groupId>
<artifactId>bar</artifactId>
<version>1.0</version>
</dependency>
that can’t be resolved and the build fails with the error message below: