Understanding the Solution
Visual Studio populates the new static model solution with three projects as follows in Solution Explorer.
These projects constitute a minimal sample solution which allows you to run all phases of model exploration, test generation, and test execution. You can modify these according to your needs. The names for these projects are the wizard defaults that you can override during the earlier dialogs of the Spec Explorer Model Wizard.
The skeleton sample provided in this static modeling solution is a simple adder/readout program. Numeric values can be added to a counter, or the counter can be read-out and reset.
Project
SpecExplorer1
contains the model. The model comprises two files: a C# file,AccumulatorModelProgram.cs
, containing the model program, and a configuration file,Config.cord
, that works in conjunction with the model program to configure and control Spec Explorer operation on behalf of exploring and testing the model. For your own solutions, the model project can have more than one C# file to define the model program. The model project can also contain more than one Cord configuration file, although this is not usually necessary.Project
SpecExplorer1.Sample
contains a skeleton sample of an implementation under test. For your own solutions, this project can contain either the actual implementation code, or a test adapter which connects to the implementation code. In the solution we are examining here, theSpecExplorer1.Sample
project contains some actual implementation code. In fileAccumulator.cs
is a dummy implementation of anAccumulator
class that is hard-coded to not conform to the model expressed in theSpecExplorer1
model project. This intentional non-conformity forces a testing failure for exposition purposes.Project
SpecExplorer1.TestSuite
provides the test suite in the form of a VSTT unit test project, contained inAccumulatorTestSuite.cs
. This file is empty when the solution is created, as test code hasn’t been generated yet. This file will be overwritten by the test generation process.