Unfortunately, code coverage testing only makes sure you're executing all the code you'd like to test.
不幸的是,代码覆盖测试只能确保您想要测试的所有代码得到执行。
Theoretically, if you write code only to satisfy an existing test, then by definition you can achieve coverage for every line of code you write.
理论上说,如果为满足现有的测试而撰写代码,那么您肯定能够实现对您所写的每行代码的覆盖。
Theoretically, if you write code only to satisfy an existing test, then by definition you can achieve coverage for every line of code you write.
理论上说,如果为满足现有的测试而撰写代码,那么您肯定能够实现对您所写的每行代码的覆盖。
In general, though, if code coverage data is gathered during a successful test run, the information can be stored for later use as an indication of tested function.
总的来说,尽管,如果代码覆盖数据是在成功的测试运行过程中收集的,那么此信息可以存储起来随后作为测试的功能的指示。
In terms of how much of the code to test, on previous projects we hadn.t aimed for 100% code coverage in our software.
在代码测试的次数方面,在之前的项目中我们没有打算在我们的软件中进行 100% 代码覆盖率的测试。
As the test material is run against it, the code coverage tool USES these hooks to log the journey each test takes as it executes.
当测试材料遇到这些钩子时,代码覆盖工具使用这些钩子来记录每个测试在其执行时所经历的过程。
Full coverage was very expensive and difficult to achieve, because we had to hand-inspect our code to determine which lines were and were not hit by the test.
完全的覆盖是非常昂贵的并且很难达到,因为我们必须要手工的检查我们的代码以确定哪一行代码没有被测试覆盖到。
This tool enabled us to monitor the coverage provided by our tests and then decide whether to improve the tests or test the code through manual inspection instead.
这个工具能够使我们观测我们提供的代码覆盖测试,然后决定是改进测试还是通过手工检查的方法来测试代码。
Better still, I can open a coverage file in my browser and see exactly which lines of code my test cases cover.
更妙的是,我可以在浏览器中打开一个覆盖率文件并查看测试用例所覆盖的代码行。
Test Coverage: Percent of the code that has been tested.
测试覆盖率:代码被测试过的百分比。
As you can see, using a code coverage tool can uncover important code that doesn't have a corresponding test case.
正如您看到的,使用一个代码覆盖工具可以揭露重要的没有相应测试案例的代码。
Therefore, knowing whether code has been tested, and seeing the actual test coverage Numbers, can allow developers and managers to more accurately predict the time needed to modify existing code.
因此,知道代码有没有被测试,并看看实际的测试覆盖数值,可以让开发人员和管理人员更准确地预知修改已有代码所需的时间。
Coverage analysis also helps find out if there are any redundant test cases: tests that exercise the same path in the code over and over again, causing unnecessary delays.
覆盖率分析也可以帮您找到测试用例是否有冗余:测试在代码的同一路径下反复运行,导致了不必要的时间延迟。
Code coverage tools give you one way to measure test completeness.
代码覆盖工具为您提供了一种度量测试完整性的方法。
Change in test code: a test case that you added to improve code coverage may be causing the slowdown, possibly exercising a peculiar portion that is vulnerable to speed.
测试代码的变更:您增加的用来改善代码覆盖率的测试用例可能导致变慢,也有可能这部分代码特别容易影响速度。
Furthermore, well-written application classes can easily be unit tested by providing stub implementations of the injected objects, improving test coverage and code quality.
此外,通过提供被注入对象的存根实现、改进测试覆盖率和代码质量,可轻松对编写良好的应用程序类执行单元测试。
The four steps to this combination test method are: test selection, system resource utilization evaluation, kernel code coverage analysis, and final stress test evaluation.
这一组合测试方法的四个步骤是:测试选择、系统资源利用率评价、内核代码覆盖分析以及最终的压力测试评价。
And you can combine utilities that automatically track code changes, trace test coverage, submit defects, inspect code profiles and memory usage, and so forth.
你还可以结合一些应用,它们可以自动跟踪代码的变化,跟踪测试覆盖,提交错误,检查代码外形和存储使用,等等。
The motivation behind coverage tooling is simply to give you (as a developer or tester) more insight into the areas of code that are being exercised by a set of test cases.
覆盖工具背后的动机向您(作为开发员或者测试员)提供了关于代码的一系列观点,这些代码在一系列的测试之中会得到检查。
A test coverage measurement is obtained by exercising a code base with a test harness and capturing data that corresponds to code having been "touched" throughout the lifetime of the test process.
通过用一个测试工具执行代码库并捕获整个测试过程中与被“触及”的代码对应的数据,就可以获得测试覆盖度量。
A code coverage tool reports test coverage — either in the form of line or branch coverage — that represents the amount of code that is being touched when a test is run.
代码覆盖工具可报告测试覆盖率——以行覆盖或分支覆盖形式表示——它表示测试运行时所涉及的代码量。
Code coverage indicated we were done after one test case, but CC forced us to write an additional one.
代码覆盖率指示我们已经在一个测试用例之后完成了此操作,但CC却会强迫我们编写额外的测试用例。
Because we overrode the factory method to write this test, it turns out that we no longer have any test coverage of the original creation code (which is now inside the base class's factory method).
因为我们覆盖了工厂方法来编写这个测试,所以其结果是:我们的测试不再包括任何原始创建代码(现在它在基类的工厂方法内部)。
The trick to test coverage measurement is to use the coverage report to expose code that hasn't been tested, on a micro level and on a macro level.
测试覆盖度量的窍门是使用覆盖报告找出未经测试的代码,分别在微观和宏观两个级别。
From a parameterized unit test, it automatically produces a traditional unit test suite with high code coverage.
它可以从一个参数化的单元测试中自动生成一个传统的单元测试集,而且有很好的代码覆盖率。
Problem has been found for which no test exists: code coverage.
发现的问题没有被测试过:代码覆盖率问题。
In non-legacy environment and for new code within a legacy environment though, his answer is much different; in this case, high automated test coverage speeds you up. His reasons why.
针对非遗留环境和遗留环境的新代码,他的答案则相反,在这种情况下,高度自动化的测试覆盖会提升你的速度。
The test above was run as a simple JUnit test without code coverage.
以上测试是作为简单的JUnit测试运行的,没有代码覆盖。
Drew to Jeff: "we're drawing up test cases for the next release and we noticed large swaths of code with basically no code coverage."
Drew对Jeff说:“我们为下一个版本编写了测试案例,我们注意到很多代码没有被覆盖。”
Once every method has at least one test, use a code coverage tool, such as Cobertura, to write one test for every branch until each line of code is tested.
当每个方法都有了至少一个测试,使用一个代码覆盖率工具如cobertura为每个分支编写一个测试,直到每一行代码都能够被测试。
应用推荐