课程: Java for All Platforms: Desktop, Web, and Mobile Development
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Coverage
- Another useful tool when talking about testing and debugging is coverage. Coverage allows you to see the percentage of your code that is covered by your unit tests. This can show you where you may have a gap in checking your logic in your tests. So let's run this with coverage to see how it works. So I'm going to right-click the tab here, and then choose run numberHelperTest with Coverage. Note that you can get to the same menu by clicking this button and then choosing run a single method with coverage. So we'll run the whole class with coverage right here, and then once it's done, this coverage menu opens up. So if I find my class, which is numberHelper, I can see that 100% of the classes in there are covered, 100% of the methods are covered, and 100% of the lines are covered. And if I go into my numberHelper class again, I can actually see this green line right here, which tells me that that line of code is covered by…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。