This articles examines ten different ways you can change your code to make it ready to be tested. By doing so, you will be creating a more loosely coupled, flexible and transparent architecture, which will benefit you not only in testing but in documentation, maintenance and, eventually, modification. With a little forethought and some careful implementation, the unit tests can drive more than the QA process; it can help you design a more robust application in the first place.
we are faced with a double edged sword. First, there is no formal unit test engineering discipline established in the community that provides a guide to the programmer and works to ensure some level of unit test quality. Second, the prerequisite that the design has to be somewhat formalized before any tests can be written causes difficulty for many programmers because they either don't have formal design experience or simply don't like up front design work. Aggravating this situation is the idea that up front design work can be replaced under the guise of "refactoring". In order to blunt this sword, two things are needed--a formalization of unit testing by establishing unit test patterns, and the early adoption of object oriented design patterns in the developing application to specifically target the needs of unit testing.
In this document you will learn about creating testing classes for your project. One of the hardest tasks when using a new tool is learning how to integrate it into your regular build lifecycle. Hopefully this tutorial will help you in creating new test classes, maintain your existing test classes, and take advantage of advanced features in the csUnit API.
This guide will show you how to setup J2MEUnit in a modern IDE like Eclipse and write your first test case. Once you have followed all the steps you will have a test-driven development environment ready to go.
Continuous Integration is one of the buzzwords most people have probably heard of but surprisingly few are actually following this XP best practice. Keeping this in mind, I'll begin this tutorial by briefly describing what Continuous Integration actually means, why you should consider doing it, and finally, showing step by step how to do it using one of the most used Continuous Integration products, the open source CruiseControl.
The term 'Mock Objects' has become a popular one to describe special case objects that mimic real objects for testing. However the term mock was not originally meant as a more catchy name for stub, but to introduce a different approach to unit testing. In this article I dig into this difference of style to explain the difference between the interaction-based testing style favored by mock object fans, and the more usual state-based testing style.
Inversion of Control (IOC) is a new pattern that has been gaining popularity recently. The pattern is based on a few simple concepts that deliver a highly decoupled, lightweight, mobile, and unit-testable code base.