unit testing - Suggestions for BDD Scenarios for an generic API? -


I am putting together BDD induced unit tests for the API part of my application. (Yes, I know, BDD is supposed to talk about the domain and talk to the suit, but I will try BDD at least some of the visible things)

  • General Uses Developer uses API methods with normal parameter values.

  • Extreme Usage developer invites the API with unusually large / small parameters such as

    API abuse
  • API abuse Developer called an API with crazy parameters - which would be a crazy programmer, pass dates in an integer parameter, right? - Forgot the parameters, etc.

  • Malicious Hacking Developer does not care what the API is intended to do, but instead it is looking for ways to execute arbitrary code. Test will include JavaScript, SQL, to see if we can get them to perform anywhere.

Is there any other scenario that I should consider?

Sure, there are always scenarios to consider more, there is an effective infinite pool of scenarios, clearly . This is actually a very open question.

Regarding malicious hacking scenarios, you really should have trouble with clear spots for buffer overflows and then test for security vulnerabilities confirmed so that you do not accidentally open them again and Anytime you get a certain vulnerability, hunt everywhere in such a code, which uses the same programming techniques and patterns, and those people go right too Although it takes f / Well, in many cases, Fjing will give you better results. Automatic testing is an important part of tackling security issues, but it should not have any primary means in the toolbox.

To consider other things, the data is likely to be specific, for example, while parsing the dates, be sure to handle things like 2/29/2009 or 9/31/2009 if If you can, try to handle 1/1/1900 and 12/31/2038 (your library will not let you)

Whatever you can do, again, find out which exceptions are thrown in the circumstances, and deliberately try to find the input that triggers these exceptions, and then Ensure that you have tested the tests that are verified that those exceptions are either controlled or documented in the case of library codes.

Code coverage equipment and code mutation can also help you identify the scenarios that were not previously covered.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -