1 / 11

CUnit & Coverage

CUnit & Coverage. Larry Shi. Agenda. Aim CUnit Screenshots(Automated) Demo TO-DO list. Aim. Unit test Test C code automatically Find bugs in tim e to i mprove quality Coverage How often each line of code executes What lines of code are actually executed Suggestion

shaina
Download Presentation

CUnit & Coverage

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CUnit & Coverage Larry Shi

  2. Agenda • Aim • CUnit • Screenshots(Automated) • Demo • TO-DO list

  3. Aim • Unit test • Test C code automatically • Find bugs in time to improve quality • Coverage • How often each line of code executes • What lines of code are actually executed • Suggestion • CUnit for unit test • GCOV, LCOV for coverage

  4. CUnit • CUnit is a lightweight system for writing, administering, and running unit tests in C.  • Several different interfaces are provided for running tests and reporting results

  5. Screenshots-Listing tests

  6. Screenshots-Tests result

  7. Screenshots-Coverage

  8. Screenshots-Coverage

  9. Demo ※ Please see it in the test machine • Several stepsbelow: • Write test cases • Compile with -ftest-coverage -fprofile-arcs • Run • Generated files: xx.gcda, xx.gcno for coverage • LCOV • Generated files: covinfo for coverage • genhtml (generate html format coverage report) • Confirm test report(xx.xml) • Confirm coverage report (./result)

  10. TO-DO list • Team discuss if CUnit & LCOVcan satisfy our requirement for C code quality • Framework design • Unit test framework via CUnit • One example about framework proposal • Support for automated test • Support for modular test • Integrate the framework with existed source code • Integrate the framework with other test frameworks • Test cases Suggest that developers handle it

  11. Thank you!!

More Related