Runtime Validation via External Documentation Files

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Dynamic programming languages like JavaScript require extensive type checks and documentation, leading to cluttered code and performance issues due to their loose typing and runtime type determination, making debugging and maintenance challenging.

Innovation Solution

An object validation system that uses a document file to store validation information, allowing for runtime validation of function parameters, return values, and properties, eliminating the need for repetitive type checks within the code and generating human-readable documentation from these documents.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If type checks and validation code are added to ensure correctness in dynamically-typed languages, then reliability is improved, but device complexity increases due to cluttered code with numerous if checks

Engineering Contradiction:
Improvecode correctnessVSAvoidcode complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent extracts validation logic from the source code into separate documentation files (e.g., JSON, YAML, XML). The documentation contains type definitions, parameter validations, and return value checks that are separated from the actual code, reducing code clutter while maintaining reliability through external validation rules.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent introduces documentation files as an intermediary between the source code and validation requirements. These documentation files serve as a mediator that defines validation rules without being embedded in the code, allowing the code to remain clean while still enforcing type safety and correctness through the intermediary documentation layer.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Ease of operation

If documentation is placed within source code as comments, then ease of operation is improved by having documentation available, but device complexity increases due to verbose code mixing documentation and implementation

Engineering Contradiction:
Improvedocumentation accessibilityVSAvoidcode verbosity
Core Design Contradiction:
Ease of operationVSDevice complexity

Solution Approach 1:

The patent extracts documentation from source code comments into separate documentation files. This allows documentation to be easily accessible and maintainable without being embedded in the code, reducing code verbosity while preserving documentation availability through external files that can be referenced by the code.

Inventive Principle:
Principle #2Taking out (Extraction)

3Reliability

If extensive type checks are performed at runtime in dynamically-typed languages, then reliability is improved, but productivity decreases due to performance overhead from frequent validation checks

Engineering Contradiction:
Improvetype safetyVSAvoidexecution performance
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent performs validation checks preliminarily by defining type schemas and validation rules in documentation files before runtime execution. The validation logic is prepared in advance based on the documentation, allowing for more efficient runtime checking compared to ad-hoc if checks scattered throughout the code. This preliminary preparation of validation rules improves both reliability and performance.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS10120776B2Documents for human readable documentation and runtime validation
Publication Date: 2018.11.06 HOME BOX OFFICE INC
  • US10120776B2 patent drawing
  • US10120776B2 patent drawing
  • US10120776B2 patent drawing

AI summary

The described technology is directed towards having document files (e.g., a JSON object) associated with objects of a computer program. The document files may include validation information that is used during runtime to validate one or more parts of the object via validation code such as a validation function. For example, a function of an object may have one validation function that during runtime validates whether the input parameter(s) are valid (their types and/or values are correct), and another validation function that during runtime validates whether the return values from the function are valid. Also described is processing the document files into more easily readable documentation, e.g., without any source code.