Posts in category 'unit testing'

  

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 […]

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 […]

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 […]

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 […]