I'm in the process of writing tests for a software. The aim of the tests is that when changes are made to the software source no side effects occur.
The software reads data from files and stores them in RAM.
I've written a JUnit test that stores Object Field Values (primitive Types and Strings) into a Vector. These Field Values come from a clearly defined, representative data set in the testing environment. I then deserialize the Vector from my last test run and compare it to current Vector. I then assert:
assertArrayEquals(expectedVector.toArray(),actualVector.toArray());
like this, I quickly see if data is being stored differently in RAM.
Is this a useful test? Is there a more simple approach to test that the Object Data is being loaded the same way? Is this common practice or are these kinds of tests done in a different manner?
Aucun commentaire:
Enregistrer un commentaire