0

Hello,

is there a way to be sure that you not missed to test some function? I want to test lets say all posible functions, but it lot of them and you might easily miss.

It would be good to get notices or something like that on which functions has not been tested.

Maybe I need to cound methods of class and then count methods of test class. But maybe there is a better way.

3
Contributors
4
Replies
5
Views
5 Years
Discussion Span
Last Post by McLaren
0

There may be tools to do this, but you can also grep all your files and extract the lines containing the function keyword.

0

If you are using PHPUnit, then looking at the code coverage reports would be your best bet. These will show you down to the line what your tests are actually covering.

Actually counting the number of methods is pointless as in a well tested solution you'll have significantly more tests than you will actual methods in your classes.

0

Now I am not using PHPUnit, I just use native codeigniters unit test library. There are reports which show the tests, you can name them, and I name them using tested function names.

I now use the same amount of test methods - for one method there is one test method. Sometimes in the same test method I test few cases.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.