Contents > 8 Defining Custom Design Metrics and Rules

8 Defining Custom Design Metrics and Rules

With SDMetrics, you are not restricted to a fixed set of metrics. Using the SDMetricsML, the SDMetrics Markup Language, you can define and calculate your own metrics and design rules.

The SDMetricsML is based on the XML. The metric definition file is an XML file of the following format (for a formal definition of the file format, see Appendix E: "Project File Format Definitions"):

<sdmetrics version="2.3" ruleexemption="taggedvalue"
  exemptiontag="tagname" >
  <metric name="met1" ...> 
   <'metric definition' ...>
  <set ... name="set1" ...>
   <'set definition' ...>
  <metric name="met2" ...> 
   <'metric definition' ... >
  <matrix name="matrix1" ...> 
   <'matrix definition' ... >
  <rule name="rule1" ...> 
   <'rule definition' ... >
  <wordlist name="list1" ...> 
   <'wordlist definition' ... >
  <reference tag="ref1"> 
   bibliographic citation #1
  <term name="term1"> 
   definition of term

The "version" attribute (required) of the root element sdmetrics indicates the version number of the oldest version of SDMetrics with which the metric definition file can be used. The remaining two attributes instruct the design rule checker how to access tagged values, this will be discussed later (Section 8.3.6 "Exempting Approved Rule Violations").

The file contains a list of definitions of metrics, as well as sets (sets of UML elements, sets of values), design rules and word lists (see Section 4.7 "The View 'Rule Checker'"), relation matrices (see Section 4.10 "The View 'Relation Matrices'"), literature reference and glossary terms. The following sections describe the definition of metrics, sets, rules, and relation matrices in detail.

8.1 Definition of Metrics
8.2 Definition of Sets
8.3 Definition of Design Rules
8.4 Definition of Relation Matrices
8.5 Expression Terms
8.6 Writing Descriptions
8.7 Defining Metrics for Profiles