Protect Your Assets
Showing results for 
Search instead for 
Do you mean 

When To Choose Static vs. Dynamic Testing for a Website

danielmiessler ‎11-05-2013 03:37 PM - edited ‎07-07-2015 12:39 PM




Before we look at the tradeoffs between dynamic and static testing, let's do a quick levelset on what the difference between dynamic and static testing is:


  • Static Testing technically means the app is being tested while it's not running, and it looks at the source code for an application. Using various techniques for analysis, static analysis (specifically source code analysis) can find security issues within the code that will manifest as vulnerabilites on the running website.
  • Dynamic Testing takes the opposite approach and looks at the web app while it's in operation, and it focuses not on what you can see from the inside looking out, but rather what a malicous actor from the outside can see.

Pro/Con Discussion


All web tests are different, so it's difficult to lock down a specific list of considerations. But we can cover some basics.


  1. How much time do you have? If you have a long time window the first question is why you're not doing both. But if you have to choose I'd say that a comprehensive source code audit would be the best use of your time.  If, on the other hand, you are starved for time and need results in a matter of a couple of hours, a skilled web pentester is likely to be able to point out your most critical issues before source code analysis can yield quality fruit.
  2. What type of website is it? If you're looking at a high security site, e.g. for the miltary, static analysis is likely the best approach because it has the whitebox visibility to see the most issues with the code. If the site is heavy on business logic, however, the slider once again moves towards dynamic testing. The more interaction that's present that can be broken without violating rules visible to static analysis tools, the more manual and dynamic testing is required.
  3. What Testing Resources Do You Have Available? If time is of the essence the worst thing you can do is become a victim of analysis paralysis. Consider the questions above, but also realize that even a cursory look with either static or dynamic techniques will likely yield serious issues that need to be fixed. Consider simply leveraging the type of testing that you have more talent in at the time.

It must be stated again that this should be a false choice in most cases. If the site matters to any significant degree, both types of testing should be done. But we're purposely looking at the pros/cons here.


Also keep in mind that both static and dynamic testing have their automated and manual counterparts. Running an automated source code analysis tool like SCA does not compare to a professional source code auditor spending a week looking at your application's source, just as running a web scanner doesn't compare to a veteran web tester beating up your site. This is especially true because those professionals doing the manual testing will be using tools like SCA and WebInspect to do their work.


It's also key to remember that the tester matters, whether we're talking about doing manual pentesting, or running tools that perform static and dynamic analysis. There's also the remediation component, which requires the developer(s) to actually fix the problems. So there are a number of moving parts here.




These aren't strict rules, but static testing is best used for extreme depth and when there is more time available. If you're in a time crunch or are facing functionality that can be circumvented by tricking the application's implementation of security features (e.g. password reset mechanism implementations, CAPTCHA, etc.) it's probably a better idea to look at the site first using dynamic testing because those types of issues aren't as easily discovered using static testing.


Know the app you're testing, know its pain points, and if you're ever forced to choose between static or dynamic testing, be sure to use the approach that best fits. And remember that if you're ever in that position for an important app, you likely have problems not addressable via either type of testing.




Daniel Miessler is a Principal Security Architect with HP Fortify and can be reached via Twitter at @danielmiessler.


About the Author


on ‎11-05-2013 11:00 PM
Great, quality stuff! Useful, informative, and easy to implement! Thanks! -=PE=-
on ‎11-14-2013 12:47 PM

Like the article, the author makes some excellent points "pro and con"  for Dynamic and Static testing (highly recommended BTW).  

27 Feb - 2 March 2017
Barcelona | Fira Gran Via
Mobile World Congress 2017
Hewlett Packard Enterprise at Mobile World Congress 2017, Barcelona | Fira Gran Via Location: Hall 3, Booth 3E11
Read more
Each Month in 2017
Software Expert Days - 2017
Join us online to talk directly with our Software experts during online Expert Days. Find information here about past, current, and upcoming Expert Da...
Read more
View all