Blog

Security testing: types, methods and an example

Security testing checks whether software can be misused before an attacker tries. The main types, what each finds and misses, and a worked web example.

Security testing is the work of trying to make software do what it should not: show one customer’s records to another, accept a request it ought to refuse, run text an attacker typed as if it were code, or keep working for someone whose access was taken away. The point is to find those weaknesses while they are cheap to fix and before somebody with worse intentions does. No single method finds all of them, which is why the useful questions are which methods run, when, and who acts on what they report.

Read it if you commission, own or run a web application and want to know what a security test does and does not prove. It explains the main types of security testing, what each one finds and misses, how penetration testing differs from vulnerability scanning, and the permission you need before testing anything live.

The worked example is an invented family-run ferry service that sells crossings online. No such ferry company exists, and its software does not either.

What is security testing?

NIST, the US standards body, publishes a guide on the subject, SP 800-115, Technical Guide to Information Security Testing and Assessment. It defines testing in general as “exercising one or more assessment objects under specified conditions to compare actual and expected behaviors.” Security testing applies that to misuse. The expected behavior is a refusal (an error, a sign-in page, a blocked request), and the test checks that the refusal really happens.

The same guide separates testing from examination. Testing runs the system. Examination reads things about it: documents, logs, configuration files, rule sets, code. Most teams fold both into the phrase “security testing”, and this guide does too, because reading the code and probing the running site answer the same question from two sides.

What security testing protects is usually summed up as keeping data confidential, keeping it correct, and keeping the system available to the people who should be able to use it. A test is useful when it shows one of those failing, or gives evidence that it holds under a stated attack.

Security testing in software testing

Within the wider field of software testing, security is one of the non-functional qualities: it concerns how well the software holds up, not which features it has. In practice the line blurs. “A passenger can see only their own bookings” reads like a functional requirement, and it is also the security rule that matters most in many web applications.

Security checks turn up at every level of testing. A unit test can prove that one function rejects a request from the wrong role. An integration test can prove that the payment service refuses a forged callback. System testing exercises the whole product the way an outsider would. Once a weakness has been found and fixed, a test for it joins the regression suite, so the same mistake cannot quietly return in a later release.

The difference from ordinary functional testing is the direction of the question. A functional test asks whether the right person can do the task. A security test asks whether the wrong person, or the right person with the wrong input, is stopped.

Types of security testing

The names below are the ones most teams use. NIST’s guide sorts techniques into three groups: review techniques (reading documents, logs, rule sets and system configuration), target identification and analysis (finding systems, ports, services and likely weaknesses, mostly with automated tools), and target vulnerability validation (confirming that a weakness can really be used, which includes penetration testing and application security testing). It also warns that no one technique “can provide a complete picture of the security of a system or network.”

Method What it looks at Good at Weak at
Static application security testing (SAST) Source code or compiled code, without running it Known unsafe patterns such as SQL injection; runs on every build Authentication and access control problems, and settings that live outside the code; many false alarms
Software composition analysis (SCA) The third-party and open-source packages the software uses Published vulnerabilities, outdated versions and license terms Anything in the team's own code
Dynamic application security testing (DAST) The running application, usually from the outside Cross-site scripting, SQL injection, command injection, path traversal and insecure server settings Rules only a person who knows the business can judge, and pages the scanner never reaches
Manual code review The code, read by an engineer before it is merged Logic and permission mistakes that a tool cannot recognize as wrong Depends on the reviewer's time and knowledge; slow across a large codebase
Configuration review Server, framework and cloud settings, compared with a written baseline Verbose error pages, default passwords never changed, file storage anyone can read Flaws in how the application itself behaves
Vulnerability scanning Hosts, open ports and the services behind them Known weaknesses in exposed systems, repeated on a schedule Only what its signature database knows; false positives need a person to sort them
Penetration testing The whole system, approached the way an attacker would Chaining small weaknesses into real access, and proving impact Covers a sample of the possible risks; late if it is the only test

What the three tool types look at and find comes from OWASP’s own descriptions of source code analysis tools, web application vulnerability scanners and component analysis, and the SAST limits are OWASP’s too. The vulnerability scanning row follows NIST’s guide. The penetration testing row follows NIST and the OWASP testing guide discussed in the next section. The other limits are our own reading of what each method can and cannot see.

