Measuring and Improving the Completeness of Natural ...

27
Measuring and Improving the Completeness of Natural Language Requirements Alessio Ferrari 1 Felice dell’Orletta 2 Giorgio O. Spagnolo 1 Stefania Gnesi 1 1 ISTI-CNR (Formal Methods and Tools Lab), Pisa, Italy http://fmt.isti.cnr.it 2 ILC-CNR (ItaliaNLP Lab), Pisa, Italy http://www.italianlp.it April 8, 2014 A. Ferrari, et al. (ISTI-CNR) Requirements Documents Completeness 1 / 27

Transcript of Measuring and Improving the Completeness of Natural ...

Page 1: Measuring and Improving the Completeness of Natural ...

Measuring and Improving the Completenessof Natural Language Requirements

Alessio Ferrari1 Felice dell’Orletta2

Giorgio O. Spagnolo1 Stefania Gnesi1

1ISTI-CNR (Formal Methods and Tools Lab), Pisa, Italyhttp://fmt.isti.cnr.it

2ILC-CNR (ItaliaNLP Lab), Pisa, Italyhttp://www.italianlp.it

April 8, 2014

A. Ferrari, et al. (ISTI-CNR) Requirements Documents Completeness 1 / 27

Page 2: Measuring and Improving the Completeness of Natural ...

What is Completeness of a SRS?

CompletenessAn SRS is complete if nothing is missing from the specification

Nothing is missing with respect to WHAT?Different perspectives shall be considered...

A. Ferrari, et al. (ISTI-CNR) Requirements Documents Completeness 2 / 27

Page 3: Measuring and Improving the Completeness of Natural ...

Internal and Forward Completeness

Internal completenessNothing is missing with respect to the specification itself

No To-be-determined (TBD) itemsNo nonexistent references

Requires guidelines or templates

Forward completenessNothing is missing with respect to the system-to-be

No missing specification items (e.g., missing interfacespecifications)No missing functionsNo missing products (i.e., part of the actual software that are notmentioned in the specification)

Requires a model of the system

A. Ferrari, et al. (ISTI-CNR) Requirements Documents Completeness 3 / 27

Page 4: Measuring and Improving the Completeness of Natural ...

Backward Completeness

Backward CompletenessNothing is missing with respect to what comes before the SRS

What comes before the SRS?Transcripts of meeting with customersPreliminary specification documentsReference standardsLegacy documents

A. Ferrari, et al. (ISTI-CNR) Requirements Documents Completeness 4 / 27

Page 5: Measuring and Improving the Completeness of Natural ...

Research Questions

RQ1. How to measure the backward completeness of arequirements specification document?RQ2. How to improve the backward completeness of arequirements specification document?RQ3. Does the backward completeness help in improving theforward completeness of the specification?

A. Ferrari, et al. (ISTI-CNR) Requirements Documents Completeness 5 / 27

Page 6: Measuring and Improving the Completeness of Natural ...

Measuring Completeness

A. Ferrari, et al. (ISTI-CNR) Requirements Documents Completeness 6 / 27

Page 7: Measuring and Improving the Completeness of Natural ...

Defining complete requirements for a rock band

 Rock’n  Roll  

 In  the  earliest  rock  and  roll  styles  of  the  late  1940s  and  early  1950s,  either  the  PIANO  or  saxophone  was  o;en  the  lead  instrument,  but  these  were  generally  replaced  or  supplemented  by  GUITAR  in  the  middle  to  late  1950s.  The  BEAT  is  essenFally  a  BLUES  RITHM  with  an  accentuated  BACKBEAT,  the  laGer  almost  always  provided  by  a  snare  drum.  Classic  rock  and  roll  is  usually  played  with  one  or  two  ELECTRIC  GUITARS  (one  lead,  one  rhythm),  a  string  bass  or  (a;er  the  mid-­‐1950s)  an  ELECTRIC  BASS  GUITAR,  and  a  DRUM  KIT.  

Requirements  for  My  Band    •  My  Band  shall  have  ELECTRIC  GUITARS  •  The  BEAT  of  my  band  shall  be  a  BLUES  RITHM    •  My  band  shall  have  an  ELECTRIC  BASS  GUITAR  •  My  band  shall  have  a  DRUM  KIT  •  The  ELECTRIC  GUITARS  shall  play  with  an  

ELECTRIC  BASS  GUITAR  and  a  DRUM  KIT  

A. Ferrari, et al. (ISTI-CNR) Requirements Documents Completeness 7 / 27

