os-threat / Stix-ORM

GNU Affero General Public License v3.0
4 stars 0 forks source link

Setup Effective Testing #15

Open brettforbes opened 1 year ago

brettforbes commented 1 year ago

Assuming Issue #6 is fixed then build an effective test Regime

Testing Regime We need to develop a rational series of tests, which use your code for four or five different cases:

  1. Load all files in the directory and check that the number of id's in the database, matches the number of distinct id's in the directory. Use the data/standards, data/examples and data/mitre/load directories
  2. Load all the files in the directory, get all of the objects in the database, and prove that exported objects are equivalent to the imported ones, ignoring list order. Use the data/standards, data/examples and data/mitre/load directories. Load the files one by one and it will check whether you can deal with two errors conditions: A. Where the objects i already loaded, and B. Where the dependency is not in the file but is already loaded
  3. Load all the files in the directory, and delete all of the objects in the database. Prove that all objects were loaded, and then deleted with no attributes hanging around that are not attached to the four marking objects.
  4. Load the two network files in the data/standards/issues files and check that you can load files with circular references, that they can be exported and the objects are identical and they can be deleted
  5. Develop a test where there is a missing dependency that is not loaded. Check that no objects are loaded, or if they are they are deleted. Check that an appropriate error message is provide including the list of ids of the dependencies that are not available