Home » Tag Archives: Testing (page 23)

Tag Archives: Testing

A Classification of Tests


There are many ways of testing software. This post uses the five Ws to classify the different types of tests and shows how to use this classification. Programmer vs Customer (Who) Tests exist to give confidence that the software works as expected. But whose expectations are we talking about? Developers have different types of expectations about their code than users ...

Read More »

Tips for testing with Java


Introduction I love automated testing. In a rare diversion into op-ed1 I thought a put few thoughts (read – opinions) together. Before I start on how best to compose your tests, I briefly ask – What are the reasons for testing? Broadly, I think they are: Reduce total number of bugs / increase product stability Ensure software works as per ...

Read More »

What’s better – Big Fat Tests or Little Tests?


Like most startups, we built a lot of prototypes and wrote and threw out a lot of code as we tried out different ideas. Because we were throwing out the code anyways, we didn’t bother writing tests – why write tests that you’ll just throw away too? But as we ramped the team up to build the prototype out into ...

Read More »

Using EasyMock or Mockito


I have been using EasyMock for most of time but recently I worked with a few people who were pretty much inclined to use Mockito. Not intending to use two frameworks for the same purpose in the same project I adopted Mockito. So for the last couple of months I have been using Mockito and here is my comparative analysis ...

Read More »

Testing Spring & Hibernate Without XML


I’m very keen on the improvements in Spring 3 that eventually let you move away from XML into plain Java configuration with proper support from IDE and compiler. It doesn’t change the fact that Spring is a huge suite and it sometimes finding the thing you need can take a while. XML-free unit tests around Hibernate are one such thing. ...

Read More »

Answering with Mockito


When you are writing unit tests, you must keep in mind to not have dependencies to external components. To avoid this we use mock frameworks which for me the easiest one to use is Mockito. In this post we are going to see an ‘advanced’ technique used in Mockito to return same argument instance on a mocked method using Answer ...

Read More »

Extending JMeter with a WS-Trust/STS sampler


JMeter does not have any inbuilt support for WS-Security or WS-Trust and that made me develop this STS Sampler for JMeter – which could make anyone’s life better while load testing an STS. First you need to have the Apache JMeter distribution. I am using v2.7. Then you can download sts.sampler.zip from here – unzip it and copy the “repo” ...

Read More »

Extending JMeter with a password digest generator


Recently I had to work on loading an OpenLDAP instance with 50,000 user records and carry on some stress testing. JMeter was the best choice to populate the LDAP. But.. in my case, OpenLDAP was configured not to accept any clear text passwords. So, I could not login in with any of the random generated passwords I added via JMeter ...

Read More »

Integration tests with Maven 3, Failsafe and Cargo plugin


Unit testing is available in Maven out of the box. Because of that very often its used for integration tests as well. Major disadvantage of this is that integration tests can take much more time to execute and because no one likes to wait long time every build – tests are just skipped with -Dmaven.test.skip=true flag In order to execute ...

Read More »

Categorize tests to reduce build time


Before we progress with the main content of the article, let’s get a few definitions out of the way. Unit tests Unit tests are tests that are small (tests one use case or unit), run in memory (do not interact with database, message queues etc.), repeatable and fast. For our conversation let us restrict these to JUnit based test cases ...

Read More »
Want to take your Java Skills to the next level?
Grab our programming books for FREE!
  • Save time by leveraging our field-tested solutions to common problems.
  • The books cover a wide range of topics, from JPA and JUnit, to JMeter and Android.
  • Each book comes as a standalone guide (with source code provided), so that you use it as reference.
Last Step ...

Where should we send the free eBooks?

Good Work!
To download the books, please verify your email address by following the instructions found on the email we just sent you.