Penetration testing vs vulnerability scanning

The two are often confused because both can end in a report listing weaknesses. They answer different questions.

A vulnerability scan is automated. It checks systems against a database of known problems and reports possible matches. NIST notes that scanners “can have a high false positive error rate,” depend on signatures that must be kept up to date, and need someone with the right expertise to interpret the results. A scan is cheap to repeat, so it suits a schedule: weekly, nightly, after every change to the servers.

A penetration test is carried out by people. NIST defines it as “security testing in which assessors mimic real-world attacks to identify methods for circumventing the security features of an application, system, or network.” Its value is in combination: a tester who finds a page that leaks user IDs and a reset form that trusts them can join the two into an account takeover that neither finding would show alone. It is also labor-intensive and carries risk. NIST says systems “may be damaged or otherwise rendered inoperable” during a test, which is why it should happen “only after careful consideration, notification, and planning.”

The OWASP Web Security Testing Guide adds a caution about timing. Penetration testing is also called black-box testing or ethical hacking, and when it is the only security activity it comes “too little too late”: the flaws it finds were written earlier in the build and cost more to fix than they would have when the code was new.

Application security testing: which method finds what

The ferry service sells tickets for a two-boat crossing. Passengers book and pay on the website and receive a boarding pass with a code. Staff scan the codes with a check-in app on a phone. An admin area holds the timetable, prices and refunds. Suppose its first release went out with six faults.

Flaw Found by Usually missed by
1. Changing the booking number in a boarding pass link shows another passenger's name and phone number A manual test that signs in as one passenger and asks for another's booking; a penetration test SAST, which finds access control hard to judge, and DAST, which cannot know that booking 1042 belongs to someone else
2. The timetable search builds its database query from the text a visitor types SAST, DAST and a code review all have a good chance SCA, because the fault is in the team's own code
3. The library that draws the PDF tickets has a published vulnerability SCA SAST, which reads the team's code rather than the package's, and most tests of the running site
4. The live server still shows detailed error pages, with file paths and library versions DAST; a configuration review against the baseline SAST, because the setting is not in the code
5. A ticket canceled through the app after the boat has sailed is still refunded in full A test written from the refund rules; a penetration tester who reads the rules first Every automated tool, since none of them knows the refund rule
6. The check-in app keeps working for a deckhand who left, because old sign-in tokens never expire A manual session test; a penetration test Scanners, which see a valid token and a normal answer

The six rows split into two kinds. Tools are good at the faults that look the same in every application: unsafe queries, known-bad packages, loud error pages. The faults that need to know who owns what, or what the business allows, are found by people who have read the rules. A scanner report can come back clean while flaws 1, 5 and 6 are all still there, and each of them costs the ferry company money or trust.

What a web application security test covers

OWASP’s Web Security Testing Guide is a free, openly written checklist for testing web applications. Its stable version, 4.2, sorts the tests into twelve areas: information gathering, configuration and deployment management, identity management, authentication, authorization, session management, input validation, error handling, weak cryptography, business logic, client-side testing and API testing. Version 5.0 is in development.

Mapped onto the ferry example, flaw 1 sits under authorization, flaw 2 under input validation, flaw 4 under configuration and error handling, flaw 5 under business logic and flaw 6 under session management. Flaw 3 is a component problem that the guide’s configuration tests touch but SCA covers better.

A checklist says what to test. What the software should do in each area is a requirement, and a published standard such as OWASP’s ASVS can supply those lines; our guide to non-functional requirements shows how to write one that can be checked.

When each test runs

The Web Security Testing Guide’s advice is to test early and often, because a bug caught early in development “can be addressed faster and at a lower cost.” Its recommended mix is “a balanced approach that includes several techniques”, spread across the life of the software and weighted toward its early stages.

