Posts Tagged ‘unit testing’


The Value of Measuring Code Coverage

Code coverage is the percentage of production code that is executed by your automated test suite. Writing automated tests has been a widely-accepted industry practice for years now, particularly for unit testing. Test-driven development (TDD) is a practice that I use which helps achieve high coverage rates: perfect adherence to TDD in theory will result […]

Running Java Unit and Integration Tests Separately

Eclipse and Maven are not designed from the ground up to run automated integration tests separately from unit tests. This is a problem because integration tests typically take longer to run, so when coding, especially if doing test-driven development, there is the need to frequently run just the unit test suite from Eclipse. Maven by […]

Connecting with Calgary

I recently had the opportunity to travel to Calgary, Alberta to visit the CGI office there and hang out with several of the development teams. These teams have extensive experience with larger-scale agile development including both XP and Scrum and have a good reputation for having a great development culture that excels at mentoring and […]

Reviewing Automated Test Code

Software engineering research and my own experience have taught me the value of code reviews and automated tests, especially automated unit tests written using test-driven development (TDD). In the past my general pattern when doing code reviews has generally been to focus on production code and do a more minimalistic review of the unit test […]

Use Understood Methods Rule

Over the years I have refined the approach I use to write code. Recently I codified a key aspect of this approach as a practice I call the Use Understood Methods Rule. The basic formulation of the rule is quite simple: when coding a method only invoke other methods whose behavior you clearly understand and […]

Test Driven Development – Benefits, Limitations, and Techniques

I wrote previously about the process I went through in adopting test driven development (TDD). In this article I discuss my experience with TDD: the benefits, the limitations, and the techniques I use when doing TDD. Benefits This section covers the benefits, as I see them, of doing TDD. This does not include the benefits […]

Adopting Test Driven Development

I have always been keen on using automated unit tests since I first heard about them almost a decade ago. I have known about test driven development (TDD) for almost as long but the practice of writing tests first before writing production code never really clicked for me when I first tried it years ago. […]

Time Reporter Version 2.0 Available

I have just released version 2.0 of my Time Reporter utility. It is available for download from my Software page. The major change in this release is added support for aggregated reporting across different task categories, which I call rollup groups. This required expanding the categories of types to three: base tasks, rollup tasks, and […]

Java Unit Testing Tutorial: Write Your First Unit Test

In this section of the Java Unit Testing Tutorial you will write your first unit test and get it to execute successfully. Tutorial Introduction Previous: Initial Setup Determine What to Test Before you can write your first unit test you need some code to test. If you are trying this in your own project, then […]

Java Unit Testing Tutorial: Initial Setup

In this section of the Java Unit Testing Tutorial you will install JUnit, the unit testing framework you will use for unit testing, configure Eclipse to run your project’s tests, and finally configure your project for the unit test code you will write. Previous: Tutorial Introduction Next: Writing Your First Unit Test Install JUnit Follow […]

Java Unit Testing Tutorial

This tutorial explains how to set up and write automated unit tests in Java using JUnit 4, a widely used java unit testing framework, Eclipse 3, an open source integrated development environment (IDE), and Java SE 5 or later. This tutorial is intended to be an introduction to unit testing aimed at developers who have […]

Top Five Essential Practices for Developing Software

As a software developer what practices do you consider essential? Which practices are must-haves that you would refuse to build software without? I believe that producing good software is hard, and that we software developers need all the help we can get in developing software. I have put together a list of the top five […]

How to Write Good Unit Tests

My previous post on How to Create Maintainable Software talked about the importance of automated testing. Working with automated test suites over the years, I’ve found that creating good tests is a skill that needs to be developed. I’ve seen many cases of unit tests that I’d consider poor or bad due to a number […]

How to Create Maintainable Software

My previous article talked about the importance of maintainable software. In this article I provide some recommendations on how to create software that is maintainable – easy to change with minimal risk and impact. What are the specific challenges facing developers maintaining software? They probably did not originally develop the software, and may not even […]