An Au oma ed App oach o Ve i ica ion o So wa e
Requi emen s?
Amado Du án, An onio Ruiz, and Miguel To o
Depa amen o de Lenguajes y Sis emas In o má icos, Facul ad de In o má ica y Es adís ica,
Uni e sidad de Se illa, A da. Reina Me cedes s/n, 41012 Se illa, España
{amado ,a uiz,m o o}@lsi.us.es
Abs ac In his pape , we p esen an au oma ed app oach o he e i ica ion o
so wa e equi emen s. This app oach is based on he ep esen a ion o so wa e
equi emen s in XML and he usage o he XSLT language o au oma ically e i y
some desi ed quali y p ope ies. These ideas ha e been implemen ed in REM, an
expe imen al equi emen s managemen ool ha is also desc ibed in his pape .
1 In oduc ion
Pa aph asing Boehm [5], equi emen s alida ion and e i ica ion can be in o mally
de ined by he ques ions "Am I building he igh equi emen s?" ( alida ion) and "Am
I building he equi emen s igh ?" ( e i ica ion).
In o he wo ds, he goal o equi emen s alida ion is o ensu e ha equi emen s
documen s con ain ac ual equi emen s and ha hese equi emen s a e all he known
equi emen s by he ime he equi emen s documen s a e baselined.
On he o he hand, he goal o equi emen s e i ica ion is o ensu e he quali y o
equi emen s acco ding o desi ed quali y p ope ies. Some o hese quali y p ope ies
ha e o do wi h equi emen s seman ics bu o he s ha e o do wi h syn ac ic, s uc u al
o p agma ic aspec s o equi emen s (see [12] o a comple e classi ica ion o quali y
p ope ies o equi emen s).
Ve i ica ion o seman ic p ope ies o equi emen s is closely ela ed o equi e-
men s alida ion (dis inc ion be ween equi emen s e i ica ion o seman ic p ope ies
and equi emen s alida ion is some imes sub le and many au ho s use bo h e ms in-
e changeably) and equi es human pa icipa ion, whe eas e i ica ion o non–seman ic
p ope ies should be as au oma ed as possible.
In his a icle, we p esen an au oma ed app oach o he e i ica ion o some quali y
p ope ies o equi emen s. Mos o hese p ope ies can be classi ied as non–seman ic,
bu we ha e also de eloped some heu is ics o check po en ial p oblems wi h some
seman ic p ope ies. Ou app oach is based on he eme gen echnology buil a ound
XML [4] and i s companion language XSLT [3].
The es o he a icle is o ganized as ollows. Fi s , we b ie ly desc ibe he basics o
XML and XSLT needed o unde s and he ollowing sec ions. Then, we desc ibe REM,
?This wo k is pa ially unded by he Spanish CICYT p ojec GEOZOCO TIC 2000–1106–
C02–01 and by he in e na ional CYTED p ojec WEST.
an expe imen al equi emen s managemen ool [8, 9], he XML model o equi emen s
used by REM and how XSLT can be used o e i y some quali y p ope ies o equi e-
men s exp essed in XML. Finally, we discuss some ela ed wo k, p esen some esul s
and poin ou u u e wo k.
2 XML and XSLT
2.1 XML Basics
The e a e millions o web pages w i en in HTML a ailable in In e ne . In hese web
pages, pu e in o ma ion is mixed wi h o ma ing elemen s, making he au oma ic p o-
cessing o in o ma ion e y di icul . XML [4] is a language designed o ep esen ing
pu e in o ma ion in In e ne . In o ma ion in XML is ep esen ed by elemen s. An XML
elemen is made up o a s a ag, an end ag, and o he ags o da a in be ween. Fo
example, o ep esen ing he in o ma ion abou a book, we migh ha e he ollowing
XML elemen named book:
<book isbn="1-234-56789-0">
<au ho >Miguel de Ce an es</au ho >
< i le>El Quijo e</ i le>
</book>
As you can see, he in o ma ion abou a book is be ween he <book> and </book>
ags and i is easy o pa se by a compu e p og am. The au ho and i le elemen s
a e conside ed as child en o he book elemen , hus o ming a hie a chy. An XML
documen mus always ha e one and only one oo elemen a he op o i s hie a chy.
In o de o allow in o ma ion in e change be ween wo o mo e pa ies using XML,
hey mus ag ee abou elemen g amma and seman ics. Elemen g amma is speci ied
as egula exp essions in DTDs (Documen Type De ini ions) [4]. Fo example, he
DTD agmen o he p e ious XML da a would be he ollowing:
<!ELEMENT book (au ho +, i le)>
<!ATTLIST book isbn ID #REQUIRED>
<!ELEMENT au ho (#PCDATA)>
<!ELEMENT i le (#PCDATA)>
whe e i is s a ed ha a book elemen can con ain one o mo e au ho elemen s and
only one i le elemen . An XML elemen can also ha e a ibu es. Fo example, isbn is
de ined as a equi ed iden i ica ion a ibu e o book,i.e. he e canno exis wo books
wi h he same alue o he isbn a ibu e in he same XML documen . Those elemen s
ha con ain only ex a e said o con ain #PCDATA, ha s ands o pa sed cha ac e
da a.
2.2 T ans o ming XML
The e a e many si ua ions in which XML da a need o be ans o med. Fo example,
o p esen ing XML da a as an HTML page. XSLT [3] is a language based on ans-
o ma ion pa e ns. An XSLT s yleshee , which is also a an XML documen , sea ches
o pa e ns in he XML da a and applies p og ammed ans o ma ions, hus gene a ing
some ou pu esul s. Fo example, i we wan ed o show in o ma ion abou books in a
web b owse , we could apply he ollowing XSLT ans o ma ion ule:
<xsl: empla e ma ch="book">
<B><xsl: alue-o selec =" i le"/></B>
(ISBN <xsl: alue-o selec ="@isbn"/>)
was w i en by
<EM><xsl: alue-o selec ="au ho [1]"/></EM>
</xsl: empla e>
The in o mal seman ics o his XSLT ule a e "when you ind a book elemen , gene a e
i s i le in bold ace, hen i s ISBN a ibu e (no ice he @ p e ix o a ibu es), and hen
i s i s au ho in emphasized mode". In he XSLT code, ex li e als like HTML ags
can be mixed wi h elemen alues, which a e ob ained by means o he xsl: alue-o
s a emen . I we applied his XSLT ule o he p e ious XML da a, he esul o he
ans o ma ion would be some hing like his when ende ed in a web b owse :
El Quijo e (ISBN 1-234-56789-0) was w i en by Miguel de Ce an es
Al hough he e a e many mo e de ails abou XML and XSLT, we hink ha his b ie
in oduc ion should be enough o hose eade s no amilia wi h XML echnologies in
o de o unde s and he es o his a icle.
3REM: An XML–based Requi emen s Managemen Tool
REM (REqui emen s Manage ) is an expe imen al equi emen s managemen ool de-
eloped by one o he au ho s [8, 9]. In REM, a equi emen s enginee ing (RE) p ojec
is conside ed o be composed by h ee documen s:
1. a cus ome –o ien ed equi emen s documen ( he equi emen s documen [13]),
usually con aining equi emen s in na u al language exp essed in e ms o cus-
ome ’s ocabula y, also known as C– equi emen s [7].
2. a de elope –o ien ed equi emen s documen ( he speci ica ion documen [13]),
usuallycon aining equi emen smodelsandmo e echnicalin o ma ion,alsocalled
D– equi emen s [7].
3. a egis y o de ec ed con lic s and nego ia ion suppo .
In REM, C– equi emen s and con lic s a e exp essed in na u al language using p e-
de ined equi emen s empla es and some linguis ic pa e ns (see [9] o de ails). Fo
exp essing D– equi emen s, we ha e chosen a subse o he UML [6]
3.1 REM A chi ec u e
REM documen s, i.e. RE p ojec s composed by he h ee documen s p e iously de-
sc ibed, a e s o ed in ela ional ligh –weigh da abases. When he use c ea es a new
REM documen , he basic s uc u e is aken om a REM base documen (see igu e 1),
¢
¢
¡¢
Figu e1. REM A chi ec u e
ha can be emp y o can con ain he manda o y sec ions o so wa e equi emen s s an-
da ds like [1] o [15]. Any o dina y REM documen can be selec ed as a base documen ,
so use s can c ea e hei own base documen s o euse o he REM documen s.
In o de o p o ide immedia e eedback on use ac ions, REM gene a es XML da a
co esponding o he documen being edi ed, applies an ex e nal XSLT s yleshee ha
ans o ms XML da a in o HTML and shows he esul ing HTML o he use . In his
way, whene e he use changes a equi emen s documen , he o she can see he e ec s
immedia ely.
In he same way he REM base documen can be cus omized, he use can also
changedocumen appea ancebyselec ingo c ea ingdi e en ex e nalXSTLs yleshee s.
The de aul XSLT s yleshee gene a es a highly hype linked documen , making na iga-
ion o equi emen s documen s easie (see igh side o igu e 2).
O he con igu able aspec o REM is he language o he use in e ace. The use
can choose i by selec ing an ex e nal esou ce dynamic link lib a y (DLL). A his
momen s, we ha e de eloped wo ex e nal esou ce DLLs o REM, one in Spanish
and one in English.
3.2 REM Use In e ace
The use in e ace o REM p esen s wo di e en iews o he use (see igu e 2). On
he le , he use can see a abbed iew wi h h ee ee iews, one o each equi emen s
documen in he RE p ojec . On he igh hand, he esul o he XSLT ans o ma ion
o he XML da a is p esen ed o he use in a embedded web b owse .
In any o he h ee ee iews, he use can di ec ly manipula e objec s by d ag and
d op o by con ex menus. Only ac ions ha ha e sense can be pe o med, ollowing
¡
¡
Figu e2. REM Use In e ace
aco ec –by–cons uc ion app oach, hus inc easing quali y and a oiding e i ica ion
e o .
Fo example, ac ions o use case s eps can be o h ee di e en classes (see igu e
4): ac o ac ion, i he ac ion is pe o med by an ac o ; sys em ac ion i he ac ion is
pe o med by he sys em, o use case ac ion, i he ac ion consis s o pe o ming o he
use case, i.e. an use case inclusion o ex ension [6]. Ac o ac ions and use case ac ions
can be c ea ed only i some ac o o some use case ha e been p e iously c ea ed. In
gene al, objec s can be c ea ed by using con ex menus on po en ial pa en s o by using
he c ea ion oolba .
4 XML Model o Requi emen s in REM
REM is based on an UML [6] model o equi emen s (a pa ial iew o his model is
shown in igu e 4). The main objec class o he model is he Requi emen s Documen ,
ha is composed by a sequence o REM objec s (see igu e 3).
We ha e ansla ed ou UML model o equi emen s in o a ela ional schema and
in o a DTD. As an example, he UseCase class in igu e 4 has been ansla ed in o he
ollowing DTD elemen de ini ion:
<!ELEMENT em:useCase (
em:name, em: e sion, em:au ho s?, em:sou ces?, em:commen s?,
em:impo ance, em:u gency, em:s a us, em:s abili y,
em:isAbs ac ?, em: igge ingE en ,
em:p econdi ion, em:pos condi ion,
em: equency, em:s ep* )>
<!ATTLIST em:useCase oid ID #REQUIRED>
REM objec
C-Requi emen
D-Requi emen
Con lic
Sec ion/appendix
Pa ag aph/glossa y i em
Ex e nal g aphic ile
S akeholde s- ela ed objec
S akeholde
O ganiza ion
Mee ing
Objec i e
In o ma ion s o age equi emen
Cons ain equi emen
Func ional equi emen (use case)
Non unc ional equi emen
Ac o
T aceabili y ma ix
Objec ype
Value ype
Associa ion ype
Sys em ope a ion
Figu e3. Classi ica ion o objec s in REM
Manyo heelemen s in he p e iousDTD agmen (commen s, igge ingEe en ,
p e and pos condi ion), con ains only ex , i.e. na u al language. In REM, ex can be
composed by any combina ion o ee ex , e e ences o o he objec s and TBD (To Be
De e mined) ma ks, de ined as ollows:
<!ELEMENT em: ex (#PCDATA| em: e | em: bd)*>
<!ELEMENT em: e (#PCDATA)>
<!ATTLIST em: e oid IDREF #REQUIRED>
<!ELEMENT em: bd EMPTY>
whe e he em: e elemen mus ha e a equi ed a ibu e called oid ha i is decla ed
as an IDREF,i.e. a e e ence o o he elemen wi h a ma ching iden i ica ion a ibu e
alue. An IDREF a ibu e is e y simila o a o eign key in ela ional da abases.
The em: bd elemen is decla ed as an EMPTY elemen , i.e. i canno ha e nei he
subo dina e elemen s no da a. I is simply a ma k.
The DTD elemen s co esponding o use case s eps and ac ions o igu e 4 ha e
been desc ibed as ollows:
<!ELEMENT em:s ep (
em:numbe , em:condi ion?,
( em:sys emAc ion | em:ac o Ac ion | em:useCaseAc ion ),
( em:s epExcep ion*),
em:commen s )>
<!ATTLIST em:s ep oid ID #REQUIRED>
name
e sion
commen s
REMObjec
impo ance
u gency
s a us
s abili y
C-Requi emen
isAbs ac
igge ingE en
p econdi ion
pos condi ion
equency
UseCase S ep
*
{o de ed}
0..1 desc ip ion
Condi ion
*
desc ip ion
e mina ion
Excep ion
Ac ion
1..1 1..1
desc ip ion
Ac o Ac ion
desc ip ion
pe o mance
Sys emAc ion
{disjoin }
Ac o
UseCaseAc ion
*
*
1..1
1..1
...
...
{disjoin }
{disjoin }
S akeholde
T ace
*
sou ces
*
au ho s
sou ce
1..1
1..1 a ge
Figu e4. UML model o use cases in REM
<!ELEMENT em:sys emAc ion (
em:desc ip ion, em:pe o mance? )>
<!ELEMENT em:ac o Ac ion ( em:desc ip ion)>
<!ATTLIST em:ac o Ac ion ac o IDREF #REQUIRED>
<!ELEMENT em:useCaseAc ion EMPTY>
<!ATTLIST em:useCaseAc ion useCase IDREF #REQUIRED>
<!ELEMENT em:s epExcep ion (
em:condi ion,
( em:sys emAc ion | em:ac o Ac ion | em:useCaseAc ion ),
em: e mina ion,
em:commen s )>
<!ATTLIST em:s epExcep ion oid ID #REQUIRED>
Elemen s no de ined in he p e ious DTD code (condi ion,desc ip ion, e mina-
ion, e c.) a e de ined as con aining only ex . Fo example:
<!ELEMENT em:condi ion (#PCDATA| em: e | em: bd)*>
5 Using XSLT as a Requi emen s Ve i ica ion Language
In he ollowing sec ions we desc ibe how some o he quali y ac o s desc ibed in [10]
can be au oma ically e i ied using XSLT when equi emen s a e elec onically s o ed
in XML o ma acco ding o he REM DTD.
5.1 Unambigui y
A equi emen is unambiguous i and only i has only one possible in e p e a ion [1].
This is ob iously a seman ic p ope y o a equi emen and canno be e i ied au o-
ma ically, bu we can gi e some hin s abou po en ial ambigui ies in a equi emen s
documen .
We ag ee wi h Lei e [11] in he impo ance o unde s anding he language o he
p oblem and in he impo ance o building a glossa y (called Language Ex ended Lex-
icon, LEL, in [11]). Following Lei e, he glossa y should ollow wo p inciples: he
p inciple o ci cula i y, ( he glossa y mus be as sel –con ained as possible) and he
p inciple o minimal ocabula y (use as much glossa y i ems as possible in you e-
qui emen s desc ip ions). Lei e’s p inciples canno gua an ee unambigui y, bu hey can
help o build unambiguous, unde s andable, e i iable, consis en , concise, and c oss–
e e enced equi emen s [10].
XSLT can be used o measu e glossa y ci cula i y (GLC) and minimali y o ocab-
ula y (MOV). GLC can be measu ed as he a io be ween glossa y i ems and e e ences
o glossa y i ems om o he glossa y i ems. The ollowing XSLT code, whe e we ha e
decla ed wo a iables o he sake o eadabili y, can be used o his pu pose:
<xsl: a iable name="GLO"
selec ="coun (// em:glossa yI em)"/>
<xsl: a iable name="REF"
selec ="coun (// em:glossa yI em// em: e )"/>
<xsl: alue-o
selec =" o ma -numbe ($REF di $GLO, ’#0.00’)"/>
whe e he exp ession // em:glossa yI em is an XPa h exp ession [2] meaning "any
em:glossa yI emelemen descendan o he oo ", whe eas he exp ession// em:glos-
sa yI em// em: e means "any em: e elemen descendan o any em:glossa yI em
descendan o he oo ". In XPa h, he language o building na iga ion exp essions o e
XML ees, an elemen is conside ed as descendan o o he elemen i i is i s child a
any le el o dep h in he hie a chy.
A simila a io be ween he numbe o e e ences o glossa y i ems in equi emen s
and he numbe o equi emen s can be used o measu e MOV. F om he MOV iew-
poin , i is also possible o de ec hose "suspicious" equi emen s ha do no ha e any
e e ence o any glossa y i em in hei ex . Since hose equi emen s a e no using he
ocabula y o he cus ome , hey should be checked o po en ial p oblems o ambi-
gui y o unde s andabili y [10]. Fo example, i we wan o know wha use cases a e
"suspicious", we can use he ollowing XSLT code:
<xsl: empla e ma ch=" em:useCase[no (.// em: e )]"/>
Use case
<xsl: alue-o selec =" em:name"/>
does no use any glossa y i em
</xsl: empla e>
whe e he ma ch exp ession uses b acke s o selec only hose use cases wi h no de-
scendan e e ences. Ano he possibili y is o de e mine a h eshold alue o he num-
be o e e ences pe equi emen and conside as suspicious all equi emen s wi h a
numbe o e e ences unde he h eshold. In ha case, he ma ch exp ession would be
em:useCase[coun (.// em: e ) < m], wi h mbeing he MOV h eshold.
5.2 Comple eness
A equi emen s documen is comple e i i includes [10]:
1. E e y hing ha he so wa e is supposed o do, i.e. all he equi emen s
2. Responses o he so wa e o all classes o inpu da a in all ealizable si ua ions
3. Page numbe s, igu e and able names and e e ences, a glossa y, uni s o measu e
and e e enced ma e ial
4. No sec ions ma ked as TBD
In ou app oach, he hi d comple eness condi ion is pa ially sa is ied by means o
he co ec –by–cons uc ion pa adigm o REM: igu e and able names a e au oma -
ically gene a ed, e e ences a e au oma ically inse ed and upda ed, and he use can
easily c ea e a glossa y. I we wan o be su e abou he exis ence o a sec ion named
Glossa y, we can apply he ollowing XSLT code:
<xsl:choose>
<xsl:when es ="// em:sec ion[ em:name=’Glossa y’]"/>
The e is a glossa y
</xsl:when>
<xsl:o he wise>
The e is no glossa y
</xsl:o he wise>
</xsl:choose>
whe e he s uc u e o med by xsl:choose,xsl:when and xsl:o he wise is basically an
i –else–endi s a emen wi h mul iple else b anches. No ice ha i we wan o check
he exis ence o an elemen we canno use an XSLT empla e. I he e is no such an
elemen , he empla e will ne e ma ch and we will ha e no ou pu .
Simila XSLT code can be used o e i y i equi emen s documen s a e o ganized
[10], i.e. i hey ha e manda o y sec ions in he manda o y o de wi h manda o y con-
en .