Overview

This is an introductory course that covers the feature model meta model and the associated views, feature model editor, product builder, variability editor.


Prerequisites


Product Line Engineering: Solution

  • One product line containing variability from which a range of products can be configured
  • Functionality introduced once
  • Bugs fixed once – used for all products
  • Fewer software to maintain





The Feature Model


The feature model captures how the product varies. Solutions developed are related to how the product varies. This means that if a specific product is built that contains a feature, all solutions related to that feature will be part of the specific product. This also means that the feature model need to be concrete and the features in the feature model cannot change their meaning over time since this means that the solutions connected to the feature would not be valid any more.



The feature model contains:

  • Feature families
  • Features

Feature families specifies what can vary within a product, features are the specific ways that the feature family varies.



Features owns the part to the feature family. This meta model solution makes it possible to expand the feature family without changing the version of the feature family. Since many artifacts relate to the feature model, the contents of the feature model should be kept stable – no changes to versions etc.


Restrictions in terms of which features are compatible can be added as “Variant restrictions”.



Product configurations can be created as a combination of features to be used for the specific product.



Feature Model Views


  • Feature model editor - Used to edit the feature model.
  • Product builder - Used to create product configurations from the feature model.
  • Variability editor - Used to connect artifacts in the solution to the feature model.


The Feature model editor is hardcoded for the feature model meta model. The Feature model editor is active on the Feature model.




The Product builder is hardcoded for the feature model meta model. The Product builder is active on Product.





Artifacts are related to the feature model either directly to features or through logic expressions using “and” and “or”.




The variability editor is used to aid in creating the connections between artifacts and the feature model. The variability editor is Multiple configurable and needs to be configured for each of the types that is related to the feature model.


Configuration example:


<Configs>

  <VariabilityEditorConfig id="Unique identifier">

    <ViewSettings>

       <Caption>Variability editor</Caption>

       <RibbonGroup>Variability</RibbonGroup>

       <Description>Specify variability for item</Description>

    </ViewSettings>

    <TopItem sid="4BAS"/>

    <FeatureModelPath sid="/4SPE/10IFM"/>

    <FeatureItemType sid="10FE"/>

    <FeatureDependants>

       <FeatureDependant sid="DREQ" useRefObj=“False">

          <PathTopToSelected sids="4SPE;3VDA;ITFD;ITAP;ITFC;IDRE"/>

          <ExistsForPart sid=“10RE"/>

          <FunctionalDesignItem sid="BISG"/>

          <PathFunctionalDesignToSelected sids="ITAP;ITFC;IDRE"/>

       </FeatureDependant>

       </FeatureDependants>

  </VariabilityEditorConfig>

 </Configs>

The variability editor aids in creating the “Exists for” part relating the artifact to the feature model.





Each configuration of the variability editor should have a unique id. Each configuration can be used for multiple artifacts.


<Configs>

  <VariabilityEditorConfig id="Unique identifier">

    <ViewSettings>

       <Caption>Variability editor</Caption>

       <RibbonGroup>Variability</RibbonGroup>

       <Description>Specify variability for item</Description>

    </ViewSettings>

    <TopItem sid="4BAS"/>

    <FeatureModelPath sid="/4SPE/10IFM"/>

    <FeatureItemType sid="10FE"/>

    <FeatureDependants>

       <FeatureDependant sid="DREQ" useRefObj=“False">

          <PathTopToSelected sids="4SPE;3VDA;ITFD;ITAP;ITFC;IDRE"/>

          <ExistsForPart sid=“10RE"/>

          <FunctionalDesignItem sid="BISG"/>

          <PathFunctionalDesignToSelected sids="ITAP;ITFC;IDRE"/>

       </FeatureDependant>

       </FeatureDependants>

  </VariabilityEditorConfig>

</Configs>


The view settings specifies the name of the button, which Ribbon group it should be part of and the hover over help text.


<Configs>

  <VariabilityEditorConfig id="Unique identifier">

    <ViewSettings>

       <Caption>Variability editor</Caption>

       <RibbonGroup>Variability</RibbonGroup>

       <Description>Specify variability for item</Description>

    </ViewSettings>

    <TopItem sid="4BAS"/>

    <FeatureModelPath sid="/4SPE/10IFM"/>

    <FeatureItemType sid="10RF"/>

    <FeatureDependants>

       <FeatureDependant sid="DREQ" useRefObj=“False">

          <PathTopToSelected sids="4SPE;3VDA;ITFD;ITAP;ITFC;IDRE"/>

          <ExistsForPart sid=“10RE"/>

          <FunctionalDesignItem sid="BISG"/>

          <PathFunctionalDesignToSelected sids="ITAP;ITFC;IDRE"/>

       </FeatureDependant>

       </FeatureDependants>

  </VariabilityEditorConfig>

