JS代码覆盖率 [英] JS Code coverage

查看:123
本文介绍了JS代码覆盖率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是测试场景的新手。
我有一个问题想请教。

I am a newbie for the testing scenario. I have one question wanna ask your help.

例如,如果我有一个通过HTML,JS和CSS实现并调用其他API的Web应用程序。
在测试此Web应用程序时,在进行功能测试时如何测量浏览器中HTML / JS / CSS浏览器应用程序中的代码覆盖率?是否有任何Javascript插件可以查看测试期间正在运行多少客户端代码?

For example, if I have one web application which implemented from HTML, JS and CSS and calls other APIs. While this web application is being tested, how to measure "code coverage" in an HTML/JS/CSS browser application IN THE BROWSER when doing functional testing? Any Javascript plugins to see how much of the client code was running during the tests?

提前谢谢您的建议。

推荐答案


代码覆盖率

"code coverage"

,因为您的问题有点难以理解。

as your question is a little hard to understand.

但是我假设您所指的是某种形式的可视化工具,例如,可让您逐步查看代码的执行方式以及行为原因就像在给定程序中一样。至于为您概述的目的而存在的浏览器插件或工具,我不知道可以实现我认为想要的功能。话虽这么说,但您对问题的措辞方式有点奇怪,对您的问题进行一些澄清将有助于我或其他人更好地回答您的问题。

But I'm assuming you are referring to some form of visualizer like this one that allows you to see step by step how your code is being executed and why it behaves as it does in a given program. As to a browser plugin or tool existing for the purpose you outline I am not aware of one that can achieve what it is I think you want. That being said, the way you phrased your question is a little strange and some clarification would go a long way to help me or someone else better answer your question.

您可能会参考代码覆盖率的实际概念,该百分比是指运行测试时或多或少的代码量(Franci Penov在解释此处)。 Google Chrome在浏览器中进行CSS和JS代码覆盖(至少根据这些发行说明)。

On the other more likely hand, you refer to the actual concept of code coverage, a percentage that refers to more or less the amount of code run when tests are being run (Franci Penov does a much better job explaining here). Google Chrome does CSS and JS code coverage in-browser (at least according to these release notes).

这是Javascript代码覆盖率测试工具的链接

我希望我对此问题的了解能有所帮助!

I hope my very shaky understanding of this issue helps!

这篇关于JS代码覆盖率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