Static testing and dynamic testing are essential testing techniques meant for developers and testers for use during Software Development.
These are unique validation methods that the organization must decide after due analysis which one to practice for software verification.
Since your objective is to get the maximum benefit from this type of testing, pick the right tool most suited for your needs. In this tutorial, you’ll learn the pros and cons of each of these types of testing.
Static Testing
In Static Testing, it does not require executing the code. You can perform it manually or by using a set of tools. This testing type covers the analysis of the source, review of specification documents, also the design description documents.
In this, the testers provide review comments on each of the docs reviewed. If the application is yet not operational and hasn’t implemented the user interface, then you can execute a security analysis to observe it under the runtime-less configuration.
While doing static testing, a tester or a developer can go on to look for the bugs, and buffer overflows, and probably identify the vulnerable code in the system. To begin such testing, you don’t need to wait to finish the entire application development.
You can start it in an early phase of the development lifecycle. And, testers can begin reviewing the code, scripts, requirements, API test cases, or any related doc whichever is available at the point of time.
Static Testing Techniques
1. Inspection
The principal moto of this Type of Testing is to identify defects in the early stage of the software development cycle. The team can start with the inspection of any of the artifacts as mentioned earlier such as the code, the test cases, or the product docs walkthroughs. It requires a moderator to organize the review sessions. Since the inspection is a formal type of review, the moderator needs to prepare a checklist of what to go through and what not.
2. Walkthrough
Another technique is the walkthrough. It requires the owner of the document to explain the work done. The attendees can place their queries and another person from the team can record the points in the notes.
3. Technical Reviews
In this Static Testing method, the team carries out the Technical Scrutiny of the code written to check whether it meets the coding guidelines and standards. Generally, in a review session, the team also verifies the testing artifacts such as a testing plan, validation strategy, and automation scripts.
3. Informal Reviews
It is a static testing technique that helps in scrutinizing the docs informally. Also, the participants provided informal comments during the meeting.
Dynamic Testing
Dynamic testing is performed after the application has reached operational mode. It gets executed in the real runtime environment set up by the QA. While the code behind the app is running, the tester supplies the required input and waits for the result. After that, he/she matches the output with the expected outcome.
That’s how the testers inspect the functional behavior of the application, and track the system RAM, CPU usage, response time, and the performance of the overall software. Dynamic testing has another name validation testing. It can either be Functional Testing as well as non-functional testing.
Types of Dynamic Testing Techniques
1. Unit Testing
This testing happens mostly at the developer’s end. The essential artifacts that get tested are the source code of the application’s various modules.
2. Integration Testing
The purpose of this technique is to verify the interfacing between two or more modules once they get tied up together.
3. System Testing
This testing gets done on the entire software with all modules working.
4. Acceptance Testing
This testing runs the validation keeping the user’s point of view in mind.
In the software development lifecycle, both Static Testing and Dynamic Testing are essential to certify the application functionality. Each of these has its strengths and weaknesses which you should be aware of.
Static Testing Vs. Dynamic Testing
1. Static Testing belongs to the white box testing. It gets performed at an early stage of development. It incurs a lower cost as compared to dynamic testing.
Dynamic Testing is performed at the final stage of the development process.
2. Static testing has better line coverage than dynamic testing in the short duration.
Dynamic Testing has a lower no. Of line coverage as it examines only a smaller part of the code.
3. Static testing occurs before the application is ready for deployment.
Dynamic Testing happens after the code is deployed.
4. Static testing is done in the verification stage.
Dynamic testing is completed in the validation stage.
5. No execution happens in the static testing.
Dynamic testing requires code execution.
6. Static testing produces the analysis of the code along with the documentation.
Dynamic Testing reports the bottlenecks in the application.
7. In Static Testing, the team prepares a checklist describing the testing process.
In Dynamic Testing, the test cases get executed.
8. Static Testing Methods are Walkthroughs and code reviews.
Dynamic testing mainly has functional and nonfunctional validation.
Summary – Difference between Static and Dynamic Testing
In any Software development methodology, both the Verification and Validation processes get carried out to certify that the final software has all the requirements implemented correctly.
Static testing scrutinizes the application code without any execution. It lies under the umbrella of Verification. The testers have multiple Static testing techniques such as Inspection, Walkthrough, Technical and Informal reviews, etc.
On the contrary, Dynamic testing validates the working product. It lies under the umbrella of Validation. The standard Dynamic testing techniques are Unit Testing, Integration Testing, System or Stabilization Testing, and User Acceptance Testing. Here, the product gets validated by both functional and non-functional aspects.
Further reading – 100 Manual Testing Interview Questions.