</Configs>


<TopItem sid="4BAS"/> specifies the type that contains both the artifact to connect to the feature model and the feature model.


<Configs>

  <VariabilityEditorConfig id="Unique identifier">

    <ViewSettings>

       <Caption>Variability editor</Caption>

       <RibbonGroup>Variability</RibbonGroup>

       <Description>Specify variability for item</Description>

    </ViewSettings>

    <TopItem sid="4BAS"/>

    <FeatureModelPath sid="/4SPE/10IFM"/>

    <FeatureItemType sid="10RF"/>

    <FeatureDependants>

       <FeatureDependant sid="DREQ" useRefObj=“False">

          <PathTopToSelected sids="4SPE;3VDA;ITFD;ITAP;ITFC;IDRE"/>

          <ExistsForPart sid=“10RE"/>

          <FunctionalDesignItem sid="BISG"/>

          <PathFunctionalDesignToSelected sids="ITAP;ITFC;IDRE"/>

       </FeatureDependant>

       </FeatureDependants>

  </VariabilityEditorConfig>

 </Configs>


<FeatureModelPath sid="/4SPE/10IFM"/> specifies how to reach the feature model from the <TopItem/>.


<Configs>

  <VariabilityEditorConfig id="Unique identifier">

    <ViewSettings>

       <Caption>Variability editor</Caption>

       <RibbonGroup>Variability</RibbonGroup>

       <Description>Specify variability for item</Description>

    </ViewSettings>

    <TopItem sid="4BAS"/>

    <FeatureModelPath sid="/4SPE/10IFM"/>

    <FeatureItemType sid="10RF"/>

    <FeatureDependants>

       <FeatureDependant sid="DREQ" useRefObj=“False">

          <PathTopToSelected sids="4SPE;3VDA;ITFD;ITAP;ITFC;IDRE"/>

          <ExistsForPart sid=“10RE"/>

          <FunctionalDesignItem sid="BISG"/>

          <PathFunctionalDesignToSelected sids="ITAP;ITFC;IDRE"/>

       </FeatureDependant>

       </FeatureDependants>

  </VariabilityEditorConfig>

</Configs>


<FeatureItemType sid="10RF"/> specifies the type of the feature.


<Configs>

  <VariabilityEditorConfig id="Unique identifier">

    <ViewSettings>

       <Caption>Variability editor</Caption>

       <RibbonGroup>Variability</RibbonGroup>

       <Description>Specify variability for item</Description>

    </ViewSettings>

    <TopItem sid="4BAS"/>

    <FeatureModelPath sid="/4SPE/10IFM"/>

    <FeatureItemType sid="10RF"/>

    <FeatureDependants>

       <FeatureDependant sid="DREQ" useRefObj=“False">

          <PathTopToSelected sids="4SPE;3VDA;ITFD;ITAP;ITFC;IDRE"/>

          <ExistsForPart sid=“10RE"/>

          <FunctionalDesignItem sid="BISG"/>

          <PathFunctionalDesignToSelected sids="ITAP;ITFC;IDRE"/>

       </FeatureDependant>

       </FeatureDependants>

  </VariabilityEditorConfig>

</Configs>


<FeatureDependants> specifies all artifacts that should be part of this variability editor configuration. Each configuration can contain several different artifacts.


<Configs>

  <VariabilityEditorConfig id="Unique identifier">

    <ViewSettings>

       <Caption>Variability editor</Caption>

       <RibbonGroup>Variability</RibbonGroup>

       <Description>Specify variability for item</Description>

    </ViewSettings>

    <TopItem sid="4BAS"/>

    <FeatureModelPath sid="/4SPE/10IFM"/>

    <FeatureItemType sid="10RF"/>

    <FeatureDependants>

       <FeatureDependant sid="DREQ" useRefObj=“False">

          <PathTopToSelected sids="4SPE;3VDA;ITFD;ITAP;ITFC;IDRE"/>

          <ExistsForPart sid=“10RE"/>

          <FunctionalDesignItem sid="BISG"/>

          <PathFunctionalDesignToSelected sids="ITAP;ITFC;IDRE"/>

       </FeatureDependant>

       </FeatureDependants>

  </VariabilityEditorConfig>

</Configs>


<FeatureDependant sid="DREQ" useRefObj=“False"> specifies the artifact that should be related to the feature model. useRefObj should always be “False”.


<Configs>

  <VariabilityEditorConfig id="Unique identifier">

    <ViewSettings>

       <Caption>Variability editor</Caption>

       <RibbonGroup>Variability</RibbonGroup>

       <Description>Specify variability for item</Description>

    </ViewSettings>

    <TopItem sid="4BAS"/>

    <FeatureModelPath sid="/4SPE/10IFM"/>

    <FeatureItemType sid="10RF"/>

    <FeatureDependants>

       <FeatureDependant sid="DREQ" useRefObj=“False">

          <PathTopToSelected sids="4SPE;3VDA;ITFD;ITAP;ITFC;IDRE"/>

          <ExistsForPart sid=“10RE"/>

          <FunctionalDesignItem sid="BISG"/>

          <PathFunctionalDesignToSelected sids="ITAP;ITFC;IDRE"/>

       </FeatureDependant>

       </FeatureDependants>

  </VariabilityEditorConfig>

</Configs>


<PathTopToSelected> is the path from the <TopItem/> to the artifact.


<Configs>

  <VariabilityEditorConfig id="Unique identifier">

    <ViewSettings>

       <Caption>Variability editor</Caption>

       <RibbonGroup>Variability</RibbonGroup>

       <Description>Specify variability for item</Description>

    </ViewSettings>

    <TopItem sid="4BAS"/>

    <FeatureModelPath sid="/4SPE/10IFM"/>

    <FeatureItemType sid="10RF"/>

    <FeatureDependants>

       <FeatureDependant sid="DREQ" useRefObj=“False">

         <PathTopToSelected sids="4SPE;3VDA;ITFD;ITAP;ITFC;IDRE"/>

          <ExistsForPart sid=“10RE"/>

          <FunctionalDesignItem sid="BISG"/>

          <PathFunctionalDesignToSelected sids="ITAP;ITFC;IDRE"/>

       </FeatureDependant>

       </FeatureDependants>

  </VariabilityEditorConfig>

</Configs>


<ExistsForPart/> is the part connecting the artifact to the feature model.



<Configs>

  <VariabilityEditorConfig id="Unique identifier">

    <ViewSettings>

       <Caption>Variability editor</Caption>

       <RibbonGroup>Variability</RibbonGroup>

       <Description>Specify variability for item</Description>

    </ViewSettings>

    <TopItem sid="4BAS"/>

    <FeatureModelPath sid="/4SPE/10IFM"/>

    <FeatureItemType sid="10RF"/>

    <FeatureDependants>

       <FeatureDependant sid="DREQ" useRefObj=“False">

          <PathTopToSelected sids="4SPE;3VDA;ITFD;ITAP;ITFC;IDRE"/>

          <ExistsForPart sid=“10RE"/>

          <FunctionalDesignItem sid="BISG"/>

          <PathFunctionalDesignToSelected sids="ITAP;ITFC;IDRE"/>

       </FeatureDependant>

       </FeatureDependants>

  </VariabilityEditorConfig>

</Configs>


<FunctionalDesignItem> specifies the type of a smaller context in which logic expressions connecting to the feature model can be reused.



<Configs>

  <VariabilityEditorConfig id="Unique identifier">

    <ViewSettings>

       <Caption>Variability editor</Caption>

       <RibbonGroup>Variability</RibbonGroup>

       <Description>Specify variability for item</Description>

    </ViewSettings>

    <TopItem sid="4BAS"/>

    <FeatureModelPath sid="/4SPE/10IFM"/>

    <FeatureItemType sid="10RF"/>

    <FeatureDependants>

       <FeatureDependant sid="DREQ" useRefObj=“False">

          <PathTopToSelected sids="4SPE;3VDA;ITFD;ITAP;ITFC;IDRE"/>

          <ExistsForPart sid=“10RE"/>

          <FunctionalDesignItem sid="BISG"/>

          <PathFunctionalDesignToSelected sids="ITAP;ITFC;IDRE"/>

       </FeatureDependant>

       </FeatureDependants>

  </VariabilityEditorConfig>

</Configs>


<PathFunctionalDesignToSelected/> specifies the path from <FunctionalDesignItem> to the artifact.


