Skip to main content

Json SChema Backend Config Test Plan

This document outlines the test plan for the Json Schema backend initial configuration processing.

The decision table for a complete test coverage is given below:

Test CaseConfig Flag(s)Config FileCLI Parameters
#1NoNoNo
#2NoNoYes
#3NoYesNo
#4NoYesYes
#5YesNoNo
#6YesNoYes
#7YesYesNo
#8YesYesYes

These would be unit tests of the inferBackendConfig() function defined in config-processing.ts

Test Cases #5 and #6​

In these two test cases, the users intends to use a configuration file (by providing the flag) but the configuration file does not exist. A number of possibilities exists to handle this:

  • ensure config file exist before the json-schema-gen command can be run
  • build up a config file at this point
  • completely ignore the user flag and proceed as in Test Cases #1 to #4 \ For these test cases, we use default configuration but notify the user of absense of a cofig file

Test Cases #7 and #8​

In these two test cases, the user specifies to use a configuration file and the configuration file exist. At this point, there are three possible routes.

  • configuration file exists unmodified by user
  • configuration file exists modified by user
  • configuration file exists but is invalid \ The first point basically equates to Test cases #1 to #4 \ So for these test cases, we would assume the config file was modified by the user (second point) \ Further test cases would be written to cover the third point (invalid config file)