『APP稳定性测试干货』| 基于Monkey的移动端/APP稳定性测试过程和方法

本文涉及的产品
日志服务 SLS,月写入数据量 50GB 1个月
简介: 『APP稳定性测试干货』| 基于Monkey的移动端/APP稳定性测试过程和方法

1 什么是Monkey?

  • Monkey是一个Android平台自动化测试的一个工具,主要用来测试稳定性的;
  • Monkey可以模拟用户的一系列操作,比如触摸屏幕、滑动、按键等,对这些操作进行压力测试,检测程序多久会出现异常;
  • MonkeyAndroid系统自带的,使用java编写的;
  • Monkey的存放路径为:
/system/framework/monkey.jar

在这里插入图片描述

2 Monkey的启动

  • monkey.jar启动使用shell脚本,而shell脚本存放的路径在:
 /system/bin/monkey

在这里插入图片描述

  • 启动有两种方式:
# 方式1(直接在PC上的命令行执行):
adb shell monkey {
   
   参数}

# 方式2(进入设备执行):
进入到设备:adb shell 
monkey {
   
   参数}
  • 比如可以查看monkey的参数:
adb shell monkey -help
C:\Users\Administrator>adb shell monkey -help
usage: monkey [-p ALLOWED_PACKAGE [-p ALLOWED_PACKAGE] ...]
              [-c MAIN_CATEGORY [-c MAIN_CATEGORY] ...]
              [--ignore-crashes] [--ignore-timeouts]
              [--ignore-security-exceptions]
              [--monitor-native-crashes] [--ignore-native-crashes]
              [--kill-process-after-error] [--hprof]
              [--pct-touch PERCENT] [--pct-motion PERCENT]
              [--pct-trackball PERCENT] [--pct-syskeys PERCENT]
              [--pct-nav PERCENT] [--pct-majornav PERCENT]
              [--pct-appswitch PERCENT] [--pct-flip PERCENT]
              [--pct-anyevent PERCENT] [--pct-pinchzoom PERCENT]
              [--pct-permission PERCENT]
              [--pkg-blacklist-file PACKAGE_BLACKLIST_FILE]
              [--pkg-whitelist-file PACKAGE_WHITELIST_FILE]
              [--wait-dbg] [--dbg-no-events]
              [--setup scriptfile] [-f scriptfile [-f scriptfile] ...]
              [--port port]
              [-s SEED] [-v [-v] ...]
              [--throttle MILLISEC] [--randomize-throttle]
              [--profile-wait MILLISEC]
              [--device-sleep-time MILLISEC]
              [--randomize-script]
              [--script-log]
              [--bugreport]
              [--periodic-bugreport]
              [--permission-target-system]
              COUNT

3 Monkey的工作原理是什么?

  • 其工作原理是:利用socket通讯的方式来模拟用户操作,比如按键输入、触摸屏输入、手势输入等;
  • 再细化说(来源于网络总结):

1、runMonkeyCyles()获取事件,一个事件结束之后,通过调用getNextEvent()方法获取下一个事件;
2、从事件队列里面获取事件,需要组建事件队列MonkeyEventQueue,队列由MonkeyEvent构成;
3、MonkeyEvent通过command设计模式将具体的事件(如:MonkeyActivityEventMonkeyKeyEventMonkeyMotionEvent)通过injectEvent()方法逐一注入到系统。

4 Monkey的使用方法

4.1 测试指定app

4.1.1 参数说明

  • 使用-p参数即可;
  • 该参数主要是让monkey允许系统启动指定的app
  • 比如指定一个包,我们下载了一个支持安卓6.0的qq安卓6.0QQ

    4.1.2 错误排查

  • 使用命令安装后,如果提示以下信息:
Failure [INSTALL_FAILED_NO_MATCHING_ABIS]
  • 这是因为该APP和模拟器的CPU架构不一样,我这里修改了下模拟器的CPU架构为ARM的,之前创建的是X86架构的;
  • 换了新的架构后进入了系统,并且重新安装apk
adb install QQv5.apk /data/local/tmp
F:\monkey_test>adb install ls /data/local/tmp
Performing Push Install
adb.exe: need APK file on command line

F:\monkey_test>adb install QQv5.apk /data/local/tmp
Performing Push Install
QQv5.apk: 1 file pushed, 0 skipped. 11.8 MB/s (22506899 bytes in 1.817s)
        pkg: /data/local/tmp/QQv5.apk
        ver: /data/local/tmp