<Configs>

  <VariabilityEditorConfig id="Unique identifier">

    <ViewSettings>

       <Caption>Variability editor</Caption>

       <RibbonGroup>Variability</RibbonGroup>

       <Description>Specify variability for item</Description>

    </ViewSettings>

    <TopItem sid="4BAS"/>

    <FeatureModelPath sid="/4SPE/10IFM"/>

    <FeatureItemType sid="10RF"/>

    <FeatureDependants>

       <FeatureDependant sid="DREQ" useRefObj=“False">

          <PathTopToSelected sids="4SPE;3VDA;ITFD;ITAP;ITFC;IDRE"/>

          <ExistsForPart sid=“10RE"/>

          <FunctionalDesignItem sid="BISG"/>

          <PathFunctionalDesignToSelected sids="ITAP;ITFC;IDRE"/>

       </FeatureDependant>

       </FeatureDependants>

  </VariabilityEditorConfig>

</Configs>


The variability editor will be active on all types specified as a < FeatureDependant/>.



Right-click to create connection to feature model.



The result is that the conditions under which the artifact is applicable is specified in terms of features.




Test - Feature Model Meta Model

Connecting test cases to the feature model makes it possible to filter out test cases applicable for a specific product configuration when creating test executions.



Configuring Test to work with the feature model is done under Feature configuration in “Configure the Explorer”.




<TestConfig>

  <TestCaseVariantPartSIDs>ITXF;10VB</TestCaseVariantPartSIDs>

  <TestSystemVariantPartSID>10IFE</TestSystemVariantPartSID>

  <TestSystemVariantContainerPartSID>ITST</TestSystemVariantContainerPartSID>    

  <TestSpecificationVariantPartSID>TSVA</TestSpecificationVariantPartSID>

</TestConfig>


The configuration specifies what is noted in the meta model pictures previously.

<TestCaseVariantPartSIDs> specifies all parts needed to find features from a Test case.


<TestConfig>

  <TestCaseVariantPartSIDs>ITXF;10VB</TestCaseVariantPartSIDs>

  <TestSystemVariantPartSID>10IFE</TestSystemVariantPartSID>

  <TestSystemVariantContainerPartSID>ITST</TestSystemVariantContainerPartSID>    

  <TestSpecificationVariantPartSID>TSVA</TestSpecificationVariantPartSID>

</TestConfig>


Since Test is performed on a product configuration and test cases are related to features, a variant containing all test cases relevant for this configuration can be created.


Create Test



Script Language

The feature model can be used in the script language to filter out a configuration valid for a product configuration.

Next is a function that can be used to implement this filtering function. 

Call the function on an artifact that should be filtered with these parameters. 

  • <Parameter name="featureSet" as="Items"/>
    • A variable containing all features in the product that should be used as filter.
  • <Parameter name="useFeature" as="Boolean"/>
    • A Boolean – shows the superset if false, filters if true.
  • <Parameter name="variant" as="Items"/>
    • The variant condition on the artifact that should be filtered.
    • For the design requirements the call would look like VariantFilter($SelectedFeatures, $Switch,/10RE).


 <Function name="VariantFilter" as="Boolean">

    <Parameter name="featureSet" as="Items"/>

    <Parameter name="useFeature" as="Boolean"/>

    <Parameter name="variant" as="Items"/>

   <Choose>

    <When test=“not $useFeature">

        <Value select="true"/>

    </When>

    <When test="$useFeature">

   <Choose>                             

      <When test="not Type.SID = '10AN' and not Type.SID = '10OR' and not Type.SID = '10RF' and not Type.SID = '10PC'">

        <Value select="not($variant) or any $variant satisfies VariantFilter($featureSet, $useFeature, [])"/>

      </When>

      <When test="Type.SID = '10AN'">

        <Value select="all /10VB satisfy VariantFilter($featureSet, $useFeature, [])"/>

      </When>

      <When test="Type.SID = '10OR'">

        <Value select="any /10VB satisfies VariantFilter($featureSet, $useFeature, [])"/>

      </When>

      <When test="Type.SID = '10RF' or Type.SID = '10PC'">

        <Value select=". in $featureSet"/>

      </When>

      <Otherwise>

        <Value select="true"/>

      </Otherwise>

    </Choose>

    </When>

    <Otherwise>

        <Value select="true"/>

    </Otherwise>

   </Choose>

  </Function>