Skip to content

Migrate the testsuite from model-based coverage to tag-based coverage to make it faster #19

@fbuchinger

Description

@fbuchinger

Currently the exiftool.js coverage testsuite consists of about 7000 sample images from different camera models. This impressive number also brings some issues to the coverage suite:

  • it takes > 5 minutes on my machine to run, which doesn't allow fast testing of code changes
  • cloning the repo/installing the npm package means downloading > 100 MB of image data
  • the coverage suite emphasizes the idea of "supported" models instead of supported, i.e. decoded, tags. Its hard for the user to find out which tags are already supported by exiftool.js (one has to click through the reports to get an idea of that).

IMHO, exiftool.js should switch to a tag-based coverage, where there is exactly one sample image per decodeable tag (e.g. Exif Make). Further sample images should only be added in case of known regressions (e.g. some Nikon model writing a wrong datetime tag).

Advantages:

  • number of sample images can be decreased drastically (a quick investigation of the 7000 images showed that only approx 800 of them have "interesting" metadata beyond the standard Exif tags). A further de-deduplication (just one sample image for each decodeable tag) could maybe yield just some dozen sample images.
  • therefore the test suite will run much faster
  • smaller repo size, no more need for a test sub-repo.
  • the user knows at first sight which tags are already decoded

Approach:

  1. Remove all 7000 sample images from the test repo
  2. Extract all metadata as JSON from the 7000 sample images using perl exiftool
  3. Sort the metadata JSON by the images containing most tags
  4. Create an empty array for the metadata tagnames
  5. re-add image Exclude "FileAccessDate" from exiftool output as it always causes diffs #1 to the testsuite and push its tagnames to the array
  6. fetch the next image and check if it has any "new" tagnames not in the metadata array. Yes: add it to the testsuite and push the new tagnames to the array, No: discard the image.
  7. repeat step 7 for all images.
  8. Create a report that lists all tagnames from the array and the state of exiftool.js support

Please tell me if you are interested in a pull request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions