TESTAR_dev icon indicating copy to clipboard operation
TESTAR_dev copied to clipboard

[Refactor] Settings values validation

Open ferpasri opened this issue 2 years ago • 1 comments

Current status

TESTAR internally validates that it is possible to parse the value of different settings corresponding with the expected Java class object (Double, Integer, Boolean, etc.)

https://github.com/TESTARtool/TESTAR_dev/blob/e4ec481d51b1138a5419e22c55e786554ee4bc00/testar/src/org/testar/monkey/Settings.java#L108

Some specific settings require additional validation to verify correct configurations and to avoid TESTAR exceptions:

  • AbstractStateAttributes validate custom state tags for state abstraction
  • ApplicationName validate special characters that affect output results creation
  • ClickFilter validate regex expressions
  • PathToReplaySequence validate input file paths

https://github.com/TESTARtool/TESTAR_dev/blob/e4ec481d51b1138a5419e22c55e786554ee4bc00/testar/src/org/testar/monkey/Settings.java#L581

https://github.com/TESTARtool/TESTAR_dev/blob/e4ec481d51b1138a5419e22c55e786554ee4bc00/testar/src/org/testar/monkey/Main.java#L772

Refactor task

We need to identify the different groups of settings and refactor their respective validations to avoid exceptions, such as #357 , and improve user information feedback.

ferpasri avatar Jun 12 '23 08:06 ferpasri

ProtocolClass setting

If the ProtocolClass setting name or path is invalid, a message is thrown in the output buffer to indicate that users need to customize a valid protocol path.

Refactor idea

If the dialog is enabled, a possible improvement might be to display a GUI message with a dropdown select option to allow users to select the correct existing protocol name or path in the settings directory.

ferpasri avatar Mar 04 '25 09:03 ferpasri