O'Reilly logo

Java 9 Cookbook by Nick Samoylov, Mohamed Sanaulla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How it works...

For testing, we need to set the expected values, which we can then can compare with the (actual) values, produced by the application that processes real data. But real data change slightly from run to run, and an attempt to predict the resulting values either makes the test fragile or forces the introduction of a huge margin of error, which may effectively defeat the purpose of testing.  

We cannot even mock the generated data (as we did in the case of unit testing) because we are at the integration stage and have to use the real data. 

One possible solution would be to store the incoming real data and the result our application produced along with them in the database. Then, a domain specialist can walk through each record ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required