I'd like for more of my colleagues to write unit tests. My motives are selfish. Unit tests help me figure out how methods of the unit are supposed to work. Unit tests are documentation too. And if a unit is testable, that makes it pretty good code. I believe one reason that some of my fellows don't write unit tests is because they're not quite sure how the mock object thing fits in. I'll explain.
Writing unit tests for any application relies upon being able to isolate the object under test, which can be difficult in these situations. Here we’ll take a look at a few strategies for properly isolating the code that you are trying to test in order to prove that it works without having to test your entire system.
This paper gives a complete description of code coverage analysis (test Applying Mock objects effectively is a key factor when performing Test Driven Development (TDD). In this article I'll introduce the basics of using JMock, a Mock object framework, in conjunction with Test-Driven Development. To illustrate the technique I will work through a case study, the creation of a cache component by means of test-first development with JMock.
Writing unit tests for code that accesses the database is a recurring challenge for Java developers. This post will describe a technique we’ve used successfully on a number of database-intensive projects: using HSQLDB as an in-memory database so that the database access code can be thoroughly tested without dependencies on external resources.
The article, Using Debug Perspective, will guide you through the ways of setting up breakpoints and navigate through the code using various breakpoint manipulation options. This article will guide you to learn what breakpoints are and how to use them. After reading this article, you will be able to effectively debug Java applications of any scope. Fortunately, any prior knowledge of Eclipse is not required; thus it is suitable for developers with any level of experience in Eclipse application development and testing.