NLOHMANN JSON LIBRARY#

This module is dedicated to implementing the Trustable Software Framework for the Niels Lohmann JSON Library. Initially, it emphasizes ensuring the reliability and correctness of the library’s parsing functionality. The Niels Lohmann JSON Library is recognized for its efficient and straightforward approach to JSON parsing, manipulation, and serialization within modern C++ applications, aiming to provide developers with a flexible and robust tool for managing JSON data structures. The framework seeks to enhance these capabilities, aligning them with rigorous software quality standards to ensure dependable JSON processing across diverse applications.

Overview#

This repository provides the aspired setup for projects using C++ and Bazel as a build system.

Requirements#

Correct JSON Parsing
status: valid
safety: QM
status: valid
rationale: Ensure the library accurately parses JSON strings into their corresponding data structures, accommodating both common and edge cases.
reqtype: Functional
safety: QM
Efficient Serialization
status: valid
safety: QM
status: valid
rationale: Guarantee that the library performs serialization operations swiftly, minimizing processing time and resource consumption.
reqtype: Functional
safety: QM
Comprehensive Testing
status: valid
safety: QM
status: valid
rationale: Achieve 100% test coverage in unit and integration tests, including verification against memory leaks using tools like Valgrind and Clang Sanitizers.
reqtype: Non-Functional
safety: QM
Fuzz Testing Compliance
status: valid
safety: QM
status: valid
rationale: Integrate continuous fuzz testing to detect vulnerabilities, executing extensive test scenarios as part of a broader security strategy.
reqtype: Non-Functional
safety: QM
Adherence to Apache License 2.0
status: valid
safety: QM
status: valid
rationale: Ensure all aspects of the library, including contributions and modifications, adhere to the terms specified under the Apache License Version 2.0.
reqtype: Legal
safety: QM

Project Layout#

This module includes the following top-level structure:

  • nlohmann_json/include/: C++ source code for the NLOHMANN JSON library

  • nlohmann_json/tests/: Unit and integration tests

  • docs/: Documentation using docs-as-code

  • .github/workflows/: CI/CD pipelines

Quick Start#

To build the module:

bazel build

To run tests:

git submodule init
git submodule update
bazel test //nlohmann_json/tests/src:all_nlohmann_tests --test_output=all

To update the documentation:

bazel run //docs:incremental
python3 -m http.server --directory _build

To generate LaTeX documentation:

apt-get install texlive texlive-latex-extra texlive-fonts-recommended
sphinx-build -b latex . _build/latex
cd _build/latex
pdflatex nlohmannjsonlibrary.tex