As part of our secure SDLC, we are delivering security as security requirements directly into the backlog of an application team. The security requirements will directly correlate to the functional features being delivered in the iteration. I am predominantly talking about application-based controls (code level) here.
As part of that, we are looking to encourage unit testing for those requirements as a mechanism for fully validating their implementation and going one step further we are hoping to foster the practice of TDD - i.e. the developer will develop a unit test for security functionality e.g. input validation for path traversal, etc.
I have read that it would be a good idea for us to develop a generic unit test suite for this.
Now I have to ask - Would it?
Would it really be a good idea for us to develop a bunch of JUNIT tests to integrate into development teams projects? Is there not an issue around flexibility here in that we would pretty much be standardising the how, the parameters, and the naming of security functions for development teams?
Maybe there is another way we could develop generic unit tests that would allow developers to call their bespoke methods without them following the method signatures of our test frameworks that I am not aware of? I imagine the overhead for integrating this would be huge!
Does developing the test not fly in the face of TDD in that the developer doesn't need to "think about what he is delivering and write a test first"?
My gut says the test suite should be sudo code for each requirement with outliers and negative and positive scenarios that the developers must implement - this way it wouldn't matter if we are writing it in C, C# Java or python etc.
Is this not a better approach?