For (1) false negatives, I just create a few simple test files and verify that nxstyle detects the error. Pretty easy.

For (2) false positives, it is a little more difficult.  I use nuttx/sched to do these because it probably follows the coding standard the best.  ...

There is another test that is needed.  When we add a new test to nxstyle.c, we may often break other logic that detects different coding standard violations.  The above do not address that.

I think we would need to collect a directory full of code with known coding standard violations and run and modified nxstyle against those to to assure that we have not broken other detection logic.

The code in nxstyle is not pretty.  It uses many booleans and line number varialbes to detect problems through some really rather crude heuristics (it knows nothing about C syntax).  Since it is convoluted, unexpected side effects and unexpected breakage is really common.

Greg



Reply via email to