1

Since it is very hard for a beginner to code a test case covering all points, I decided to code many test cases. Each test case can cover some coverage points. Combining all the cases into a coverage report, all the coverage points can be hit.

I want to know if it is acceptable in a real work environment?

toolic
  • 57,801
  • 17
  • 75
  • 117
benjstark
  • 83
  • 4
  • 1
    Yes, no, maybe. In other words, even allowing for the fact English is not your native language, your question doesn't make a lot of sense. The entire point of test coverage analysis is to ensure that all test results, when combined, cover enough expressions and branches to consider the tests to exercise enough of the code being tested to have a reasonable degree of confidence it is correct. This does not require any individual test achieve the same level of coverage. – Kurtis Rader Aug 14 '23 at 04:15

2 Answers2

3

Splitting your tests into separate tests is not only acceptable, there are many advantages in doing it that way.

  1. You can parallelize your tests into many concurrently running jobs which means the turnaround time to get results is much quicker.
  2. Each test starts from a fresh unknown state without any dependency on previous tests.
  3. When you find an error in the design or testbench, it's much quicker to get back to the state just before the error happens for debugging.
dave_59
  • 39,096
  • 3
  • 24
  • 63
2

Yes, it is acceptable in a real work environment to create several cases to achieve 100% functional coverage.

Being a beginner has nothing to do with it. Even for experienced engineers, it is common to create multiple tests which are designed for certain scenarios, especially if your system is complex.

Simulators support merging coverage databases from several tests because it is expected that more than one test will be required to achieve high coverage.

toolic
  • 57,801
  • 17
  • 75
  • 117