《石琳-當需求工程遇上人工智能-v2.4(1).pptx只讀.pdf》由會員分享,可在線閱讀,更多相關《石琳-當需求工程遇上人工智能-v2.4(1).pptx只讀.pdf(48頁珍藏版)》請在三個皮匠報告上搜索。
1、當需求工程遇上人工智能應用與挑戰石琳 北京航空航天大學演講嘉賓石 琳北京航空航天大學 教授現任北京航空航天大學軟件學院教授,CCF高級會員,美國南加州大學訪問學者,2022年度中國科學院軟件研究所杰出青年科技人才。研究方向為智能軟件工程,包括代碼生成、智能需求工程、經驗軟件工程、開源社區挖掘、開源軟件安全等。曾在人工智能、軟件工程領域的高水平國際會議IJCAI,ICSE,FSE,ASE等發表論文50余篇,三次獲得杰出論文獎:ACM SIGSOFT 杰出論文獎(ASE21)、連續兩次獲國際需求工程大會杰出論文獎(RE21,RE20)。入選中科院青促會,主持參與多項國家自然科學科學基金項目、國防科
2、技創新項目、國家重點研發項目等。同時擔任多個國際知名會議期刊包括ICSE、ASE、FSE、Automated Software Engineering期刊、Requirements Engineering期刊、軟件學報等審稿人。目 錄CONTENTS1.背景與介紹2.智能需求工程中的關鍵性挑戰3.解決思路及效果4.大語言模型在需求工程的初探5.總結與展望軟件是現實世界解決方案在計算世界的映射問題域現實世界解系統計算世界需求工程用工程的理念和方法來指導軟件需求實踐,提供了一系列的過程、策略、方法學和工具,幫助需求工程師加強對業務或領域問題及其環境的理解。背景人工智能需求工程自然語言處理計算機視覺
3、機器學習數據挖掘深度學習機器人知識圖譜推薦系統邏輯推理TensorFlow需求獲取異味需求檢測需求生成需求分類需求追溯大數據需求分析CNN意圖分類FRMiner框架基于人工智能的需求工程技術受到學術界廣泛的關注 背景:深度學習在軟件需求工程中的應用最近,越來越多的需求工程研究采用深度學習技術來獲取、分析、跟蹤、驗證和管理軟件需求。F2CHAT分類 明確需求工程的目標和范圍分析DL是否適合解決需求工程問題選擇合適的DL算法收集與處理數據訓練與評估模型部署和測試模型需求獲取需求追溯需求分類異味需求檢測需求分析需求生成TraceNN方法TraceBERT框架DRAFT框架NoRBERTPRCBERT
4、潛在驗證分類NLP+MLBERT上下文模型QAssist問答系統半結構化模型,KAOS等ReqGen框架LSTM-CRF模型需求意圖分類特征請求檢測聊天室檢索信息需求分類需求分類需求推薦需求自動合成RelGAN框架自動化需求生成需求不完整性檢測需求實體提取需求回指歧義需求實體共引用需求-源代碼追蹤DEMAR框架文本分類不同層析需求追蹤需求發現與注釋需求-設計文檔聯系需求術語多義性ANN+LSI“Deep Learning-based Software Engineering:Progress,Challenges,and Opportunities”,Lu Zhang et al.,2023智
5、能需求工程中的關鍵性挑戰PART 02Key Challenges in AIRE挑戰一:如何應對需求數據匱乏?DatasetVolumePURE79 SRS of different typesModis49 low level requirements19 high level requirements CM1220 low level requirements235 high level requirements公開數據集稀少,信息含量單一挑戰一:如何應對需求數據匱乏?需求數據隱匿性強,獲取成本高挑戰二:如何智能理解需求文檔的內容?需求通常是自然語言描述、領域緊密相關的 能否正確理解需求
6、文檔的內容,是下游任務實現自動化的關鍵領域性強二義性強-需求獲取-需求追蹤-需求分類-需求變更影響分析挑戰三:如何智能保障需求質量?代碼靜態檢測工具Smelly RequirementsSmelly Requirements功能不清晰需求不完整需求沖突需求分析師智能需求工程中的關鍵性挑戰解決思路及效果PART 03Solutions and Evaluations解決思路挑戰一思路一:從開源社區問題報告中挖掘隱匿的用戶需求Mingyang Li,Lin Shi,et al.A Deep Multitask Learning Approach for Requirements Discovery
7、 and Annotation from Open Forum.ASE2020Lin Shi,et al.,Understanding Feature Requests by Leveraging Heuristic Fuzzy rules and Semantic Analysis.ASE 2017挑戰一:如何應對需求數據匱乏?思路一:從開源社區問題報告中挖掘隱匿的用戶需求Mingyang Li,Lin Shi,et al.A Deep Multitask Learning Approach for Requirements Discovery and Annotation from Ope
8、n Forum.ASE2020Lin Shi,et al.,Understanding Feature Requests by Leveraging Heuristic Fuzzy rules and Semantic Analysis.ASE 2017多任務學習框架同時給需求發現和需求標注任務帶來了性能(4%F1-4%,ACC-7.7%)無論是需求發現還是需求標注,效果均顯著優于現有方法挑戰一:如何應對需求數據匱乏?思路二:從開源社區郵件列表中挖掘隱匿的用戶需求Lin Shi,Celia Chen,Qing Wang,Barry Boehm,Automatically detecting f
9、eature requests from development emails by leveraging semantic sequence mining(RE Journal 2021)EffectivenessGeneralizability挑戰一:如何應對需求數據匱乏?思路三:從開源社區聊天平臺中挖掘隱匿的用戶需求Lin Shi,et al.,Detection of Hidden Feature Requests from Massive Chat Messages via Deep Siamese Network(ICSE 2020)挑戰一:如何應對需求數據匱乏?思路三:從開源社區
10、聊天平臺中挖掘隱匿的用戶需求Lin Shi,et al.,Detection of Hidden Feature Requests from Massive Chat Messages via Deep Siamese Network(ICSE 2020)Massive chat messagesSampleDuration#dialogs#sentences#dialogs#sentences#FRsAngularJS2016.5-2019.438266406553316922036Bootstrap2014.7-2019.51035858871379237176Chromium2015.5
11、-2019.716804118890340446527Total65428584314103516056139AngularBootstrapChromiumPrecisionRecallF1PrecisionRecallF1PrecisionRecallF1Our approachSiamese FRMiner85.23%86.56%85.89%86.84%85.89%86.37%85.87%86.81%86.34%Plain FRMiner 31.03%50.00%38.30%27.56%69.08%39.40%16.00%50.00%24.24%Existing studiesCNC7.
12、70%44.44%13.13%16.38%34.21%22.13%9.10%62.50%15.70%FRA13.67%80.33%23.35%23.00%48.67%31.00%16.00%80.00%27.00%Text classificationNB16.00%75.00%26.00%27.00%36.00%31.00%7.00%26.00%12.00%GBDT18.00%14.00%16.00%30.00%11.00%16.00%20.00%19.00%19.00%RF28.00%14.00%19.00%37.00%9.00%15.00%12.00%26.00%16.00%FastTe
13、xt32.00%19.00%24.00%43.00%13.00%20.00%19.00%11.00%14.00%使用孿生網絡后效果明顯提升交叉項目驗證表明,效果均顯著優于現有方法挑戰一:如何應對需求數據匱乏?思路四:從App Store用戶評論中挖掘隱匿的用戶需求Yawen Wang,Junjie Wang,Hongyu Zhang,Xuran Ming,Lin Shi,Qing Wang,Where is Your App Frustrating Users?(ICSE 2022)Example挑戰一:如何應對需求數據匱乏?思路四:從App Store用戶評論中挖掘隱匿的用戶需求Yawen
14、Wang,Junjie Wang,Hongyu Zhang,Xuran Ming,Lin Shi,Qing Wang,Where is Your App Frustrating Users?(ICSE 2022)首先,線上爬取App 用戶評論數據,并清洗以及獲取評論屬性;其次,以評論文本和評論屬性作為BERT 模型訓練的輸入,然后,設計圖聚類方法對抽象短語聚類,最后,可視化App缺陷特征分布。挑戰一:如何應對需求數據匱乏?解決思路挑戰二思路一:基于深度學習的需求領域實體檢測Mingyang Li,Ye Yang,Lin Shi,et al.,Automated Extraction of Re
15、quirement Entities by Leveraging LSTM-CRF and Transfer Learning,ICSME 2020采用遷移學習的方法,從大規模通用語料中學習語言知識,并遷移到目標網絡中,從而實現在小規模標注數據情況下的需求實體抽取。使用使用2500個未標注需求和個未標注需求和1000個標注個標注需求,需求,RENE可以達到理想的模型性能可以達到理想的模型性能挑戰二 如何智能理解需求文檔的內容?思路二:基于深度學習的需求功能點智能分析Lin Shi,et al.,Learning to Extract Transaction Function from Requ
16、irements:An Industrial Case on Financial Software,ESEC/FSE 2020Yawen Wang,Junjie Wang,Mingyang Li,Lin Shi,et al.,A Multi-concern Deep Approach for Recognizing Functions from Natural-language Requirement,Information and Software Technology,2022Mingyang Li,Lin Shi*,et al.“Automated Data Function Extra
17、ction from Textual Requirements by Leveraging Semi-Supervised CRF and Language Model”,Information and Software Technology,2021挑戰二 如何智能理解需求文檔的內容?解決思路挑戰三思路一:基于上下文的不一致需求實體檢測Yawen Wang,Lin Shi*,et al.,“A Deep Context-wise Method for Coreference Detection in Natural Language Requirements”,RE20,Distinguis
18、hed Paper AwardYawen Wang,Lin Shi*,Mingyang Li,Qing Wang,Yun Yang,“Detecting Coreferent Entities in Natural Language Requirements”,RE Journal 2022功能實體共指關系指的是不同的語言表達指向同一真實世界的特性短語。導致對技術術語的誤解,導致重復、錯誤的功能開發挑戰三 如何智能保障需求質量?思路二:基于NLP和啟發式規則的低質量需求檢測Fangwen Mu,Lin Shi*,Wei Zhou,Yuanzhong Zhang,Huixia Zhao,“NER
19、O:A Text-based Tool for Content Annotation and Detection of Smelly Requirements”,RE20 首先,將特征請求中的句子分為六個語義類別(意圖、解釋、缺點.);然后,總結特征請求中質量缺陷;最后,采用模糊綜合評價特征請求質量。挑戰三 如何智能保障需求質量?思路二:基于NLP和啟發式規則的低質量需求檢測Fangwen Mu,Lin Shi*,Wei Zhou,Yuanzhong Zhang,Huixia Zhao,“NERO:A Text-based Tool for Content Annotation and Det
20、ection of Smelly Requirements”,RE20工具評估:人工評估+工具自動評分 對來自問題跟蹤系統的10個功能請求進行排名挑戰三 如何智能保障需求質量?大語言模型在需求工程的初探PART 04LLM for RE 大模型用于需求工程GPT只檢測出逾期通知發送需求是模糊的。任務任務描述Prompt需求獲取需求生成通過問答、討論或者解析文檔的方式,生成軟件需求我想做一個類似上面“極客時間”這樣的課程學習App,我首先要實現哪些功能?-朱少民GPT-4 開啟“軟件工程3.0”全新時代需求分析需求分類將需求按照功能性與非功能性進行分類 圖書管理系統(通用性強),主要包含圖書借閱
21、、歸還、逾期通知等主要功能 數據庫掃描軟件(領域性強),檢測數據模型與數據庫不一致性。如,類圖與數據表之間的不匹配,屬性不一致。優先級排序按照需求的關鍵性對需求進行優先級排序圖書管理系統(通用性強),主要包含圖書借閱、歸還、逾期通知等主要功能需求沖突檢測檢測需求之間是否存在沖突或潛在沖突需求管理需求質量提升檢查自然語言描述的需求是否存在表述不清晰需求建模需求文檔化根據自然語言描述的需求,自動生成用例圖、類圖、流程圖、ER圖等 用戶如何使用OAuth2與web應用程序交互和登錄?基于云的文件存儲系統與移動app交互 項目管理工具,允許客戶創建項目,將任務分配給團隊成員,并跟蹤項目的進度。-Adr
22、ian TamGenerating Diagrams with ChatGPT-Khanh MaiChatGPT to generate diagrams/graphs/charts with Mermaid.js.org需求驗證需求驗證根據需求,自動生成驗收標準、Test Case等產品需求通過用戶故事描述,其中一個用戶故事是這樣描述的“我作為“攜程”app的普通用戶,我想要一次性取消事先預定的一個旅游訂單,以操作簡單,不需要去酒店、機票門票等多次操作門票等多次操作”能否幫忙寫出其驗收標準?-朱少民GPT-4 開啟“軟件工程3.0”全新時代大模型用于需求獲取 需求生成:通過問答、討論或者解析
23、文檔的方式,生成軟件需求朱少民GPT-4 開啟“軟件工程3.0”全新時代GPT我想做一個類似上面“極客時間”這樣的課程學習App,我首先要實現哪些功能?Prompt大模型用于需求分析 需求分類:功能/非功能,issue/enhancement/new featurePlease categorize the requirements below by functional and non-functional.1.Users can borrow books by selecting them from the available inventory.2.The system should i
24、mplement secure authentication and protect user data.3.The system should record the borrowing date and the due date for each borrowed book.4.Users can renew books within one day of being overdue.5.The system should be responsive and capable of handling a reasonable number of concurrent users.6.The u
25、ser interface should be intuitive,user-friendly,and accessible on various devices.7.Users can return borrowed books to the library.8.The system should have a robust error handling mechanism and should be able to recover gracefully from failures.9.The system should be designed to handle future expans
26、ion in terms of users,books,and transactions.10.The system updates the inventory and records the return date.11.The system should automatically send notifications to users with overdue books.12.The system starts recording fines once the book return date has passed.GPTPromptGPT能很好的對需求進行功能和非功能分類。需求來源:
27、圖書管理系統(通用性強)主要功能:圖書借閱、歸還、逾期通知等大模型用于需求分析 需求分類Please categorize the requirements below by functional and non-functional.1.The system must provide appropriate data protection measures when accessing and modifying the database.2.The system automatically analyzes the given class diagram to identify class
28、es,genera properties and relationships.3.The system can be operated efficiently to avoid compromising the performance of existing systems.4.The system should have a simple and intuitive user interface that facilitates the user experience.5.The system is able to scan the database and detect mismatche
29、s and attribute inconsistencies between class diagrams and database tables.6.To resolve detected inconsistencies,the system can provide suggestions for improvements to the class diagram,which may include reference scenarios such as adding new classes,modifying class attributes and relationships,etc.
30、7.The system should have the ability to adapt to new kinds of inconsistency detection and repair as business needs change.8.The system should be able to automatically execute repair scripts to resolve some common,known inconsistencies.GPTPrompt錯誤地將系統的性能需求分類為功能性需求錯誤地將系統的擴展性需求分類為功能性需求需求來源:數據庫掃描軟件(領域性強
31、)主要功能:檢測數據模型與數據庫不一致性。如,類圖與數據表之間的不匹配,屬性不一致。大模型用于需求分析 需求優先級排序:自動按照關鍵性排序需求借閱、歸還、逾期通知等核心功能沒有優先;反而強調用戶界面、并發處理等附加能力。Please rank the requirements in order of priority.1.Users can borrow books by selecting them from the available inventory.2.The system should implement secure authentication and protect user
32、 data.3.The system should record the borrowing date and the due date for each borrowed book.4.Users can renew books within one day of being overdue.5.The system should be responsive and capable of handling a reasonable number of concurrent users.6.The user interface should be intuitive,user-friendly
33、,and accessible on various devices.7.Users can return borrowed books to the library.8.The system should have a robust error handling mechanism and should be able to recover gracefully from failures.9.The system should be designed to handle future expansion in terms of users,books,and transactions.10
34、.The system updates the inventory and records the return date.11.The system should automatically send notifications to users with overdue books.12.The system starts recording fines once the book return date has passed.需求來源:圖書管理系統(通用性強)主要功能:圖書借閱、歸還、逾期通知等大模型用于需求分析 需求沖突檢測:檢查需求之間是否存在沖突GPT只檢測出逾期通知發送需求是模糊
35、的。Please check for conflicts between the following requirements.1.Users can borrow books by selecting them from the available inventory.2.The system should implement secure authentication and protect user data.3.The system should record the borrowing date and the due date for each borrowed book.4.Us
36、ers can renew books within one day of being overdue.5.he system should be responsive and capable of handling a reasonable number of concurrent users.6.The user interface should be intuitive,user-friendly,and accessible on various devices.7.Users can return borrowed books to the library.8.The system
37、should have a robust error handling mechanism and should be able to recover gracefully from failures.9.The system should be designed to handle future expansion in terms of users,books,and transactions.10.The system updates the inventory and records the return date.11.The system should automatically
38、send notifications to users with overdue books.12.The system starts recording fines once the book return date has passed.GPTGPT檢測出超過還書日期,系統開始記錄罰款與用戶在逾期一天內可以續借圖書之間存在沖突。需求來源:圖書管理系統(通用性強)主要功能:圖書借閱、歸還、逾期通知等大模型用于需求分析 需求沖突檢測GPT只檢測出逾期通知發送需求是模糊的。GPTPlease check for conflicts between the following requiremen
39、ts.1.After three continues failed login attempts,the account would be locked by the system.2.Once the account is locked,the system sends an account lock notification email to the accounts owner.3.Once an account is locked,the system would also send a SMS message to the accounts owner to notify him a
40、bout the situation owner.4.If a user has already received a notification via email,he will not receive the same notification via SMS.形式重于內容用戶登錄失敗,發送鎖定通知大模型用于需求分析 需求質量提升:檢查自然語言描述的需求是否存在表述不清晰GPT只檢測出逾期通知發送需求是模糊的。Please rank the requirements in order of priority.1.Users can borrow books by selecting the
41、m from the available inventory.2.The system should implement secure authentication and protect user data.3.The system should record the borrowing date and the due date for each borrowed book.4.Users can renew books within one day of being overdue.5.The system should be responsive and capable of hand
42、ling a reasonable number of concurrent users.6.The user interface should be intuitive,user-friendly,and accessible on various devices.7.Users can return borrowed books to the library.8.The system should have a robust error handling mechanism and should be able to recover gracefully from failures.9.T
43、he system should be designed to handle future expansion in terms of users,books,and transactions.10.The system updates the inventory and records the return date.11.The system should automatically send notifications to users with overdue books.12.The system starts recording fines once the book return
44、 date has passed.GPTGPT未能檢測出:用戶借書:借書數量限制不明確計算罰款:罰款計算規則不明確大模型用于需求建模 根據自然語言描述的需求,自動生成用例圖、類圖、流程圖、ER圖等 幫助建立Requirements GlossaryAdrian TamGenerating Diagrams with ChatGPT大模型用于需求建模 根據自然語言描述的需求,自動生成類圖Khanh MaiChatGPT to generate diagrams/graphs/charts with Mermaid.js.orgA small software development compan
45、y wants to build a new project management tool for its clients.The tool will allow clients to create projects,assign tasks to team members,and track the progress of the project.Please create a class diagram for this using the Mermaid syntax.項目管理工具:允許客戶創建項目,將任務分配給團隊成員,并跟蹤項目的進度。GPTGPT生成的Mermaid代碼存在語法錯
46、誤。不能夠轉換為類圖。enum 語法錯誤大模型用于需求建模 根據自然語言描述的需求,自動生成類圖Khanh MaiChatGPT to generate diagrams/graphs/charts with Mermaid.js.orgPrompt 1:A syntax error with the above code,pls regenerate.第1次提示GPT有語法錯誤,但沒有說明錯誤細節。Prompt 2:A syntax error exists in the above code.The error details are Error:Lexical error on line
47、 32.Unrecognized text enum TaskStatus.Please regenerate.第2次提示GPT存在語法錯誤細節,生成無語法錯誤的代碼。依然存在相同的語法錯誤。大模型用于需求建模Khanh MaiChatGPT to generate diagrams/graphs/charts with Mermaid.js.org第2次提示后的無語法錯誤代碼。將其轉為類圖。類圖中沒有體現客戶創建項目,并將任務分配給團隊成員。參考類圖:大模型用于需求驗證 根據需求,自動生成驗收標準、Test Case朱少民GPT-4 開啟“軟件工程3.0”全新時代There are some
48、 requirements which a password and a username should fulfill:the username must be at least 4 characters but not more than 15 and can include letters and numbers;the password must be at least 8 characters and contain at least one letter and one number or special character.The password can not be the
49、same as the username.大模型應用于需求工程的優越性 適用通識性強的軟件:需求分類、需求質量評價任務上,通識領域基本準確。解決從0到1:需求生成、需求建模、需求驗證等任務上,不完全準確,但至少能產生一個start point,以此為基礎交互式修改大模型應用于需求工程的局限性 難以捕捉需求中的“隱藏知識”:需求中很多重要信息存在分析師腦海中,需求分析背后也有大量的方案對比和推敲,需求本身的高度抽象性和模糊性,也是大模型難以逾越的障礙 遺漏重要需求:大模型生成的需求主要依據常識或某類軟件的共性特征,可能遺漏一些重要需求 缺乏創新:大模型是求同的,創新性或個性化需求依賴開發人員進行
50、補充 可靠性問題:大模型在需求優先級排序、沖突檢測等方面,產生的結果不穩定智能需求工程的未來展望 交互增強:如何利用LLM人機交互能力增強需求獲???在人機交談中明確、澄清需求?Fast Prototype 創新增強:如何結合復雜的業務上下文和外部知識,生成個性化需求?應用增強:如何將大模型用于版本演化中的需求生成?如何系統評價大模型的應用效果?更加重視需求工程基本能力建設:數字化、知識化THANKS需求工程最核心的任務是”Understand the organisation,its stakeholders,their needs,and their high-level proposals”。在大模型時代,需求工程顯得更為重要!