只要从生成的c中复制并粘贴相关函数,添加有魔力的覆盖行并编辑该代码,直到它如您所愿。
Simply copy and paste the relevant function from the generated c, add the magic override line, and edit the code until it does what you want.
这表明行覆盖的确不能很好地指示测试的有效性。
It turns out that line coverage isn't such a great indicator of test effectiveness.
与行覆盖一样,如果在特定方法中有两个分支,并且两个分支在测试中都被覆盖,那么您可以说这个方法有100%的分支覆盖率。
Just like line coverage, if there are two branches in a particular method and both were covered through tests, then you could say the method has 100% branch coverage.
完全的覆盖是非常昂贵的并且很难达到,因为我们必须要手工的检查我们的代码以确定哪一行代码没有被测试覆盖到。
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.
更妙的是,我可以在浏览器中打开一个覆盖率文件并查看测试用例所覆盖的代码行。
Better still, I can open a coverage file in my browser and see exactly which lines of code my test cases cover.
诸如评论之类的非执行行不会被注释,并不会对代码行覆盖率百分比的计算产生影响。
Non-executable lines such as comments are not annotated and do not contribute to the calculation of the line coverage percentage.
存在不同类型的覆盖度量,但是绝大多数的工具会关注行覆盖,也叫做语句覆盖。
There are different types of coverage measurements, but most tools focus on line coverage, also known as statement coverage.
您可以通过许多方法来测量代码覆盖率:通过评估代码行或语句的覆盖面、条件覆盖面、分支覆盖面等等。
You can measure code coverage in several ways: by assessing line or statement coverage, condition coverage, branch coverage, and so on.
这个工具分析内核代码的覆盖率,并报告哪些行、函数和分支被覆盖以及它们被访问了多少次。
This tool analyzes the coverage of the kernel, and reports what lines, functions, and branches are covered and how many times they were hit.
它提供了一系列工具用来显示内存泄漏和性能瓶颈,并提供对每一行代码进行代码覆盖的策略。
It offers a suite of utilities that exposes memory leaks and performance bottlenecks, and provides code coverage statistics down to individual lines of code.
也就是,默认条件下,绿色的行是覆盖的而红色的则不是覆盖的。
That is, by default a green line was covered and a red line was not covered.
该报告列出了哪一个源文件的代码行覆盖率百分比,低于特定的最低阀值水平。
This report lists the source files whose percentage of line coverage are lower than a specified minimum threshold level.
当在源代码中有不止一个的可执行单元时就会产生部分覆盖的行,但是它们中只有一个可以被执行。
Partially covered lines can occur when there is more than one executable unit on a line of source code, but only one of them has been executed.
这样可以识别在项目整个运行时间中覆盖较少范围的区域,可以显示测试的什么位置需要按行展开有代码变更和增添新特征的区域。
This can identify areas of the project that achieve less coverage over time, to show where testing needs to expand in line with code changes and added features.
在图4的报告中显示我达到了 75% 的行覆盖率和 100% 的分支覆盖率。
The report in Figure 4 shows that I've achieved 75% line coverage and 100% branch coverage.
这个过程在总体层次上也工作得很好:如果一个类有100行代码,其中的45行被触及,那么这个类的行覆盖率就是45%。
The process works at the aggregate level as well: If a class has 100 lines and 45 of them were touched, then the class has a line coverage of 45%.
代码覆盖工具可报告测试覆盖率——以行覆盖或分支覆盖形式表示——它表示测试运行时所涉及的代码量。
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.
请注意行覆盖和分支覆盖的百分比是以包计算的。
软件包的代码行增加了,但是没有为新代码编写相应的测试(或者是新增加的测试不能有效地覆盖新代码)。
The package grew in terms of lines of code, but no corresponding tests were written for the new code (or that newly added tests do not effectively cover the new code).
如果一个方法有10行代码,其中的8行在测试中被执行,那么这个方法的行覆盖率是80%。
If a method is 10 lines long and 8 lines of the method were exercised in a test run, then the method has a line coverage of 80%.
当每个方法都有了至少一个测试,使用一个代码覆盖率工具如cobertura为每个分支编写一个测试,直到每一行代码都能够被测试。
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.
行覆盖率:类文件中覆盖的行百分比。
Line coverage: the percentage of lines covered in the class file.
然而,因为HierarchyBuilder的构造器是private类型的,所以我不能通过我的测试类测试它(我也不关心)。因此,我的行覆盖率仍然只有88%。
HierarchyBuilder's constructor is private, however, so I can't test it via my test class (nor do I care to); therefore, my line coverage still hovers at 88%.
对于最后一行,可以使用 $表示文件的末尾。 可以在w 后面使用两个大于号(>>)表示希望把内容附加到文件中而不是覆盖文件。
You can use the $ notation for the last line to specify to the end of the file and double greater-than symbols (>>) after the w to indicate that you want to append to rather than overwrite the file.
最基本的一种方式是覆盖此网格select编辑器的格式化程序来返回针对所选行的选项信息。
Minimally, you can override the formatter for the grid select editor to return option information for the selected row.
同样,如果一个代码库包含10000个非注释性的代码行,在特定的测试运行中有3500行被执行,那么这段代码的行覆盖率就是35%。
Likewise, if a code base comprises 10,000 non-commenting lines of code and 3,500 of them were exercised on a particular test run, then the code base's line coverage is 35%.
第二行使用overlay . xul(清单2)对主浏览器chrome建立一个覆盖。
The second line establishes an overlay on the main browser chrome using overlay.xul (Listing 2).
额外的行和列可以添加或删除从电网直到大部分的图像覆盖。
Additional rows and columns can be added or removed from the grid until most of the image is covered.
项目设计了一个白色混凝土顶盖体量和覆盖在旧花岗岩石墙上作为花架的木板,混凝土顶盖上还设有首行七个骨灰龛。
The project is solved with a volume of white concrete formworked with wood boards over the old granite stoned wall as apergola , containing the first row of seven columbarium.
项目设计了一个白色混凝土顶盖体量和覆盖在旧花岗岩石墙上作为花架的木板,混凝土顶盖上还设有首行七个骨灰龛。
The project is solved with a volume of white concrete formworked with wood boards over the old granite stoned wall as apergola , containing the first row of seven columbarium.
应用推荐