We help IT Professionals succeed at work.

How to write Test Cases for C Language Functions

ukapu2005
ukapu2005 asked
on
Can anyone please let me know How to write Test Cases for C Language Functions.
Are there any good websites which can provide good info on this.

Thanks
Comment
Watch Question

Senior QA Manager
CERTIFIED EXPERT
Commented:
For C language functions, you need to write the test cases accoring to the code coverage analysis.

i.e., functional coverage, line coverage, brach coverage etc...

Please go through : http://www.bullseye.com/coverage.html

Commented:
Are you looking for unit level test case?
If so you may need unit test frame work. Variety of frame works available for C language
Cunit ,CuTest ,SimplecTest etc:
I suggest this is the best way.
Additionally these points may help you when writing Test cases for C.
-      Since C is a procedural level programming language, there is verity of functions available.
Testing is depends on the way you are testing and the requirement of your test.
For ex:
If you test a few branches up from the leaves that makes you component testing
-      Depends on your branch functions , you may even lead to system testing once you have stated to perform unit testing
Please feel free to post me back for further information.