Assignment #2: Creating Feature Models

Due Wednesday, February 13, 8pm

Part 1. This is a continuation of your first assignment.  Do the following:

  1. Read the AHEAD Tool Suite Documentation on the guidsl feature modeling tool and the safegen analysis tool. You will use guidsl and safegen in this assigment.

  2. Modify your FOP design so you have at least 10 features.  Some of you already have this and more.  If so, you're done.  If not, decompose your "big" features into "featurettes".

    Note: You will see that decomposing to smaller and smaller features is not "ideal", but the point of this assignment is to have you see clear dependencies between features and that you capture these dependencies using design rules.

  3. Add a new feature, such as word count.  This counts the number of words in a document, and displays the result via a dialog (see Dialog note at end of this assignment).

  4. Define a guidsl feature model for your FOP model.  Sentences of the feature model's grammar define the set of legal compositions of features.  (It is possible that not all sentences will be semantically legal, and in fact, you should expect this).  The grammar will help in identifying the composition rules for your model. Explain how you tested your model for its correctness.

  5. guidsl offers a "model checking" tool that checks for model inconsistencies, i.e., errors in model specifications.  Use the exhaustive search option to validate your model.  If your model has more than, say 25, features, it is very likely that you will be able only to partially analyze your model.  Please report any findings, particularly if you initially had model inconsistencies. 

  6. Follow the instructions on using safegen to compile your features separately, and run the safegen tool to ensure that all programs in your product line are type correct.  Please report any findings, particularly if you found errors.

Part 2.  Comment on your experiences: what is easy, what isn't?  What could be improved?  What did you expect to find (but didn't), etc.  Also comment on the following statements. Think about why the statement may or may not be true.

  1. Decomposing a program into features is an iterative and trial-and-error process. Many times, you have revise previously defined features, which can entail drastic code changes and can be error-prone.

  2. Unlike OOP, FOP requires a programmer to be very careful in writing code so as not to impose unnecessary and implicit ordering/dependency. In OOP, the inheritance hierarchy is clear, while in FOP, the composition hierarchy is variable.

  3. FOP is a double-edge sword. As a program is decomposed into many smaller features, the ability to understand the program as a whole diminishes.

  4. Feature decomposed software is easier to understand and thus easier to maintain than non-feature based software.

Swing Dialogs

Java Swing has several GUI dialogs, such as:

which is produced by a call to the following method:

import javax.swing.*;

JOptionPane.showMessageDialog( null, "this is my message" );