Requirements and Specification
System Requirements
lobster/tools/json/input_files.trlc
TRLC System_requirement_aspect json_req.Input_File
IF a list element given through the command line option "FILE_OR_DIR" is a file (Note: Symbolic links shall be resolved. The tool shall not differentiate between symbolic links and true paths.)
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
TRLC System_requirement_aspect json_req.Input_File_Valid_JSON
AND IF the file content is invalid JSON, THEN the tool shall exit with a non-zero return code.
Issues:
missing reference to System Test
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
TRLC System_requirement_aspect json_req.Input_File_Input_Items
OTHERWISE the input data SHALL be written in the LOBSTER interchange format
Issues:
missing reference to System Test
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
TRLC System_requirement_aspect json_req.Input_File_To_File
to the file given in the command line option "out", IF that option is given AND is not an empty string;
Issues:
missing reference to System Test
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
TRLC System_requirement_aspect json_req.Input_File_To_Stdout
Issues:
missing reference to System Test
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
TRLC System_requirement_aspect json_req.Input_File_Output_Error
IF the operating system fails to fully serialize the output to a file, THEN the tool shall print an error message to STDERR and exit with a non-zero return code.
Issues:
missing reference to System Test
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
TRLC System_requirement json_req.Input_File_JSON_Extension
IF [[Input_File]] AND IF the file extension is not "json" (case-insensitive), THEN the tool shall print a warning.
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
lobster/tools/json/input_not_file_not_directory.trlc
TRLC System_requirement json_req.Input_Not_File_Not_Directory
IF a list element given through the configuration file under "inputs" is not a file nor a directory, THEN the tool shall exit with a non-zero return code. Note: This could happen if a path does not exist.
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
lobster/tools/json/synthetic_name.trlc
TRLC System_requirement json_req.Name_Attribute_Given
In addition to [[Parse_Input_File]], IF the command line option "name-attribute" is given and not an empty string, AND the input items contains that key THEN the tool SHALL use the value of that key as tag in the serialized LOBSTER item.
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
TRLC System_requirement_aspect json_req.Name_Attribute_Given_Key_Missing
OTHERWISE (if they key does not exist) the tool SHALL print an error message.
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
TRLC System_requirement_aspect json_req.Name_Attribute_Missing
OTHERWISE ("name-attribute" is not given or not an empty string), the tool SHALL create a synthetic tag name based on the path of the JSON input file and an item counter. Notes: - "Synthetic" means that, the name does not need to be related to the data. - The item counter does not need to be unique across input files, but it shall be unique at least for each input file separately. - No further specification is made about how to combine the path and the item counter.
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
Software Requirements
No items recorded at this level.
Implementation
Code
lobster/tools/json/json.py
Python Constructor json.Malformed_Input.__init__
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
Python Function json.get_item
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
Python Function json.syn_test_name
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
Python Constructor json.LOBSTER_Json.__init__
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
Python Method json.LOBSTER_Json.get_config_keys_manual
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
Python Method json.LOBSTER_Json.get_mandatory_parameters
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
Python Method json.LOBSTER_Json.process_commandline_and_yaml_options
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
Python Method json.LOBSTER_Json.process_tool_options
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
Python Method json.LOBSTER_Json.process
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
Python Function json.main
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
Verification and Validation
System Test
tests_system/lobster_json/lobsterjsontestrunner.py
PyUnit Test lobsterjsontestrunner.LobsterJsonTestRunner.run_tool_test:87
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
tests_system/lobster_json/test_directories.py
PyUnit Test test_directories.InputDirectoryJsonTest.test_missing_directory:13
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
PyUnit Test test_directories.InputDirectoryJsonTest.test_empty_directory:27
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
PyUnit Test test_directories.InputDirectoryJsonTest.test_consumes_files_in_specified_directory:44
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
tests_system/lobster_json/test_input_not_file_not_directory.py
PyUnit Test test_input_not_file_not_directory.InputNotFileNotDirectoryTest.test_nothing_exists:29
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
PyUnit Test test_input_not_file_not_directory.InputNotFileNotDirectoryTest.test_one_file_exists:39
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
tests_system/lobster_json/test_inputs_and_inputs_from_file.py
PyUnit Test test_inputs_and_inputs_from_file.InputsAndInputsFromFileParameterTest.test_inputs:17
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
PyUnit Test test_inputs_and_inputs_from_file.InputsAndInputsFromFileParameterTest.test_inputs_from_file:36
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
PyUnit Test test_inputs_and_inputs_from_file.InputsAndInputsFromFileParameterTest.test_consume_files_from_cwd:51
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
PyUnit Test test_inputs_and_inputs_from_file.InputsAndInputsFromFileParameterTest.test_consume_files_and_nested_directory_from_cwd:68
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
tests_system/lobster_json/test_json_extension.py
PyUnit Test test_json_extension.JsonExtensionTest.test_single_non_json_extensions:12
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
PyUnit Test test_json_extension.JsonExtensionTest.test_mixed_extensions:29
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
PyUnit Test test_json_extension.JsonExtensionTest.test_invalid_json_content:47
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
PyUnit Test test_json_extension.JsonExtensionTest.test_inputs_and_inputs_from_files_with_mixed_extension:57
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
tests_system/lobster_json/test_justification_attribute.py
PyUnit Test test_justification_attribute.JsonJustificationAttributeTest.test_justification_attribute_given:12
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
PyUnit Test test_justification_attribute.JsonJustificationAttributeTest.test_justification_attribute_given_but_key_missing:28
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
PyUnit Test test_justification_attribute.JsonJustificationAttributeTest.test_justification_attribute_not_given:45
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
tests_system/lobster_json/test_multiple_files.py
PyUnit Test test_multiple_files.JsonMultipleFilesTest.test_multiple_input_files_specified_in_config:13
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
PyUnit Test test_multiple_files.JsonMultipleFilesTest.test_directory_with_empty_invalid_file:43
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
PyUnit Test test_multiple_files.JsonMultipleFilesTest.test_inputs_from_file_specified_in_config:62
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
PyUnit Test test_multiple_files.JsonMultipleFilesTest.test_inputs_and_inputs_from_file_With_extra_valid_files:90
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
tests_system/lobster_json/test_name_attribute.py
PyUnit Test test_name_attribute.JsonExtensionTest.test_attribute_given:14
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
PyUnit Test test_name_attribute.JsonExtensionTest.test_attribute_given_but_key_missing:29
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
PyUnit Test test_name_attribute.JsonExtensionTest.test_name_attribute_missing_flat_input:46
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
PyUnit Test test_name_attribute.JsonExtensionTest.test_name_attribute_missing_nested_input:60
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
tests_system/lobster_json/test_tag_attribute.py
PyUnit Test test_tag_attribute.JsonTagAttributeTest.test_tag_attribute_given:11
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
PyUnit Test test_tag_attribute.JsonTagAttributeTest.test_tag_attribute_given_but_key_missing:26
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
PyUnit Test test_tag_attribute.JsonTagAttributeTest.test_tag_attribute_missing:40
Build Reference: f8fd7fec387000b9da849c4c0ec20550b9334106 | Timestamp: 2025-08-05 14:16:58+00:00 UTC
Software Test
No items recorded at this level.