cyclonedx-core-java
cyclonedx-core-java copied to clipboard
Implement "Roundtrip" Tests to Improve Integrity
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
- Parse BOM that is known to be valid
- Generate a BOM based on what has been parsed
- Compare input and output - Should be the same, otherwise either parsing or generation is broken
- Validate output against schema - Should be valid, otherwise generation is broken
For reference, the Go and .NET implemenations do this:
- https://github.com/nscuro/cyclonedx-dotnet-library/blob/main/tests/CycloneDX.Core.Tests/Json/v1.4/SerializationTests.cs
- https://github.com/CycloneDX/cyclonedx-go/blob/master/roundtrip_test.go
@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