Page 8: Measuring and Improving the Completeness of Natural ...

Backward Completeness

Backward CompletenessAll the relevant concepts and interactions among conceptsexpressed in the input documents are also treated in the requirements

We distinguish between:Concept CompletenessInteraction Completeness

A. Ferrari, et al. (ISTI-CNR) Requirements Documents Completeness 8 / 27

Page 9: Measuring and Improving the Completeness of Natural ...

Concept Completeness

Relevant TermsRelevant concepts can be approximated with the relevant terms ofthe input documentsA term is a single word (e.g., “guitar”) or a multi-word term (“rockand roll”)

A. Ferrari, et al. (ISTI-CNR) Requirements Documents Completeness 9 / 27

Page 10: Measuring and Improving the Completeness of Natural ...

Concept Completeness

 Rock’n  Roll  

 In  the  earliest  rock  and  roll  styles  of  the  late  1940s  and  early  1950s,  either  the  PIANO  or  saxophone  was  o;en  the  lead  instrument,  but  these  were  generally  replaced  or  supplemented  by  GUITAR  in  the  middle  to  late  1950s.  The  BEAT  is  essenFally  a  BLUES  RITHM  with  an  accentuated  BACKBEAT,  the  laGer  almost  always  provided  by  a  snare  drum.  Classic  rock  and  roll  is  usually  played  with  one  or  two  ELECTRIC  GUITARS  (one  lead,  one  rhythm),  a  string  bass  or  (a;er  the  mid-­‐1950s)  an  ELECTRIC  BASS  GUITAR,  and  a  DRUM  KIT.  

Requirements  for  My  Band    •  My  Band  shall  have  ELECTRIC  GUITARS  •  The  BEAT  of  my  band  shall  be  a  BLUES  RITHM    •  My  band  shall  have  an  ELECTRIC  BASS  GUITAR  •  My  band  shall  have  a  DRUM  KIT  •  The  ELECTRIC  GUITARS  shall  play  with  an  

ELECTRIC  BASS  GUITAR  and  a  DRUM  KIT  

degCC  =  TERMS  in  Requirements  

TERMS  in  Input  Docs  =    

5  

8  =  0.6    

A. Ferrari, et al. (ISTI-CNR) Requirements Documents Completeness 10 / 27

Page 11: Measuring and Improving the Completeness of Natural ...

Concept Completeness

 Rock’n  Roll  

 In  the  earliest  rock  and  roll  styles  of  the  late  1940s  and  early  1950s,  either  the  PIANO  or  saxophone  was  o;en  the  lead  instrument,  but  these  were  generally  replaced  or  supplemented  by  GUITAR  in  the  middle  to  late  1950s.  The  BEAT  is  essenFally  a  BLUES  RITHM  with  an  accentuated  BACKBEAT,  the  laGer  almost  always  provided  by  a  snare  drum.  Classic  rock  and  roll  is  usually  played  with  one  or  two  ELECTRIC  GUITARS  (one  lead,  one  rhythm),  a  string  bass  or  (a;er  the  mid-­‐1950s)  an  ELECTRIC  BASS  GUITAR,  and  a  DRUM  KIT.  

Requirements  for  My  Band    •  My  Band  shall  have  ELECTRIC  GUITARS  •  The  BEAT  of  my  band  shall  be  a  BLUES  RITHM    •  My  band  shall  have  an  ELECTRIC  BASS  GUITAR  •  My  band  shall  have  a  DRUM  KIT  •  The  ELECTRIC  GUITARS  shall  play  with  an  

ELECTRIC  BASS  GUITAR  and  a  DRUM  KIT  

degCC  =  TERMS  in  Requirements  

TERMS  in  Input  Docs  =    

5  

8  =  0.6    

The  PIANO!  

A. Ferrari, et al. (ISTI-CNR) Requirements Documents Completeness 11 / 27

Page 12: Measuring and Improving the Completeness of Natural ...

Iteraction Completeness

Relevant Relations among TermsRelevant interactions can be approximated with relevantrelations among termsPairs of relevant terms that occur in the same sentence of theinput documents form a relevant relationGUITAR is normally a lead instrument in ROCK AND ROLL

A. Ferrari, et al. (ISTI-CNR) Requirements Documents Completeness 12 / 27

Page 13: Measuring and Improving the Completeness of Natural ...

Interaction Completeness

 Rock’n  Roll  

 In  the  earliest  rock  and  roll  styles  of  the  late  1940s  and  early  1950s,  either  the  PIANO  or  saxophone  was  o;en  the  lead  instrument,  but  these  were  generally  replaced  or  supplemented  by  GUITAR  in  the  middle  to  late  1950s.  The  BEAT  is  essenFally  a  BLUES  RITHM  with  an  accentuated  BACKBEAT,  the  laGer  almost  always  provided  by  a  snare  drum.  Classic  rock  and  roll  is  usually  played  with  one  or  two  ELECTRIC  GUITARS  (one  lead,  one  rhythm),  a  string  bass  or  (a;er  the  mid-­‐1950s)  an  ELECTRIC  BASS  GUITAR,  and  a  DRUM  KIT.  

Requirements  for  My  Band    •  My  Band  shall  have  ELECTRIC  GUITARS  

•  The  BEAT  of  my  band  shall  be  a  BLUES  RITHM    

•  My  band  shall  have  an  ELECTRIC  BASS  GUITAR  •  My  band  shall  have  a  DRUM  KIT  •  The  ELECTRIC  GUITARS  shall  play  with  an  

ELECTRIC  BASS  GUITAR  and  a  DRUM  KIT  

degIC  =  RELATIONS  in  Requirements  

RELATIONS  in  Input  Docs  =    

4  

6  =  0.66    

A. Ferrari, et al. (ISTI-CNR) Requirements Documents Completeness 13 / 27

Page 14: Measuring and Improving the Completeness of Natural ...

Interaction Completeness

 Rock’n  Roll  

 In  the  earliest  rock  and  roll  styles  of  the  late  1940s  and  early  1950s,  either  the  PIANO  or  saxophone  was  o;en  the  lead  instrument,  but  these  were  generally  replaced  or  supplemented  by  GUITAR  in  the  middle  to  late  1950s.  The  BEAT  is  essenFally  a  BLUES  RITHM  with  an  accentuated  BACKBEAT,  the  laGer  almost  always  provided  by  a  snare  drum.  Classic  rock  and  roll  is  usually  played  with  one  or  two  ELECTRIC  GUITARS  (one  lead,  one  rhythm),  a  string  bass  or  (a;er  the  mid-­‐1950s)  an  ELECTRIC  BASS  GUITAR,  and  a  DRUM  KIT.  

Requirements  for  My  Band    •  My  Band  shall  have  ELECTRIC  GUITARS  

•  The  BEAT  of  my  band  shall  be  a  BLUES  RITHM    

•  My  band  shall  have  an  ELECTRIC  BASS  GUITAR  •  My  band  shall  have  a  DRUM  KIT  •  The  ELECTRIC  GUITARS  shall  play  with  an  

ELECTRIC  BASS  GUITAR  and  a  DRUM  KIT  

degIC  =  RELATIONS  in  Requirements  

RELATIONS  in  Input  Docs  =    

4  

6  =  0.66    

The  BACKBEAT  in  the  RITHM!  

A. Ferrari, et al. (ISTI-CNR) Requirements Documents Completeness 14 / 27

Page 15: Measuring and Improving the Completeness of Natural ...

A Word Game to Improve Completeness

A. Ferrari, et al. (ISTI-CNR) Requirements Documents Completeness 15 / 27

Page 16: Measuring and Improving the Completeness of Natural ...

Completeness Assistant for Requirements

Automatic Concept

Extraction

Automatic Relation

Extraction

Input Documents

RelevantTerms

RelevantRelations

Write a requirement with the following terms:

BEATBLUES RITHM

BACKBEAT

Completeness Assistant for

Requirements (CAR)

The BEAT shall be a BLUES RITHM with BACKBEAT

Concept completeness

Interactioncompleteness

80% 90%

A. Ferrari, et al. (ISTI-CNR) Requirements Documents Completeness 16 / 27

Page 17: Measuring and Improving the Completeness of Natural ...

Completeness Assistant for Requirements

Automatic Concept

Extraction

Automatic Relation

Extraction

Input Documents

RelevantTerms

RelevantRelations

Write a requirement with the following terms:

BEATBLUES RITHM

BACKBEAT

Completeness Assistant for

Requirements (CAR)

The BEAT shall be a BLUES RITHM with BACKBEAT

Concept completeness

Interactioncompleteness

80% 90%

A. Ferrari, et al. (ISTI-CNR) Requirements Documents Completeness 17 / 27

Page 18: Measuring and Improving the Completeness of Natural ...

Completeness Assistant for Requirements

Automatic Concept

Extraction

Automatic Relation

Extraction

Input Documents

RelevantTerms

RelevantRelations

Write a requirement with the following terms:

BEATBLUES RITHM

BACKBEAT

Completeness Assistant for

Requirements (CAR)

The BEAT shall be a BLUES RITHM with BACKBEAT

Concept completeness

Interactioncompleteness

80% 90%

A. Ferrari, et al. (ISTI-CNR) Requirements Documents Completeness 18 / 27

Page 19: Measuring and Improving the Completeness of Natural ...

Completeness Assistant for Requirements

A. Ferrari, et al. (ISTI-CNR) Requirements Documents Completeness 19 / 27

Page 20: Measuring and Improving the Completeness of Natural ...

Experiment

A. Ferrari, et al. (ISTI-CNR) Requirements Documents Completeness 20 / 27

Page 21: Measuring and Improving the Completeness of Natural ...

Automatic Train Supervision (ATS) System

ATS SystemCentralized system that monitors and regulates the movement ofthe trainsAutomatically routes trains, and sends them speed profiles thatshall be followed while moving through the railway networkNormally equipped with a user interface where the ATS operatorcan view the position of all the trains, their schedule, and otherinformation

Input DocumentThe IEEE Std 1474.1-2004 includes the basic requirementsof an ATS system

A. Ferrari, et al. (ISTI-CNR) Requirements Documents Completeness 21 / 27

Page 22: Measuring and Improving the Completeness of Natural ...

Experiment: Phase 1

Completeness Assistant for

Requirements (CAR)

IEEE Std 1474.1-2004

(5 pages)

67 Relevant Terms

316 Relevant Relations

Requirements Document Subject A

Requirements DocumentSubject B

Com

pute

Bac

kwar

d C

ompl

eten

ess

Com

pute

For

war

d C

ompl

eten

ess

A. Ferrari, et al. (ISTI-CNR) Requirements Documents Completeness 22 / 27

Page 23: Measuring and Improving the Completeness of Natural ...

Experiment: Phase 2

Completeness Assistant for

Requirements (CAR)

IEEE Std 1474.1-2004

(5 pages)

67 Relevant Terms

316 Relevant Relations

Requirements Document Subject B

Requirements DocumentSubject A

Com

pute

Bac

kwar

d C

ompl

eten

ess

Com

pute

For

war

d C

ompl

eten

ess

A. Ferrari, et al. (ISTI-CNR) Requirements Documents Completeness 23 / 27

Page 24: Measuring and Improving the Completeness of Natural ...

Results

Subject Num.Reqs Tool degCC degIC degFEC degLCC

A 36Yes 68.7% 17.1% 47.6% 40%No 52.3% 12.8% 61.9% 50%

B 21Yes 67.2% 24.5% 47.6% 50%No 58.2% 11.6% 33.3 % 50%

Backward completeness increases when the tool is used

A. Ferrari, et al. (ISTI-CNR) Requirements Documents Completeness 24 / 27

Page 25: Measuring and Improving the Completeness of Natural ...

Results

Subject Num.Reqs Tool degCC degIC degFEC degLCC

A 36Yes 68.7% 17.1% 47.6% 40%No 52.3% 12.8% 61.9% 50%

B 21Yes 67.2% 24.5% 47.6% 50%No 58.2% 11.6% 33.3 % 50%

We did not find a positive correlation between backwardand forward completenessA positive correlation holds only for Subject B

A. Ferrari, et al. (ISTI-CNR) Requirements Documents Completeness 25 / 27

Page 26: Measuring and Improving the Completeness of Natural ...

Conclusion

A new method has been developed to measure completenessA new method has been developed to improve completeness

Backward completeness did not imply forward completenessRequirements definition needs background + [...] to achieveforward completeness

The requirements edited with CAR tend to be more specificI “The ATS system shall adjust the speed profile of the trains in

response to wet rail conditions in order to avoid emergency brakeapplication” (specific case)

I “The ATS system shall be capable of supporting re-routing of trainsin response to service disruption” (alternative behaviour)

The tool can have a complementary role in requirements definition

A. Ferrari, et al. (ISTI-CNR) Requirements Documents Completeness 26 / 27

Page 27: Measuring and Improving the Completeness of Natural ...

Questions?

E-mail: [email protected]

FMT Group: http://fmt.isti.cnr.itItaliaNLP Group: http://www.italianlp.it

A. Ferrari, et al. (ISTI-CNR) Requirements Documents Completeness 27 / 27