When each kind of security test runs, in five steps. Writing code: static analysis and a second engineer's review of each change. Adding packages: composition analysis checks for published vulnerabilities. A running test build: a dynamic scan and manual tests of roles and sessions. Before a release: a configuration review, and a penetration test where the risk justifies one. Live: scans keep running, because new vulnerabilities are published for packages that were clean at launch. No one method gives the whole picture.

  • While the code is written. Static analysis runs on each change and an engineer reviews it before it is merged. This is the cheapest place to catch flaw 2.
  • When a package is added or updated. Composition analysis checks it, and the whole list is checked again on a schedule, which is how flaw 3 is found.
  • Once a test build is deployed. A dynamic scan runs against it. Alongside the scan, tests sign in with one account per role, and as two different passengers, and request pages and records that account has no right to (flaw 1). A session check confirms that a sign-in which has been revoked stops working (flaw 6).
  • Before a release. The live settings are compared with the baseline (flaw 4), the business rules are tested by someone who knows them (flaw 5), and a penetration test is arranged where the risk justifies one.
  • For as long as it is live. A package that was clean at launch can have a vulnerability published against it next month, so scans keep running after the project ends.

Which security decisions belong to each stage of a build, and where each risk on OWASP’s Top 10 list is cheapest to stop, has its own guide: secure web application development.

Permission before you test a live system

Security tests send traffic that looks like an attack, because in a sense it is one. Before anything is aimed at a live system, three things should be settled in writing.

  • Who said yes. The owner of the system gives written permission, naming what may be tested. Testing a site you do not own, without that permission, can be illegal in many countries.
  • The rules of engagement. NIST’s guide includes a template in its Appendix B. It covers the scope, the dates and hours, the techniques allowed and ruled out, and who to call if something breaks. NIST also suggests testing outside busy hours and, where possible, on a copy of the live system rather than the system itself.
  • The host’s policy. Cloud providers set their own rules. AWS’s penetration testing policy, for example, lets customers test a listed set of services without asking first, but lists denial of service and flooding tests among its prohibited activities and handles simulated attacks of that kind under a separate policy. Other hosts differ, so read the policy for the one you use.

Security testing in QA

People ask whether security testing belongs to the QA team or to specialists. Usually both. A QA team can own a large share of it: tests that log in with every kind of account and request records belonging to other people, checks that refuse bad input, automated scans in the build pipeline, and regression tests for every security bug fixed. These are ordinary test cases with a security purpose, and they are easiest to write when the requirement is stated plainly, such as “a passenger can see only their own bookings.”

Specialists come in where depth or independence matters: a penetration test before a major release, a review demanded by a client or a regulator, or an application that handles payments or health records. Their report is most useful when the routine faults have already been removed, so their time goes on the hard ones.

Which tools are used for security testing?

Each method in the table has its own family of tools, many of them free.

  • Static analysis tools exist for most languages, and many code hosting services include one.
  • Composition analysis: OWASP Dependency-Check is a free example that lists a project’s packages and their published vulnerabilities.
  • Dynamic scanning: ZAP is a free, open-source web application scanner.
  • Penetration testing uses a tester’s own kit of proxies, scripts and scanners, chosen per job.

A tool’s output is a list of candidates that still has to be judged. NIST’s warning about false positives applies to all of them, so someone has to decide what each finding means for this application and fix the real ones.

Questions people ask

Is security testing in demand?

The US Bureau of Labor Statistics projects employment of information security analysts, the occupation that includes much security testing work, to grow 21 percent from 2025 to 2035, “much faster than the average for all occupations” (Occupational Outlook Handbook). That figure covers the whole occupation, not testers alone.

Is security testing functional or non-functional?

Testing syllabuses classify security as a non-functional quality. Many individual security checks are written exactly like functional tests, though, with a precise input and an expected refusal, and they run in the same suites.

How often should security testing be done?

The automated parts run on every change or every night, because they cost little. Deeper tests follow risk: before a major release, after a large change to how people sign in or pay, and at whatever interval any standard the business must meet sets. Scans of a live system keep going for as long as it runs.

Questions to put to whoever builds or runs your software

Ask which of the methods above run on your application, at which stage, and who reads the results. Ask how a finding becomes a fix and a regression test. Ask what happens when a package your application uses has a vulnerability published against it after launch.

If you have a live application and want it kept up to date after launch, see what our software maintenance and support covers, or tell us about the application. Expect our answer inside one business day.

The full service behind this post: Software Maintenance Services & Support.

Ready to scope your project?

Send us two sentences about what you need. We reply within one business day with the next step and any questions we need answered first.

Get a Quote