使用idea编写自动化测试_刚开始时编写自动测试的实用技巧

使用idea编写自动化测试

When first starting to write automated tests, you may notice that you’re getting too bogged down by the nuances of the code, and it may be challenging to see the bigger picture. You may notice that often lost track of where you were when you have had to context switch to another task.

刚开始编写自动化测试时,您可能会发现您对代码的细微差别感到迷惑不解,并且可能很难看清大局。 您可能会注意到,当您不得不上下文切换到另一个任务时,常常会迷失您的位置。

Well, fear not, some strategies have helped me to write tests faster, and I am sharing them with you.

好吧,不用担心,某些策略帮助我更快地编写了测试,并且正在与您共享它们。

1.列出所有需要验证的项目 (1. Make a list of all of the items that need to be verified)

Manual testers make lists called a Test Checklist of the features that they will be testing to keep their thoughts organized. You can employ this strategy too to plan your tests. List everything that you think will need to be automated. Think of positive, negative scenarios, are there any edge cases that you may not have found?

手动测试人员会列出要测试的功能的列表,称为测试检查表,以保持思想的井井有条。 您也可以采用此策略来计划测试。 列出您认为需要自动化的所有内容。 想想积极的,消极的情况,您可能没有发现任何极端情况吗?

2.查看要测试的项目列表 (2. Review the list of items to be tested)

Before writing any code that runs an automated test, take the time to review the test cases that you’ve written in your test checklist. Are the items in your test checklist meaningful from a user’s perspective? Is it practical? When you take the time to review your test cases, you may detect gaps in your test coverage before writing a single line of automation code.

在编写运行自动化测试的任何代码之前,请花点时间查看您在测试清单中编写的测试用例。 从用户的角度来看,测试清单中的项目是否有意义? 实用吗? 当您花时间检查您的测试用例时,您可能会在编写一行自动化代码之前检测到测试范围的空白。

3.在深入了解代码之前,编写测试所需的类和方法的存根 (3. Write stubs of classes and methods needed by your tests before getting too deep in the code)

Start with a single test and then write the names of classes and the functions that will be required to complete the use case that you are automating. Use this moment to get your thoughts organized before actually coding.

从单个测试开始,然后编写完成自动化用例所需的类和功能的名称。 在实际编码之前,请利用这一时刻来整理您的想法。

4.编码时运行自动化测试 (4. Run the automated tests while coding)

Keep running the run automated test as you code so that you can easily verify that you have not broken any of your previous tests.

在编写代码时,请继续运行自动运行测试,以便您可以轻松地验证自己没有破坏以前的任何测试。

翻译自: https://medium.com/swlh/practical-tips-for-writing-automated-tests-when-youre-just-starting-out-58d2fdadc9e5

使用idea编写自动化测试

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值