Presentation is loading. Please wait.

Presentation is loading. Please wait.

Jul 1, 20101 CUnit & Coverage Larry Shi. Jul 1, 20102 Agenda  Aim  CUnit  Screenshots(Automated)  Demo  TO-DO list.

Similar presentations


Presentation on theme: "Jul 1, 20101 CUnit & Coverage Larry Shi. Jul 1, 20102 Agenda  Aim  CUnit  Screenshots(Automated)  Demo  TO-DO list."— Presentation transcript:

1 Jul 1, 20101 CUnit & Coverage Larry Shi

2 Jul 1, 20102 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 Jul 1, 20103

4 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 TypeDes.Interactive ※ Automated Output to xml fileNO BasicFlexible programming interfaceNO ConsoleConsole interface (ansi C)YES CursesGraphical interface (Unix)YES

5 Screenshots-Listing tests Jul 1, 20105

6 Screenshots-Tests result Jul 1, 20106

7 Screenshots-Coverage Jul 1, 20107

8 Screenshots-Coverage Jul 1, 20108

9 Demo ※ Please see it in the test machine  Several steps below:  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) Jul 1, 20109

10 TO-DO list  Team discuss if CUnit & LCOV can 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 Jul 1, 201010

11 Jul 1, 201011 Thank you!!


Download ppt "Jul 1, 20101 CUnit & Coverage Larry Shi. Jul 1, 20102 Agenda  Aim  CUnit  Screenshots(Automated)  Demo  TO-DO list."

Similar presentations


Ads by Google