Success
  • 终于安装成功了,如下:
    在这里插入图片描述

    4.1.3 启动指定apk

  • 使用以下命令查看下安装的路径以及包的名字为com.tencent.mobileqqi
adb shell ls /data/data
com.android.smoketest
com.android.smoketest.tests
com.android.soundrecorder
com.android.statementservice
com.android.systemui
com.android.vpndialogs
com.android.wallpaper.livepicker
com.android.webview
com.android.widgetpreview
com.example.android.apis
com.example.android.livecubes
com.example.android.softkeyboard
com.svox.pico
com.tencent.mobileqqi
jp.co.omronsoft.openwnn
  • 使用monkey启动com.tencent.mobileqqi并做2个计数:
adb shell monkey -p com.tencent.mobileqqi 2
  • 如果想使用mokey随机启动某个apk并发送N个随机事件,使用:
adb shell monkey -p 包名 N

4.2 显示日志级别

4.2.1 参数说明

  • 使用-v参数,可反馈日志级别;
  • 日志级别有三个:
级别 参数 说明
Level0 -v 启动、测试完成、最终结果信息
Level1 -v -v 详细日志,每个Activity事件信息
Level2 -v -v -v 最详细日志

4.2.2 日志显示

  • Level0日志信息:
F:\monkey_test>adb shell monkey -p com.tencent.mobileqqi -v 2
:Monkey: seed=1701146443923 count=2
:AllowPackage: com.tencent.mobileqqi
:IncludeCategory: android.intent.category.LAUNCHER
:IncludeCategory: android.intent.category.MONKEY
// Event percentages:
//   0: 15.0%
//   1: 10.0%
//   2: 2.0%
//   3: 15.0%
//   4: -0.0%
//   5: -0.0%
//   6: 25.0%
//   7: 15.0%
//   8: 2.0%
//   9: 2.0%
//   10: 1.0%
//   11: 13.0%
:Switch: #Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;launchFlags=0x10200000;component=com.tencent.mobileqqi/com.tencent.mobileqq.activity.SplashActivity;end
    // Allowing start of Intent {
   
    act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.tencent.mobileqqi/com.tencent.mobileqq.activity.SplashActivity } in package com.tencent.mobileqqi
:Sending Touch (ACTION_DOWN): 0:(191.0,846.0)
  • Level1日志信息:
F:\monkey_test>adb shell monkey -p com.tencent.mobileqqi -v -v 2
:Monkey: seed=1701146536977 count=2
:AllowPackage: com.tencent.mobileqqi
:IncludeCategory: android.intent.category.LAUNCHER
:IncludeCategory: android.intent.category.MONKEY
// Selecting main activities from category android.intent.category.LAUNCHER
//   + Using main activity com.tencent.mobileqq.activity.SplashActivity (from package com.tencent.mobileqqi)
// Selecting main activities from category android.intent.category.MONKEY
// Seeded: 1701146536977
// Event percentages:
//   0: 15.0%
//   1: 10.0%
//   2: 2.0%
//   3: 15.0%
//   4: -0.0%
//   5: -0.0%
//   6: 25.0%
//   7: 15.0%
//   8: 2.0%
//   9: 2.0%
//   10: 1.0%
//   11: 13.0%
:Switch: #Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;launchFlags=0x10200000;component=com.tencent.mobileqqi/com.tencent.mobileqq.activity.SplashActivity;end
    // Allowing start of Intent {
   
    act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.tencent.mobileqqi/com.tencent.mobileqq.activity.SplashActivity } in package com.tencent.mobileqqi
Sleeping for 0 milliseconds
:Sending Key (ACTION_DOWN): 23    // KEYCODE_DPAD_CENTER
    // Allowing start of Intent {
   
    cmp=com.tencent.mobileqqi/com.tencent.mobileqq.activity.LoginActivity } in package com.tencent.mobileqqi
    // activityResuming(com.tencent.mobileqqi)
Events injected: 2
:Sending rotation degree=0, persist=false
:Dropped: keys=0 pointers=0 trackballs=0 flips=0 rotations=0
## Network stats: elapsed time=1915ms (0ms mobile, 0ms wifi, 1915ms not connected)
// Monkey finished
  • Level2日志信息:
F:\monkey_test>adb shell monkey -p com.tencent.mobileqqi -v -v -v 2
:Monkey: seed=1701146594293 count=2
:AllowPackage: com.tencent.mobileqqi
:IncludeCategory: android.intent.category.LAUNCHER
:IncludeCategory: android.intent.category.MONKEY
// Selecting main activities from category android.intent.category.LAUNCHER
//   - NOT USING main activity com.android.contacts.activities.PeopleActivity (from package com.android.contacts)
//   - NOT USING main activity com.android.dialer.DialtactsActivity (from package com.android.dialer)
//   - NOT USING main activity com.android.settings.Settings (from package com.android.settings)
//   - NOT USING main activity com.android.browser.BrowserActivity (from package com.android.browser)
//   - NOT USING main activity com.android.calendar.AllInOneActivity (from package com.android.calendar)
//   - NOT USING main activity com.android.deskclock.DeskClock (from package com.android.deskclock)
//   - NOT USING main activity com.android.email.activity.Welcome (from package com.android.email)
//   - NOT USING main activity com.android.camera.GalleryPicker (from package com.android.gallery)
//   - NOT USING main activity com.android.camera.Camera (from package com.android.camera)
//   - NOT USING main activity com.android.music.MusicBrowserActivity (from package com.android.music)
//   - NOT USING main activity com.android.messaging.ui.conversationlist.ConversationListActivity (from package com.android.messaging)
//   - NOT USING main activity com.example.android.apis.ApiDemos (from package com.example.android.apis)
//   - NOT USING main activity com.android.gesture.builder.GestureBuilderActivity (from package com.android.gesture.builder)
//   - NOT USING main activity com.android.widgetpreview.WidgetPreviewActivity (from package com.android.widgetpreview)
//   - NOT USING main activity com.android.backuptester.MainActivity (from package com.android.backuptester)
//   - NOT USING main activity com.android.calculator2.Calculator (from package com.android.calculator2)
//   - NOT USING main activity com.android.customlocale2.CustomLocaleActivity (from package com.android.customlocale2)
//   - NOT USING main activity com.android.development.Development (from package com.android.development)
//   - NOT USING main activity android.app.AliasActivity (from package com.android.development_settings)
//   - NOT USING main activity com.android.providers.downloads.ui.DownloadList (from package com.android.providers.downloads.ui)
//   - NOT USING main activity com.android.quicksearchbox.SearchActivity (from package com.android.quicksearchbox)
//   + Using main activity com.tencent.mobileqq.activity.SplashActivity (from package com.tencent.mobileqqi)
// Selecting main activities from category android.intent.category.MONKEY
//   - NOT USING main activity com.android.launcher3.Launcher (from package com.android.launcher3)
//   - NOT USING main activity com.android.settings.Settings$RunningServicesActivity (from package com.android.settings)
//   - NOT USING main activity com.android.settings.Settings$StorageUseActivity (from package com.android.settings)
// Seeded: 1701146594293
// Event percentages:
//   0: 15.0%
//   1: 10.0%
//   2: 2.0%
//   3: 15.0%
//   4: -0.0%
//   5: -0.0%
//   6: 25.0%
//   7: 15.0%
//   8: 2.0%
//   9: 2.0%
//   10: 1.0%
//   11: 13.0%
:Switch: #Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;launchFlags=0x10200000;component=com.tencent.mobileqqi/com.tencent.mobileqq.activity.SplashActivity;end
    // Allowing start of Intent {
   
    act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.tencent.mobileqqi/com.tencent.mobileqq.activity.SplashActivity } in package com.tencent.mobileqqi
Sleeping for 0 milliseconds
:Sending Trackball (ACTION_MOVE): 0:(0.0,-1.0)
    // Allowing start of Intent {
   
    cmp=com.tencent.mobileqqi/com.tencent.mobileqq.activity.LoginActivity } in package com.tencent.mobileqqi
    // activityResuming(com.tencent.mobileqqi)
Events injected: 2
:Sending rotation degree=0, persist=false
:Dropped: keys=0 pointers=0 trackballs=0 flips=0 rotations=0
## Network stats: elapsed time=5630ms (0ms mobile, 0ms wifi, 5630ms not connected)
// Monkey finished
  • 启动后的界面显示:
    在这里插入图片描述

    4.2.3 保存日志

  • 使用重定向的方法可以将日志保存到指定的目录,比如当前目录下:
adb shell monkey -p com.tencent.mobileqqi -v -v -v 2 > ./monkey_qq.log

在这里插入图片描述

4.2.4 错误排查

  • 关于ANR问题:日志中搜索ANR即可;
  • 关于崩溃问题:日志中搜索Exception
  • 正常执行:在monkey执行完后,在日志最后显示执行事件的次数和时间,且以monkey finished结束,表示执行完成;
    在这里插入图片描述

    4.3 跳过执行操作

    4.3.1 忽略异常崩溃

  • 使用--ignore-crashes参数可以忽略异常崩溃,这样monkey会执行完所有事件;
adb shell monkey -p com.tencent.mobileqqi -v > --ignore-crashes 2

4.3.2 忽略超时

  • 使用--ignore-timeouts可忽略程序超时,monkey不会因超时而停止运行;
adb shell monkey -p com.tencent.mobileqqi -v > --ignore-timeouts 2

4.3.3 忽略许可错误

  • 使用--ignore-security-exceptions可忽略许可错误,如证书、网络许可等;
adb shell monkey -p com.tencent.mobileqqi -v > --ignore-security-exceptions 2

4.4 事件参数

4.4.1 参数说明

  • 以-pct开头控制事件百分比的参数,针对不通的测试类型可以调整百分比;
    在这里插入图片描述

  • 有关事件参数说明如下(均表示百分比):

参数 说明
--pct-touch PERCENT 单击事件
--pct-motion PERCENT 直线滑动事件
--pct-trackball PERCENT 曲线滑动事件
--pct-syskeys PERCENT 导航栏(HomeBack等)
--pct-nav PERCENT 导航事件(上下左右)
--pct-majornav PERCENT 导航事件(返回、确认、菜单)
--pct-appswitch PERCENT Activity的启动比率
--pct-flip PERCENT 模拟器适用的事件
--pct-anyevent PERCENT 不常用事件,比如按键
--pct-pinchzoom PERCENT 多点手势缩放
--pct-permission PERCENT 权限事件

4.4.2 指定事件百分比

  • 直接在启动事件上加以上的参数即可;
  • 参数后直接加上数值(表示百分数):
adb shell monkey --pct-motion 40 -p com.tencent.mobileqqi 2

4.5 事件延迟

  • 使用--throttle可表示两个事件之间的延迟,单位ms
adb shell monkey --throttle 1000 -p com.tencent.mobileqqi 2

4.6 指定随机事件种子值

  • 使用-s参数表示产生随机事件种子值:
test01: adb shell monkey -p com.tencent.mobileqqi -s 50 2 
test02: adb shell monkey -p com.tencent.mobileqqi -s 50 2

4.7 终止进程

4.7.1 终止错误进程

  • 使用--kill-process-after-error终止执行错误的进程。

4.7.2 监控崩溃事件

  • 使用--monitor-native-crashes监控代码的崩溃事件。

4.7.3 停止monkey

  • 使用--wait-dbg停止执行中的monkey,直到有调试器相连为止。

5 一个实例

5.1 实例需求

  • 启动qq;
  • 实现3个事件操作;
  • 时间间隔2s;
  • 指定2个事件,占比为20%,30%;
  • 忽略异常、崩溃、超时;
  • 保存日志。

5.2 实例实现

  • 参数如下:
adb shell monkey -p com.tencent.mobileqqi --throttle 2000 --pct-touch 20 --pct-motion 30 -v -v -v -s 50 --ignore-crashes --ignore-timeouts --ignore-security-exceptions 3 > ./test.log
:Monkey: seed=50 count=3
:AllowPackage: com.tencent.mobileqqi
:IncludeCategory: android.intent.category.LAUNCHER
:IncludeCategory: android.intent.category.MONKEY
// Selecting main activities from category android.intent.category.LAUNCHER
//   - NOT USING main activity com.android.contacts.activities.PeopleActivity (from package com.android.contacts)
//   - NOT USING main activity com.android.dialer.DialtactsActivity (from package com.android.dialer)
//   - NOT USING main activity com.android.settings.Settings (from package com.android.settings)
//   - NOT USING main activity com.android.browser.BrowserActivity (from package com.android.browser)
//   - NOT USING main activity com.android.calendar.AllInOneActivity (from package com.android.calendar)
//   - NOT USING main activity com.android.deskclock.DeskClock (from package com.android.deskclock)
//   - NOT USING main activity com.android.email.activity.Welcome (from package com.android.email)
//   - NOT USING main activity com.android.camera.GalleryPicker (from package com.android.gallery)
//   - NOT USING main activity com.android.camera.Camera (from package com.android.camera)
//   - NOT USING main activity com.android.music.MusicBrowserActivity (from package com.android.music)
//   - NOT USING main activity com.android.messaging.ui.conversationlist.ConversationListActivity (from package com.android.messaging)
//   - NOT USING main activity com.example.android.apis.ApiDemos (from package com.example.android.apis)
//   - NOT USING main activity com.android.gesture.builder.GestureBuilderActivity (from package com.android.gesture.builder)
//   - NOT USING main activity com.android.widgetpreview.WidgetPreviewActivity (from package com.android.widgetpreview)
//   - NOT USING main activity com.android.backuptester.MainActivity (from package com.android.backuptester)
//   - NOT USING main activity com.android.calculator2.Calculator (from package com.android.calculator2)
//   - NOT USING main activity com.android.customlocale2.CustomLocaleActivity (from package com.android.customlocale2)
//   - NOT USING main activity com.android.development.Development (from package com.android.development)
//   - NOT USING main activity android.app.AliasActivity (from package com.android.development_settings)
//   - NOT USING main activity com.android.providers.downloads.ui.DownloadList (from package com.android.providers.downloads.ui)
//   - NOT USING main activity com.android.quicksearchbox.SearchActivity (from package com.android.quicksearchbox)
//   + Using main activity com.tencent.mobileqq.activity.SplashActivity (from package com.tencent.mobileqqi)
// Selecting main activities from category android.intent.category.MONKEY
//   - NOT USING main activity com.android.launcher3.Launcher (from package com.android.launcher3)
//   - NOT USING main activity com.android.settings.Settings$RunningServicesActivity (from package com.android.settings)
//   - NOT USING main activity com.android.settings.Settings$StorageUseActivity (from package com.android.settings)
// Seeded: 50
// Event percentages:
//   0: 20.0%
//   1: 30.0%
//   2: 1.3333334%
//   3: 10.0%
//   4: -0.0%
//   5: -0.0%
//   6: 16.666668%
//   7: 10.0%
//   8: 1.3333334%
//   9: 1.3333334%
//   10: 0.6666667%
//   11: 8.666667%
:Switch: #Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;launchFlags=0x10200000;component=com.tencent.mobileqqi/com.tencent.mobileqq.activity.SplashActivity;end
    // Allowing start of Intent {
   
    act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.tencent.mobileqqi/com.tencent.mobileqq.activity.SplashActivity } in package com.tencent.mobileqqi
