Skip to content

Use of Settings in TestCentric #1412

@CharliePoole

Description

@CharliePoole

This issue is a reboot of issue #1214, which it replaces. Much of the discussion in that issue may still be useful as a reference but a lot of things have changed...

  1. We no longer have our own engine but use NUnit's engine and have to deal with NUnit package settings as well as some settings of our own.
  2. A new type-safe form of package setting has been introduced and each setting defines it's own default values.

The word "setting" is overloaded. This issue considers three types of settings and we will use different names for them in the discussion.

  1. Application Settings are persistent settings saved by an application for regular use.
  2. Project Settings are settings used in a particular TestCentric project.
  3. Package Settings are an NUnit concept and refer to settings incorporated in a TestPackage.

Each of these settings types will be explained further, followed by a checklist of actions needed to complete this design issue.

TestCentric Application Settings

TestCentric Application Settings were originally saved in the TestCentricSettings.xml file but are now saved in a user.config file using Windows class UserApplicationBase. While all settings changes are triggered by user action, only a small number are set explicitly through our Settings dialog. Many other settings are saved "behind the scenes" by TestCentric when the user makes a change. For example, whenever the main TestCentric window moved or resized, the settings controlling window positioning are changed so that the Window will appear in the same way the next time the application is opened.

Settings Dialog

This multi-paned dialog is used for changing and saving a number of application Settings explicitly. Because many of these are also saved as individual project settings (see next section), they are only useful when creating a new project.

TestCentric Project Settings

When a TestCentric project is saved two files are created. A .VisualState.xml file contains items needed to restore the visual appearance of the GUI when the project is reopened. A .tcproj file is used to save non-visual settings so that everything works the same as when the project was last used.

NUnit Package Settings

In the V3 NUnit engine package settings were simply objects saved as the value of a name in a Dictionary<string, object>. That meant that each use of a setting required a cast at the call site and a generic method was used for that purpose, with the specific type indicated by a default value parameter. The specified default could be different for different calls, which sometimes led to errors.

The V4 engine, which we use, encapsulates each setting as an object, with the required Type and default value included. When creating a TestPackage for use with the NUnit engine, we generally only specify a particular setting if it differs from the default. Our goal is to rely as much as possible on NUnit's built-in defaults, reducing the values that are saved for the application as a whole and for individual projects.


Decisions Needed

The following list -- which may be expanded as we proceed -- includes the specific decisions that need to be made to complete this issue. Individual items will be checked off once a decision is made and any required implementation issues created. The current issue will not be used for any implementation details.

  • Which settings should we continue to support in the Settings Dialog?
    DECISION: We'll radically reduce the scope of the Settings Dialog as per the discussion in this issue.
  • Can we eliminate all settings used as "user defaults" for new projects?
    DECISION: Not all but most can be eliminated.
  • For any settings to be removed from the dialog, will they need to be added elsewhere in the GUI? Where?
    STATUS: let's revisit this one after Reduce the scope of the Settings Dialog #1413 is completed.
  • Should the .VisualState.xml file and .tcproj file be combined?
    DECISION: We'll keep them separate.
  • If they are not combined, which specific settings should be saved in each file?
    DECISION: No action needed.
  • Should TestCentricProject continue to derive from TestPackage or should we use composition instead?
    DECISION: We will switch to use of composition.

Issues created to carry out our decisions

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions