(Semi-) Automatic Categorization of Natural Language Requirements - - PowerPoint PPT Presentation

semi automatic categorization of natural language
SMART_READER_LITE
LIVE PREVIEW

(Semi-) Automatic Categorization of Natural Language Requirements - - PowerPoint PPT Presentation

(Semi-) Automatic Categorization of Natural Language Requirements Eric Knauss and Daniel Ott eric.knauss@cse.gu.se @oerich oerich.wordpress.com Importance of Requirement Categorization Requirement Security Signal Func2onal


slide-1
SLIDE 1

(Semi-) Automatic Categorization of Natural Language Requirements

Eric Knauss and Daniel Ott

eric.knauss@cse.gu.se @oerich

  • erich.wordpress.com
slide-2
SLIDE 2

Importance of Requirement Categorization

[1] ¡E. ¡Knauss, ¡S. ¡Houmb, ¡K. ¡Schneider, ¡S. ¡Islam, ¡and ¡J. ¡Jürjens. ¡Suppor>ng ¡requirements ¡engineers ¡in ¡recognising ¡security ¡issues. ¡Requirements ¡Engineering: ¡Founda>on ¡for ¡ SoGware ¡Quality, ¡pages ¡4-­‑18, ¡2011. ¡ [3] ¡Daniel ¡OR. ¡Automa>c ¡requirement ¡categoriza>on ¡of ¡large ¡natural ¡language ¡specifica>ons ¡at ¡mercedes-­‑benz ¡for ¡review ¡improvements. ¡In ¡Requirements ¡Engineering: ¡ Founda>on ¡for ¡SoGware ¡Quality, ¡2013. ¡ [2] ¡X. ¡Song ¡and ¡B. ¡Hwong. ¡Categorizing ¡requirements ¡for ¡a ¡contract-­‑based ¡system ¡integra>on ¡project. ¡In ¡Requirements ¡Engineering ¡Conference ¡(RE), ¡pages ¡279-­‑284. ¡IEEE, ¡2012. ¡

Requirement ¡ Security ¡ Signal ¡ Func2onal ¡ Non-­‑func2onal ¡ Temperature ¡ Test ¡ R1 ¡ yes ¡ yes ¡ yes ¡ R2 ¡ yes ¡ yes ¡ R3 ¡ yes ¡ yes ¡ yes ¡ R4 ¡ yes ¡ yes ¡ yes ¡ yes ¡ R5 ¡ yes ¡ yes ¡ yes ¡

Recognising ¡security ¡ ¡ issues ¡[1] ¡ Iden2fica2on ¡of ¡special ¡kinds ¡ [2] ¡for: ¡

  • ­‑

Architectural ¡decisions ¡

  • ­‑

Needed ¡equipment ¡

  • ­‑

¡Iden2fica2on ¡of ¡ dependencies ¡for ¡risk ¡ detec2on ¡ Improving ¡Review ¡efficiency[3] ¡

(Semi-) automatic reqt. categorization 2

slide-3
SLIDE 3

Minimizing Efforts by Automation

60 P. 2.000 P.

∅ 16 words / requirement

290 req. 3.700 req.

Component specification

850 req.

Today’s ¡specifica>ons ¡are ¡large ¡and ¡

  • complex. ¡ ¡

Minimalize ¡manual ¡efforts ¡for ¡a ¡ categoriza2on ¡of ¡requirements ¡and ¡at ¡the ¡ same ¡2me ¡maximize ¡the ¡quality ¡of ¡the ¡ resul2ng ¡categoriza2on ¡ For ¡example ¡at ¡Mercedes ¡Benz ¡

  • Develop ¡a ¡socio-­‑technical ¡system ¡for ¡

requirements ¡categoriza>on ¡during ¡ the ¡specifica>on ¡wri>ng ¡process ¡

  • Evaluate ¡at ¡Mercedes ¡Benz ¡with ¡full-­‑

automa2c, ¡semi-­‑automa2c ¡and ¡ manual ¡classifica2on ¡

Research ¡Goal ¡

(Semi-) automatic reqt. categorization 3

slide-4
SLIDE 4

Automatic Classification - Basics

Topic ¡x ¡

documents ¡ to ¡classify ¡ topics ¡ training ¡data ¡

Topic ¡x ¡ classifica2on ¡ algorithm ¡

  • High ¡Recall ¡

¡ ¡ ¡ ¡ ¡ ¡ ¡Recall ¡ ¡ ¡ ¡ ¡ ¡ ¡

  • High ¡Precision ¡ ¡ ¡ ¡ ¡ ¡ ¡Precision ¡ ¡

Goal ¡

relevant ¡requirements ¡R ¡ retrieved ¡requirements ¡A ¡ relevant ¡requirements ¡in ¡retrieved ¡ requirements ¡𝐒 ¡∩ ¡𝐁 ¡ (Semi-) automatic reqt. categorization 4

slide-5
SLIDE 5

Machine Learning – Processing steps[1]

Example ¡4-­‑gram-­‑indexing: ¡ T4, ¡T7, ¡T1, ¡T3 ¡ T1 ¡ T2, ¡T1, ¡ T3, ¡T1, ¡ Not ¡Classified ¡

[1] ¡D. ¡OR ¡, ¡„Automa>c ¡Requirement ¡Categoriza>on ¡of ¡Large ¡Natural ¡Language ¡Specifica>ons ¡at ¡Mercedes-­‑Benz ¡for ¡Review ¡ Improvements”, ¡REFSQ ¡2013 ¡

non-­‑assigned ¡ requirements ¡ Pre-­‑Processing ¡ K-­‑gram-­‑indexing ¡ Classifica>on ¡ Support ¡Vector ¡ Machines ¡(SVM) ¡ training ¡ requirements ¡ Post-­‑Processing ¡ Topic ¡ generaliza>on ¡ assigned ¡ requirements ¡

Requires ¡aRen2on ¡ requ, ¡equi, ¡quir, ¡uire, ¡ires; ¡aRe, ¡ Ren, ¡tent, ¡en>, ¡n>o, ¡>on ¡

(Semi-) automatic reqt. categorization 5

slide-6
SLIDE 6

hRps://flic.kr/p/4NXkqE ¡

Idea

Step ¡1: ¡Manually ¡classify, ¡train ¡automa>c ¡classifier, ¡gain ¡a ¡“spotlight” ¡ Step ¡2-­‑n: ¡Use ¡“spotlight” ¡to ¡automa>cally ¡categorize ¡requirements ¡ever ¡aGer ¡

hRps://flic.kr/p/4NXkqE ¡

(Semi-) automatic reqt. categorization 6

slide-7
SLIDE 7

hRps://flic.kr/p/4NXkqE ¡

Reality

Step ¡1: ¡Manually ¡classify, ¡train ¡automa>c ¡classifier, ¡gain ¡a ¡“spotlight” ¡ Step ¡2: ¡“Spotlight” ¡only ¡applicable ¡to ¡ini>al ¡specifica>on ¡

hRps://flic.kr/p/4NXkqE ¡

(Semi-) automatic reqt. categorization 7

X ¡

slide-8
SLIDE 8

Why?

  • Wri>ng ¡style ¡
  • Project ¡culture ¡
  • Domain ¡specific ¡words ¡
  • … ¡
  • Amount ¡of ¡training ¡data ¡

à ¡“Useful ¡in ¡product ¡line ¡ ¡ and ¡soGware ¡evolu>on ¡ ¡ scenarios” ¡

hRps://flic.kr/p/52rMVi ¡

(Semi-) automatic reqt. categorization 8

Shiny, ¡but ¡special ¡purpose ¡

  • Our vision was a bit different...
slide-9
SLIDE 9

Open specification Write requirement Classify requirement Close specification

Classify requirement

Initial trainingsdata? yes: use training data from

  • ther specifications

no: use only training data from this specification Identify suitable class manually Identify suitable class automatically Automatic classification support? yes no Manually add class to requirement Automatically add class to requirement User confirms classification? yes no Update training data for this specification

Socio-technical system for requirements categorization

1 ¡ 2 ¡ 3 ¡

(Semi-) automatic reqt. categorization 9

slide-10
SLIDE 10

Infrastructure for Evaluation

1 3 2

(Semi-) automatic reqt. categorization 10

slide-11
SLIDE 11

What do we want to learn?

effort ¡ quality ¡ Fully ¡automa>c ¡ Manual ¡ RQ1 ¡ RQ2 ¡ Semi ¡automa>c ¡

(Semi-) automatic reqt. categorization 11

+ ¡Ability ¡to ¡adjust ¡ ¡ to ¡new ¡domain ¡

slide-12
SLIDE 12

Four relevant treatments

Treatment ¡ Automa2c ¡ classifica2on ¡ support ¡ Ini2al ¡training ¡ User ¡confirms ¡ classifica2on ¡ T1 ¡ No ¡ No ¡ Yes ¡ T2 ¡ Yes ¡ Yes ¡ No ¡ T3 ¡ Yes ¡ No ¡ Yes ¡ T4 ¡ Yes ¡ Yes ¡ Yes ¡ manual ¡ automa>c ¡ semi-­‑ ¡ automa>c ¡

(Semi-) automatic reqt. categorization 12

Ini>al ¡ training ¡

slide-13
SLIDE 13

Data sources

hRps://flic.kr/p/kNtqEJ ¡ doi:10.1371/journal.pone.0062127.g002 ¡ hRps://flic.kr/p/4HU1ta ¡

End-­‑result ¡vs. ¡Ground ¡truth ¡ Telemetry ¡ Ques>onnaire ¡

(Semi-) automatic reqt. categorization 13

slide-14
SLIDE 14

Data sources

hRps://flic.kr/p/kNtqEJ ¡ doi:10.1371/journal.pone.0062127.g002 ¡ hRps://flic.kr/p/4HU1ta ¡

End-­‑result ¡vs. ¡Ground ¡truth ¡ Telemetry ¡ Ques>onnaire ¡

60% 0% 40% 100% 80% 20% 20% 80% 40% 67% 60% 33% 75% 50% 25% 50% 100% 50% 0% 50% I have high confidence in the correctness of topic recommendations. I have high confidence in the completeness of topic recommendations. Before the Experiment, my confidence in fully−automatic topic classification was high. After the Experiment, my confidence in fully−automatic topic classification was high. I would prefer fully−automatic topic classification over semi−automatic topic classification. Treatment 3 Treatment 4 Treatment 3 Treatment 4 Treatment 3 Treatment 4 Treatment 3 Treatment 4 Treatment 3 Treatment 4 100 50 50 100 Percentage Response strong disagree disagree rather disagree rather agree agree

(Semi-) automatic reqt. categorization 14

slide-15
SLIDE 15

Performance of fully auto. classif.

  • Quality: Not good enough

– (typical goal: recall > 0.7, precision > 0.6) – Used training data from one domain in a different domain

  • Effort: Naïve answer is “Great!”

– Automatic: init = 5min, classification < 1min – Manual: >>1hr

  • But:

– We need high quality training data – Two raters, Cohen’s Kappa, 2000-3000 requirements

>150hrs

– This effort might never pay off!

(Semi-) automatic reqt. categorization 15

slide-16
SLIDE 16

Performance of semi-auto. approach

Better quality than full automatic? Less effort than manual?

Only ¡classifica+on: ¡ ¡ ¡ ¡ ¡ ¡ ¡1.6min/reqt ¡ ¡ Reported ¡+me ¡by ¡par+cipants: ¡ 3.76min/reqt ¡= ¡ ¡ ¡(2.99 ¡+ ¡.77)min/reqt ¡

(Semi-) automatic reqt. categorization 16

slide-17
SLIDE 17

Cold start: adjust to new domain

Does initial training lead to better results? Does the classifier adopt quicker without initial training?

Ini>al ¡ training ¡ Ini>al ¡ training ¡

(Semi-) automatic reqt. categorization 17

slide-18
SLIDE 18

Result: Questionnaire

60% 0% 40% 100% 80% 20% 20% 80% 40% 67% 60% 33% 75% 50% 25% 50% 100% 50% 0% 50%

I have high confidence in the correctness of topic recommendations. I have high confidence in the completeness of topic recommendations. Before the Experiment, my confidence in fully−automatic topic classification was high. After the Experiment, my confidence in fully−automatic topic classification was high. I would prefer fully−automatic topic classification over semi−automatic topic classification. Treatment 3 Treatment 4 Treatment 3 Treatment 4 Treatment 3 Treatment 4 Treatment 3 Treatment 4 Treatment 3 Treatment 4 100 50 50 100

Percentage

Response strong disagree disagree rather disagree rather agree agree

Ini>al ¡ training ¡

(Semi-) automatic reqt. categorization 18

slide-19
SLIDE 19

Provocative statement

“Without initial training, the socio-technical system

  • f engineers and automatic classifier

performs better – but engineers hate it.”

(Semi-) automatic reqt. categorization 19

slide-20
SLIDE 20

Conclusion

  • Semi-automatic classification can mitigate some major

challenges in automatic requirements classification

– Reasonable ratio of effort/quality – Supports organizational learning – Mitigates lack of high quality training data

  • Plus

– Recommendations can carry some shared knowledge of the team – …can facilitate discussion about how to classify

(Semi-) automatic reqt. categorization 20

Thank you! Eric Knauss and Daniel Ott

eric.knauss@cse.gu.se @oerich

  • erich.wordpress.com
slide-21
SLIDE 21

(Semi-) automatic reqt. categorization 21

slide-22
SLIDE 22

(Semi-) automatic reqt. categorization 22

slide-23
SLIDE 23

Results: End-result

T2 ¡

(Semi-) automatic reqt. categorization 23

slide-24
SLIDE 24

Results: Telemetry

(Semi-) automatic reqt. categorization 24

slide-25
SLIDE 25

Result: Questionnaire

60% 0% 40% 100% 80% 20% 20% 80% 40% 67% 60% 33% 75% 50% 25% 50% 100% 50% 0% 50%

I have high confidence in the correctness of topic recommendations. I have high confidence in the completeness of topic recommendations. Before the Experiment, my confidence in fully−automatic topic classification was high. After the Experiment, my confidence in fully−automatic topic classification was high. I would prefer fully−automatic topic classification over semi−automatic topic classification. Treatment 3 Treatment 4 Treatment 3 Treatment 4 Treatment 3 Treatment 4 Treatment 3 Treatment 4 Treatment 3 Treatment 4 100 50 50 100

Percentage

Response strong disagree disagree rather disagree rather agree agree

(Semi-) automatic reqt. categorization 25