CycloneDX / cyclonedx-core-java

CycloneDX SBOM Model and Utils for Creating and Validating BOMs
https://cyclonedx.org/
Apache License 2.0
81 stars 59 forks source link

Implement "Roundtrip" Tests to Improve Integrity #418

Open msymons opened 3 months ago

msymons commented 3 months ago

The project should implement "roundtrip" tests in order to exercise validation and, hopefully, help prevent the defects that led to the need to release v9.01 and v9.02

  1. Parse BOM that is known to be valid
  2. Generate a BOM based on what has been parsed
  3. Compare input and output - Should be the same, otherwise either parsing or generation is broken
  4. Validate output against schema - Should be valid, otherwise generation is broken
nscuro commented 3 months ago

For reference, the Go and .NET implemenations do this:

mr-zepol commented 3 months ago

@msymons thanks, I am working on this, also adding some backward compatibility tests as well, once I have a better idea and changes on what I wanna do I will create a PR