Home » Tag Archives: Testing (page 18)

Tag Archives: Testing

Running JUnit Tests Repeatedly Without Loops

junit-logo

Recently I came across a problem where I had to write tests for a method that calculates randomly distributed values within a certain range of possibilities 1. More precisely if you assume a signature that looks like                 interface RandomRangeValueCalculator { long calculateRangeValue( long center, long radius ); } a test might verify ...

Read More »

Penetration Testing Shouldn’t be a Waste of Time

software-development-2-logo

In a recent post on “Debunking Myths: Penetration Testing is a Waste of Time”, Rohit Sethi looks at some of the disadvantages of the passive and irresponsible way that application pen testing is generally done today: wait until the system is ready to go live, hire an outside firm or consultant, give them a short time to try to hack ...

Read More »

JUnit: Naming Individual Test Cases in a Parameterized Test

junit-logo

A couple of years ago I wrote about JUnit Parameterized Tests. One of the things I didn’t like about them was that JUnit named the invidividual test cases using numbers, so if they failed you had no idea which test parameters caused the failure. The following Eclipse screenshot will show you what I mean:             ...

Read More »

War Games, Pair Testing and Other Fun Ways to Find Bugs

software-development-2-logo

I’ve already examined how important good testing is to the health of a project, a product and an organization. There’s a lot more to good testing than running an automated test suite in Continuous Integration and forcing someone to walk through functional test scripts and check lists. A good tester will spend time exploring the app, making sure that they ...

Read More »

Testing Spring Data Neo4j Applications with NoSQLUnit

neo4j-logo

Spring Data Neo4j is the project within Spring Data project which provides an extension to the Spring programming model for writing applications that uses Neo4j as graph database. To write tests using NoSQLUnit for Spring Data Neo4j applications, you do need nothing special apart from considering that Spring Data Neo4j uses a special property called type in graph nodes and ...

Read More »

JUnit and EasyMock cooperation

easymock-logo

Developers always need to take care about code which they produced. They should be ensured that code works properly after a new feature was implemented or some bug was fixed. That’s can be achieved at least with the help of unit tests. Since this blog is dedicated to Java programming language, today I will write the article about JUnit 4.1 ...

Read More »

Testing Expected Exceptions with JUnit Rules

java-logo

This post shows how to test for expected exceptions using JUnit. Let’s start with the following class that we wish to test:                   public class Person { private final String name; private final int age; /** * Creates a person with the specified name and age. * * @param name the name ...

Read More »

Don’t rely on unit tests alone

junit-logo

When you are building a complex system, barely testing components in isolation is not enough. It’s crucial, but not enough. Imagine a car factory that manufactures and imports highest quality parts, but after assembling the vehicle never starts the engine. If your test case suite consists barely of unit tests, you can never be sure that the system as a ...

Read More »

Synchronising Multithreaded Integration Tests

java-interview-questions-answers

Testing threads is hard, very hard and this makes writing good integration tests for multithreaded systems under test… hard. This is because in JUnit there’s no built in synchronisation between the test code, the object under test and any threads. This means that problems usually arise when you have to write a test for a method that creates and runs ...

Read More »
Do you want to know how to develop your skillset and become a ...

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!
Get ready to Rock!
To download the books, please verify your email address by following the instructions found on the email we just sent you.

THANK YOU!

Close