Sleeping for 2000 milliseconds
:Sending Trackball (ACTION_MOVE): 0:(-2.0,-3.0)
:Sending Trackball (ACTION_MOVE): 0:(-4.0,-4.0)
Events injected: 3
:Sending rotation degree=0, persist=false
:Dropped: keys=0 pointers=0 trackballs=0 flips=0 rotations=0
## Network stats: elapsed time=2732ms (0ms mobile, 0ms wifi, 2732ms not connected)
// Monkey finished
相关实践学习
日志服务之使用Nginx模式采集日志
本文介绍如何通过日志服务控制台创建Nginx模式的Logtail配置快速采集Nginx日志并进行多维度分析。
目录
相关文章
|
15天前
|
芯片
LDO的原理及测试方法
一、基本结构 这是LM317芯片的核心,这个电路单元称为Bandgap Reference带隙基准源。属于模拟集成电路中的经典电路结构。 LDO拓扑结构图 常见的基本结构 利用VBE的负温度系数,而VT是正温度系数,正负温度系数抵消就的得到稳定的基准参考电压了(三极管的方程VBE=VT*In(lC/IS))。 二、测试意义 了解集成电路的内部结构对测试有意义么? 1、了解内部结构,才能更好的理解测试原理或者设计测试方案2、可以学习提升对电路结构的理解能力。 针对LM317,了解了内部简单原理,可以知道1、内部结构设计针对的是温度系数,因此可能受温度的影响,实际也是会受到温度的影
157 88
|
8天前
|
测试技术
测试用例设计方法之基本路径测试法
基本路径测试法是在程序控制流图的基础上,通过分析控制构造的环路复杂性,导出基本可执行路径集合,从而设计测试用例的方法,设计出的测试用例要保证在测试中程序的语句覆盖100%,条件覆盖100%
20 7
测试用例设计方法之基本路径测试法
|
8天前
|
移动开发 JSON Java
Jmeter实现WebSocket协议的接口测试方法
WebSocket协议是HTML5的一种新协议,实现了浏览器与服务器之间的全双工通信。通过简单的握手动作,双方可直接传输数据。其优势包括极小的头部开销和服务器推送功能。使用JMeter进行WebSocket接口和性能测试时,需安装特定插件并配置相关参数,如服务器地址、端口号等,还可通过CSV文件实现参数化,以满足不同测试需求。
53 7
Jmeter实现WebSocket协议的接口测试方法
|
7天前
|
敏捷开发 数据可视化 Devops
敏捷测试价值观、方法和实践读书笔记(4)
本章节探讨了敏捷测试执行的关键概念与实践。首先介绍了用户故事及其重要性,强调其在敏捷开发中的角色,并阐述了用户故事的 INVEST 原则。接着分析了用户故事生命周期中的测试关注点,包括定义、处理、完成及验收阶段的测试活动。此外,还对比了不同测试术语的差异,并提供了敏捷测试计划的策略与过程。通过看板等工具实现任务管理与跟踪,确保测试活动高效进行。最后,介绍了敏捷测试中的度量指标,帮助团队评估测试效果。
17 5
敏捷测试价值观、方法和实践读书笔记(4)
|
7天前
|
监控 架构师 Devops
敏捷测试价值观、方法和实践读书笔记(3)
本章节介绍敏捷测试转型框架,涵盖模型概览、实施难度与顺序、文化转变、角色技能需求及测试流程。敏捷测试转型模型包括文化、组织、流程与实践等关键要素,并针对各层面提出具体实施建议与障碍解决方案。此外,详细阐述了不同敏捷测试角色的技能需求与职责,以及从Sprint内至跨Sprint的测试流程与交付物。
16 5
敏捷测试价值观、方法和实践读书笔记(3)
|
7天前
|
开发框架 数据可视化 项目管理
敏捷测试价值观、方法和实践读书笔记(1)
敏捷软件开发宣言在身体力行的同时也帮助我们一直在实践中探寻更好的软件开发方法。由此,我们建立了如下价值观:个体和互动 高于 流程和工具工作的软件,高于 详尽的文档客户合作, 高于 合同谈判响应变化,高于 遵循计划。也就是说,尽管右项有其价值,但我们更重视左项的价值。
29 4
敏捷测试价值观、方法和实践读书笔记(1)
|
7天前
|
JavaScript 前端开发 Java
敏捷测试价值观、方法和实践读书笔记(5)
本章节介绍了敏捷功能测试的原则与实践,包括单元测试的概念及其编写步骤,测试驱动开发(TDD)的流程,以及如何通过模拟对象进行测试。详细讲解了单元测试的编写方法,如初始化对象、执行操作及验证结果,并探讨了 TDD 的五个步骤。通过具体案例展示了如何逐步完善储蓄账户的功能测试,包括存款、取款及异常处理。此外,还讨论了代码覆盖率的重要性及其局限性,强调了测试充分性比单纯追求代码覆盖率更为关键。
14 3
敏捷测试价值观、方法和实践读书笔记(5)
|
1天前
|
测试技术
基于LangChain手工测试用例转App自动化测试生成工具
在传统App自动化测试中,测试工程师需手动将功能测试用例转化为自动化用例。市面上多数产品通过录制操作生成测试用例,但可维护性差。本文探讨了利用大模型直接生成自动化测试用例的可能性,介绍了如何使用LangChain将功能测试用例转换为App自动化测试用例,大幅节省人力与资源。通过封装App底层工具并与大模型结合,记录执行步骤并生成自动化测试代码,最终实现高效自动化的测试流程。
11 4
|
7天前
|
机器人 测试技术
敏捷测试价值观、方法和实践读书笔记(6)
验收测试驱动开发(ATDD)强调在开发前定义验收标准,并通过自动化测试确保用户价值得到满足。验收测试关注用户需求是否实现,而非代码细节。ATDD涉及用户、产品负责人、开发人员及测试人员,通过讨论、开发和交付三个阶段,确保产品符合预期。此方法有助于团队更好地理解和实现用户需求。
17 5
|
7天前
|
敏捷开发 测试技术
敏捷测试价值观、方法和实践读书笔记(2)
本章节介绍敏捷测试在快速变化的软件开发环境中的重要性。传统测试方法在敏捷环境中面临时间紧迫、文档不足、频繁变更及资源短缺等挑战。敏捷测试遵循敏捷开发原则,强调测试与开发的紧密融合、团队协作及业务价值交付。其特点包括更强的协作、更短的周期、更灵活的计划及高效的自动化。相较于传统测试,敏捷测试具有加快产品上市时间、提升整体质量及简化流程降低成本的优势。
13 3