Use of stereotypes
Stereotypes test the extension mechanism that turns UML into SysML and lets you add domain attributes. Expect questions on the stereotype-to-metaclass relationship, on tagged values, and on applying and querying stereotypes through profiles.
What a stereotype is
A stereotype is a UML Class with «stereotype» that extends one or more metaclasses through an Extension. It adds properties (historically called tagged values) and constraints to the elements it extends. It does not create a new metaclass and cannot change the base element's structural category.
Profiles
Stereotypes are packaged in a «profile», which is applied to a model before its stereotypes can be used. A missing profile application is the usual reason a stereotype will not resolve in a tool.
SysML stereotypes
SysML is itself a UML profile. The stereotypes you meet most are «block», «requirement», «valueType», «constraint», «interfaceBlock», «actor», «useCase», «testCase», «proxyPort», «fullPort», «flowPort», «itemFlow» and «allocate». Knowing which metaclass each extends is a reliable exam discriminator.
Syntax
Applied stereotypes appear in guillemets above the element name, for example «block» FlightController. Stereotype properties appear in a compartment or as tagged values. Stereotypes may generalize other stereotypes to share properties.
Worked example
A safety profile defines SafetyCritical, extending the metaclass Class, with property dal : String. Applying it to FlightController alongside «block» yields «block», «SafetyCritical» with dal = A. A query for all classes with dal = A now returns the flight controller, because the attribute is structured model data rather than a note.
Traps
Confusing a stereotype with a metaclass, forgetting to apply the profile, recording domain attributes in comments instead of stereotype properties, assuming a stereotype can change the base element's metaclass, and stacking conflicting stereotypes on one element.