1 1 1 2 Proposal of test description support environment for request acquisition in web application development Nakaji Yoshitake 1 Choi Eunjong 1 Iida Hajimu 1 Yoshida Norihiro 2 1. 1 ( ) 1 Nara Institute of Science and Technology 2 Nagoya University Ferrari [4] 1
[10] Gherkin [1] 2 2. 2.1 DePoT 2.2 Gherkin 2.3 2.1 DePoT: [11] HTML DSL (Domain Specific Language) [9] DePoT DePoT [5] Selenium [3] DePoT HTML HTML DSL DePoT DSL DSL Verilog HDL SQL DePoT JUnit [6] Java 2.2 Gherkin: DSL Gherkin [1] Gherkin step feature 1 step 2 feature 1 step 2 step When Given And 2
1 step hoge do 2 Capybara.app host = "http://www.hoge.jp/" 3 end 4 5 step do 6 visit / 7 end 8 9 step do 10 # page.should have content( ) # should 11 expect(page).to have content( ) 12 end 13 14 step id password do 15 fill in session_login, :with => testuser 16 fill in session_password, :with => password 17 end 1 step 1 : 2 : 3 hoge 4 5 6 id password 7 8 testuser 2 feature step 2.3 Capture&Replay Programmable 2 Capture&Replay (Captrue) (Replay) Selenium IDE [3] Selenium IDE Programmable HTML Programmable Programmable Capture&Relay Maurizio [8] Programmable Capture&Replay 3 Programmable Programmable 2.3.1 Tellurium Capture&Replay Programmable [10] Tellurium Selenium IDE [3] Capture&Replay Selenium IDE : Programmbale Capture&Replay 3
3. 3.1 3 AtcorderBeginnerContest( ABC)[2] A ABC A ABC 1 1 1 1 A B C 3 2 2 1 0 2 3.2 AtCoder x 1 x 1 x 1 1/x N N 1 N (4 N 100) 1 10 6 3.3 1 1 1 3.4 3 4
2 D E F 1 1 1 0 0 2 3.5 2 D E F 1 4. 4.1 3 4.2 3 Capture&Replay HTML Step Step ( ) ( ) 4.2.1 Capture&Replay Capture&Replay Capture&Replay 1 Katalon Recorder [7] 4 4.2.2 HTML step HTML 2.2 Gherkin step step HTML HTML 2.2 Gherkins step 5 4.2.3 step 6 5. 4 5.1 1: 7 Katalon Recorder Capture&Replay 5.2 2: 8 5
情報処理学会研究報告 入力 KatalonRecorder 変換モジュール2 自然言語で表記された プログラミング言語 ブラウザ操作 入力 変換モジュール1 Stepファイル HTMLファイル 本研究で実装予定 図 3 手法の概要 Capybara.ho st= http:// visit / KatalonRecorderを 通して操作 変換モジュール2 KatalonRecorder 生成 シナリオ: トップページに アクセスして ログインする 前提 hoge サイトにアクセス する 自然言語で表記された プログラミング言語 開発対象 アプリケーション Capybara.ho st= http:// visit / step hoge サイト にアクセスする do Capybara.app host = "http:// " end Stepファイル プログラミング言語 図 4 モジュール 1 の図 図 6 モジュール 3 の図 利用シナリオ1(新規テスト追加) 入力 変換モジュール1 step hoge サイト にアクセスする do Capybara.app host = "http:// " end ステップ② 事前に生成した Stepファイルを用いて生成 ステップ① C&Rによって作成 HTMLファイル 対応するHTMLをパースし てる感 自然言語で表記された Stepファイル 自動処理によって 生成 HTMLファイル 図 5 モジュール 2 の図 2018 Information Processing Society of Japan ファイル (処理と自然言語表現 対応表) 12 図 7 シナリオ 1 の図 6
利用シナリオ 2( テスト保守 ) 利用シナリオ 3( プログラマー テスト保守 ) ステップ 1 C&R によって作成 ステップ 2 事前に生成した Step ファイルを用いて生成 ステップ 3 加えられた変更を同期 プログラムで表記された + 変更 ステップ 3: 加えられた変更を同期 自然言語で表記された + 変更 プログラムで表記された + 変更保守 ため 変更 新規ケース追加など 自然言語で表記された + 変更 プログラマー 自然言語表記な でも変更が理解できる 15 変更がプログラム にも同期される でプログラマー テスト理解とプログラマー乖離が生じない 19 8 2 9 3 Capture&Replay Katalon Recorder [7] Ruby HTML step 5.3 3: 9 5.2 6. JSPS JP18H04094 JP16K16034 [1] : Gherkin, https://docs.cucumber.io/gherkin/. [2] AtCoder Inc.: Atcorder, https://atcoder.jp/?lang= ja. [3] Bruns, A., Kornstadt, A. and Wichmann, D.: Web Application Tests with Selenium, IEEE Software, Vol. 26, No. 5, pp. 88 91 (2009). [4] Ferrari, A., Spoletini, P. and Gnesi, S.: Ambiguity Cues in Requirements Elicitation Interview, Proceedings of the IEEE 24th International Requirements Engineering Conference, pp. 56 65 (2016). [5] Fowler, M.: PageObject, https://martinfowler.com/ bliki/pageobject.html. [6] JUnit Team (2018): JUnit: JUnit 5, https://junit. org/junit5/. [7] Katalon: Katalon studio, https://www.katalon.com/. [8] Leotta, M., Clerissi, D., Ricca, F. and Tonella, P.: Capture-replay vs. programmable web testing: An empirical assessment during test case evolution, Proceedings of the 20th Working Conference on Reverse Engineering, pp. 272 281 (2013). [9] Mernik, M., Heering, J. and Sloane, A. M.: When and how to develop domain-specific languages, ACM Computing Surveys (CSUR), Vol. 37, No. 4, pp. 316 344 (2005). [10] Web GUI SS2016-45 (2017). [11] DePoT Web Vol. 56, No. 3, pp. 835 846 (2015). 7