简体   繁体   中英

How can I check if test are tested in testsuite?

We want to teach student to make test with JUnit.

But we have a lot of student, so we want a program which automatically verify if they test a series of tests.

For example, if we have a program which add two Integer, we want to check if they test normal case, with String ...

Do you have any idea how I can do that ?

The closest thing that comes to mind is to use Jacoco to check the code coverage. You can either:

  • run it as part of an IDE like eclipse (eg Using ECLEmma plugin) or

  • programmatically

In both cases you can just navigate the report to check complete coverage or coverage per class. Alternatively you can programmatically check the coverage percentages and pass just the ones above a certain %.

It goes without saying that high coverage doesn't necessarily mean that tests are well written.

.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM