Skip to main content

Posts

How many unit tests are enough?

For some time now, I’ve had concerns about the large automated test suites that are being written; some with hundreds and hundreds of unit tests. It’s great that people are taking test automation seriously and writing lots of unit tests. Once developers get on the bandwagon they tend to write large numbers of unit tests and it feels good to see the number rise. It gives you a sense of confidence. I’ve seen this in my own team. Once the developers started writing unit tests they didn’t know when to stop and we ended up with a large unit test suite. The problem is that unit test suites need to be maintained, just like production code. Also it takes time and effort to write the unit tests in the first place. So the questions in my mind are: are all these unit tests actually catching defects and do we need to write quite so many? Of course others have thought of these same questions and I’ve come across a couple of blogs that have some great ideas on how we can get the most out of a un...

My Article in Testing Trapeze

I have just had an article that I wrote published in the June edition of Testing Trapeze. This is a great magazine with some really interesting articles from testers in New Zealand and Australia. My article is entitled "Who Should be Writing Automated Tests?" Check it out in the  June Edition of Testing Trapeze

Unit and integration test guidelines for Spring Boot

When you have a legacy product that has been around for over 10 years and it is written with old technologies and has no automated tests, how do you improve quality? Sometimes the best solution is to rewrite it! That was the situation  we were in with a product written with JBOSS. It had become difficult to maintain and debug so we decided to rewrite it using the Spring Boot framework, and add unit and integration tests as we were doing it. This is not a simple undertaking and it's still a work in progress; but I feel we made the right decision. As not many of the developers had much experience with writing unit and integration tests, I wrote up the guidelines shown below. These have been written for a Java based Spring Boot project that uses the JUnit framework to write the tests, but are general enough to apply to most languages and frameworks. Guidelines: Test the behaviour of the class; not its implementation. Don’t test implementation details; e.g. priv...

How can we improve product quality?

Recently I joined a small company as their test lead and we have been looking at ways to improve the quality of our products. It got me thinking about all the factors that influence quality. This blog will be about my observations and lessons learnt as we go about creating high quality products for our customers. Improving the quality of a product relies on so much more than just testing. It involves a diverse range of factors including the process we use to develop the product, how the software is designed and coded, and of course how it is tested. It is not possible to test quality into a product. Instead, quality must be considered right from the start. So what are some of the factors that influence quality? It all starts with requirements and how they are written. Do they make crystal  clear to both the developers and the testers what is being created? We have found it very valuable to document high level customer requirements as user stories with acceptance crite...