译——人工智能是否是测试的未来?

2020-10-10  海鹅 

Software development has already undergone an important journey from its beginnings to test automation and continuous testing. As time progresses, however, it is certain that testing will have to evolve as well. With digital transformations and the drive towards DevOps, automated testing is now at the heart of software testing and has taken the lead in the development process.

软件的发展从开始到自动化测试和持续测试已经走过了一个重要的旅程。时间的流逝,测试也会同样的演变是毋庸置疑的。随着数据的变革和开发运维驱动,自动化测试现在已经是软件测试的核心,并且在发展的进程中处于领先地位。

Artificial Intelligence (AI) seems to be the future of testing. AI has created high hopes in software testing and test automation and the advancements in AI allow organizations to transform their processes and make progress. With a future driven by robotics, IoT, and quantum computing, AI seems to be the key to change.

 人工智能(AI)似乎成为了测试的未来。人工智能已经在软件测试和自动化测试领域给与了极高的期望,人工智能的发展使得一些组织变革他们的流程,取得进步发展。在机器人,物联网和量子计算驱动的未来里,人工智能似乎是变革的关键。

AI in Testing

测试中的人工智能

AI in Testing can be used in different ways. One straightforward case is using AI in generating unit tests. AI can help with static analysis of the software in order to know which areas of the code unit tests haven’t treated. The tool can then use this information to create unit tests for uncovered code and provide input for these unit tests. With an AI-driven tool, it makes generating unit tests easier, as these tests don’t require any setup or interactions with other components.

人工智能在测试中有不同的使用方式。一个直接例子是用人工智能做单元测试。人工智能进行静态分析以发现单元测试代码无法被处理的区域。这个工具能使用这个消息,针对没有覆盖到的代码创建单元测试,并且为这些单元测试提供输入。使用人工智能驱动的工具,进行单元测试更便捷,因为这些测试不需要任何的设置或者和其他组件交互。

In the future, AI will be able to update these unit tests as soon as the source code changes, and thus, maintain unit tests. This also means that developers will spend less time on test maintenance.

在将来,人工智能将能够随着源代码的更改立刻更新这些单元测试,以此来维护单元测试。这也意味着开发人员将花费较少的时间在测试维护上。

But the AI requires training to know what pieces of code need stubbing or mocking in order to isolate them. Thus, the AI needs to learn to determine dependencies – a process that takes a lot of time to teach. Once the AI has been trained properly, it will be able to save developers so much time in unit test creation.

但是人工智能需要训练以让它知道哪些代码需要stub和mock以隔离他们。因此,人工智能需要学习决定依赖——这是一个需要耗费大量时间教学的过程。一旦人工智能得到正确的训练,它就能够在单元测试创建中为开发人员节省大量的时间。

For Application Programming Interface (API) Test generation, the AI has to understand the patterns and relationships in the different API calls made while exercising the UI. Following that analysis, the AI can create a series of API calls and provide parameters to test. Moreover, AI can also generate more advanced patterns and inputs for testing the API by studying the behavior of users.

对于应用程序接口(API)测试的生成,人工智能需要理解不同的接口命令之间的模式和关系,当执行UI的时候。经过分析,人工智能能够创建一系列的接口命令并且提供要测试的参数。此外,人工智能也能通过学习用户行为为接口测试生成更多高级的模式和输入。

AI and Machine Learning (ML)’s tools can enhance the authoring, execution, and maintenance of automated tests. These tools emphasize end-to-end testing and user interface testing; and the more they are used; the smarter they become and in time, increase the stability of test suites.

人工智能和机器学习工具能强化自动化测试的创作、执行和维护。这些工具强调端到端的测试以及用户交互测试;使用得越多它们就变得更聪明,与此同时还能增加测试套件的稳定性。

Benefits of AI in Testing

人工智能测试的优势

AI has a lot to give to Testing. With AI, Testing becomes error-free and simple. With the new algorithms and tools, software developers spend less time writing tests and examine the data. AI has the ability to sort through log files and improve the accuracy of specific programs in order to save time. The data generated give developers an insight into what areas of testing need to be fixed, hence spending less time running the actual tests and speeding up the development cycle. The new algorithms also prevent future errors or complications thus improving the efficiency of the tests.

人工智能对测试有诸多帮助。使用人工智能,测试能实现无差错和简化。使用新的算法和工具,软件开发人员花费更少的时间写测试代码和验证数据。为了节省时间,人工智能拥有通过日志文件分类和提高特定程序准确性的能力。数据的产生使开发人员能洞悉哪些测试区域需要修复,因此使用较少时间运行实际的测试并且缩短了开发周期。新的算法也规避了将来的错误或复杂的情况以提高了测试的效率。

Moreover, AI helps optimize the test suite by clearing the backlog and enable focus on the tests. AI can identify the redundant and unique test cases, hence, eliminating the duplicates and improving traceability.

除此之外,人工智能通过清洗返回日志和专注于测试,优化了测试套件。它能识别冗余的和唯一的测试案例,从而消除重复并且改善可追溯性。

AI is also able to identify defects early on in the development process and avoid it in the future. By finding faults quicker, developers can prioritize regression test cases based on the identified errors.  Furthermore, by using the information generated by the AI, testers can detect and eliminate bugs as soon as they appear. AI is constantly testing to clear-out excessive bugs from programs.

人工智能也能在开发过程中更早的识别缺陷以达到未来规避该缺陷的效果。通过更快地发现缺陷,开发人员能够基于已验证的错误优先做回归测试。并且,通过使用人工智能生成的信息,测试人员能在bug出现的时候迅速检测并且消除bug。人工智能一直在持续测试以清除运行中的程序bug。

Finally, AI can be used to analyze test results, identify flaws, and predict the quality. It uses this data to predict the key parameters of procedures and authorize the best course of action. Hence, it will be able to spot the crucial, critical, and less obvious faults.

最后,人工智能可以用于分析测试结果,识别缺陷并预测质量。它使用这些数据去预测程序的关键参数并且批准最佳操作。因此它将能够发现一些重要的、关键的和不怎么明显的缺陷。

All in All, AI generates more advanced test cases that enhance the quality of the software and, in the long run, help save time and money as it reduces the testing cycle.

总之,人工智能生产出更多高级的测试用例,加强了软件的质量,从长期来看,因为它能缩短测试周期,所以节约了时间节省了金钱。

However, AI cannot be applied to every type of testing. Indeed, testing types such as integration tests, which are harder to generate and require more advanced setup and complex flow.

然而,人工智能并不能用于所有类型的测试。实际上,像集成测试这样的测试类型更难生成,需要更高级的设置和复杂的流程。


Conclusion

结论

In the future, AI will have a significant impact on the quality function with benefits that go from superior quality to a quicker time to market, better optimization, coverage, traceability, and important savings on the costs of development. However, AI has still a long way to go to be completely ready to take over in software testing.

在将来,人工智能将会产生意义深远的影响,其好处将包括卓越的质量,更快地上市,更好的优化,覆盖范围更广,更好的可追溯性以及可节省的开发成本。但是,人工智能要完全准备好接手软件测试还有很长的路要走。

龙测科技,自动化测试AI驱动,我们在行动。

http://www.dragontesting.cn

54°|542 人阅读|0 条评论
登录 后发表评论