Test Automation Operation
~作ったらそれで終わりって思っていませんか?~
Dec 21st, 2021
Emura Sadaaki
Leisure Product Dept.
Rakuten Group, Inc.
2
Today topic
• テスト自動化の運用の重要性
• 具体的な取り組み
3
agenda
1. Background
2. What do you think test automation?
3. How to handle these situation
4. Finally
4
Background
5
Organization
Developer group QA group
Manual test group Test automation group
Me
:
8 services
Product manager engineer
https://www.irasutoya.com/
6
Test automation scope
Test automation pyramid
target
Target is “End to End”
PC&SP NativeApp
https://keiba.rakuten.co.jp/ access 2021/7/28
7
What we do
DC center
RIaaS
Remote monitor
dashboard
alert
Jenkins server
Windows PC
8
What we do
All regression test run everyday
Find issue quickly
9
What do you think test automation?
10
Is it true?
https://www.irasutoya.com/
• Scriptはずっと使いまわせる!
• バグの検出以外、テストは成功!
• テストはいつも順調に定時に終わる!
大量に作ったテスト自動化
11
Reality bites
https://www.irasutoya.com/
• 仕様はよく変わる
• E2E テスト自動化はfragile
• テストはどんどん遅くなる
12
How to handle these situation
13
Reality bites
https://www.irasutoya.com/
• 仕様はよく変わる
• E2E テスト自動化はfragile
• テストはどんどん遅くなる
14
Changeable specification
テスト自動化は変更が少ないところに適用?
重要で変更の多いところは適用しない?
目的 = テスト自動化の効率を上げる
≠ 重要機能の品質を上げる
15
Changeable specification
テスト自動化は変更が発生する機能も考慮する
目的 = 重要機能の品質を上げる
≠ テスト自動化の効率を上げる
仕様変更による、テスト自動化scriptのreviewが発生
16
Operation 1
テスト自動化は常に仕様に追従させる
17
How to proceed
t
Project A Project B
②新規機能
① 既存機能 modify modify
Create new
Create new
App release App release
Test ready Test ready
Test will
be failed
Test will
be failed
1~2 weeks
18
How to proceed
t
Project C
②新規機能
① 既存機能 modify run
Create new
App release
Test ready 1st round test finish
Test will
be failed
1 month
Test
environment
is stable ?
19
How to proceed
ManualTeam AutomationTeam
Test Design
Catch up
automation scope
execute manual test
Test Implementation
Modify regression
script
Test design for
automation
Script run by CI
①既存機能
Create script
Marge to regression
script
QA done
Fixed by project
done
Use future
project
②新規機能
20
仕様はよく変わる
• テスト自動化も追従する
• 案件・規模に応じてかかわるタイミングを考慮する
21
Reality bites
https://www.irasutoya.com/
• 仕様はよく変わる
• E2E テスト自動化はfragile
• テストはどんどん遅くなる
22
E2E test automation is fragile
よくテスト自動化は失敗する
失敗原因を調査する
成功の状態にする
23
Operation 2
テスト自動化はよく落ちる。調査に時間をかける。
24
Additional task to investigate test result!
manual automation
1. テストする
2. バグを見つける
3. バグチケットを上げる
1. Jenkins が失敗する
2. 失敗レポートで原因を分析する
3. Local で実行してみる
4. バグチケットを上げる
V.S.
Issueが起きた
ときの対処に時
間がかかる!
25
Summary failed reason category
0.5 4.9
20.4
74.1
Application Bug Test automation Bug
Environment issue Temporary unstable
1. Application bug
2. Test automation script bug
3. Environment issue
4. Temporary unstable
※2020/1 ~ 2020/10 summary
Unit = percentage
Reason category
Reason ratio
JaSST’21 Tokyo 「Test Automation Improvement by Machine Learning」
26
Collect all report
• 調査に必要な情報をすべて集約
• エラー履歴を表示
• エラー原因を設定可能
27
Improve operation idea “Auto healing system”
・・・
Jenkins server
1. Use classified data as training data
2. predict failed reason by machine learning
3. Retry test if there is a temporary unstable issue
①
②
Auto healing system
Training data
③
JaSST’21 Tokyo 「Test Automation Improvement by Machine Learning」
一部のテスト失敗
を自動に再実施す
る
28
E2E テスト自動化はfragile
• 多くの調査が発生する前提で、調査しやすい環境構築
• 調査不要なテスト結果を取り除く工夫
29
Reality bites
https://www.irasutoya.com/
• 仕様はよく変わる
• E2E テスト自動化はfragile
• テストはどんどん遅くなる
30
Regression speed
0
50
100
150
200
0 5 10 15 20
Time [second]
実行回数
[sec]
最初は、実行時間は短かった
いつのまにか、時間がかかっている
調査、改善をする
31
Analyze performance
遅くなる原因例
• テストデータ肥大化
• Pipelineが肥大化、jobの高依存化
• 行けてないテスト自動化の実装
https://www.irasutoya.com/
32
Operation 3
テスト自動化のパフォーマンスを監視、改善する。
33
Monitoring performance
Status of use Jenkins
Analyze job performance
何が起きているかを可視化する
34
テストはどんどん遅くなる
• テストの実行速度、Flaky度を可視化する
• 常に改善、常に前進
35
Finally
36
Is it true?
https://www.irasutoya.com/
• Scriptはずっと使いまわせる!
• バグの検出以外、テストは成功!
• テストはいつも順調に定時に終わる!
大量に作ったテスト自動化
37
Reality bites
https://www.irasutoya.com/
• 仕様はよく変わる
• E2E テスト自動化はfragile
• テストはどんどん遅くなる
38
Need Operation
https://www.irasutoya.com/
• テスト自動化は常に仕様に追従させる
• テスト自動化はよく落ちる。調査に時間をかける。
• テスト自動化のパフォーマンスを監視、改善する。
39
テスト自動化は
運用が
9 割
9 まずはやってみて、発生する
運用を意識しよう
20211221 jasst nano_test automation operation

20211221 jasst nano_test automation operation

Editor's Notes

  • #6 Our organization is this. Our dept. have mainly 2 type group. Left side is developer group to create product. This group has product manager and engineer. There are 11 developer group in our Dept. Right side is QA group to check product quality when every application release. This group has manual test team and test automation team. I belong to test automation team. This QA group do test for 11 developer group services.
  • #7 Our test layer is basically “End to End” Test from the view of users
  • #8 RCH real is here
  • #11 Test automationはすることなし! ひまだ!って思われている?
  • #18 As I said during project Regression include affected area by project should be supported That’s why we modify test automation script if regression script is affected during project But new function is low priority in this project. Depending on resource , we will cover it for future project
  • #19 As I said during project Regression include affected area by project should be supported That’s why we modify test automation script if regression script is affected during project But new function is low priority in this project. Depending on resource , we will cover it for future project
  • #20 マニュアルと自動化がわかれているため、密接なやり取りが必要
  • #25 テスト自動化の8原則 「テスト結果分析という新たなタスクが生まれる」
  • #26 JaSST’21 Tokyo 「Test Automation Improvement by Machine Learning」で発表したときの資料
  • #27 エラー情報を集約し、調査にかかる時間の短縮をはかる
  • #28 詳細は割愛しますが、
  • #37 Test automationはすることなし! ひまだ!って思われている?