What is Static Testing?
Out of the many techniques used, static testing is another one that helps in detecting defects in software. Static testing does this without actually executing the test case. It involves examination of code and also checks the necessary document which is involved but does not need the program to be executed. It is contrary to its counterpart of dynamic testing where there is involvement of the program and its execution.
Static testing is a proven way of improving quality and productivity when it comes to software development and testing process. It helps the testers or developers to fix their defects in the early phase of software development. It may be done manually or with the help of a tool. There are different reviews, walkthroughs, inspection, and analysis done which help in finding issues without execution.
Why Perform Static Testing?
Static testing assists in finding early defects. These defects if found in the early stages can be corrected and would not be going to further stages. The timelines for development are decreased as the code can be developed quickly by following the guidelines.
As the issues would be found in earlier stages the cost for testing would be reduced as a result of saving a lot of time. All this in return improves the development quality. The productivity of developers is also increased as they already have a set of guidelines, reviews, inspections, etc (which are discussed in later stages of this article) to be followed. It also reduces the number of defects that are encountered at a later stage of testing.
What is the Scope of Static Testing?
- Static testing can be used to test unit test cases. This is the very initial phase where issues can be caught. Another area where static testing is useful is the business requirement document. It helps to review the requirements and coming to the legitimate needs of the system. It can also be used in cases where uses cases are in the picture.
- The other areas where static testing can do wonders by bringing to notice the issues are functional requirements, prototype, prototype specification document, test data, traceability matrix document, training guides, and documents, etc. to add on to all these it is also helpful in automation and performance testing where the problem areas can be found in advance.
How is Static Testing performed?
To perform static testing, there are a few ways that need to be followed. Inspection should be done completely to inspect and design the application. Static testing mainly focuses on reviews. A checklist can be maintained wherein each document is mentioned so that it is ensured that all reviews are covered completely.
There are a few activities which are performed in this Testing, are listed below:
4.6 (3,144 ratings)
- Use Case Requirement Validation: In this validation, all end-user actions are identified and validated. It also checks all the different input and output actions that are associated with the use case. More the details regarding the use case, more is the accuracy of the test cases which are created.
- Functional Requirements Validation: It helps in noting all functional changes, database changes, list interfaces, network requirements, hardware and software changes. It is a step to ensure that all necessary changes are noted and implemented.
- Architecture Review: The complete architecture of a project needs servers which are present at different locations, network diagrams, protocol definitions, database accessibility, load balancing, etc. This helps in getting a complete overview of the equipment’s being used and architecture design.
- Prototype or Screen Mockup Validation: It includes validation of requirements and the use cases which are based on them.
- Field Dictionary Validation: All fields used in the user interface require a validation test to be performed. The different fields need that they are checked for minimum and maximum length, list different values, error messages, etc. It is very important to list down these fields and make sure that they are being validated.
When making use of static testing in your flow, it should be kept in mind that the product is being checked manually or by using certain tools. There are two types of static testing techniques. Mainly they are reviews and testing with tools.
Static Testing Techniques
The techniques involved in the testing are as below:
- Informal Reviews
- Technical Reviews
- Static Analysis
Let us give you a brief about all these techniques.
- These are the very first review which is started in the early stage of the document. As its name suggests it can be done informally between two people wherein more people can be added later. There is no procedure involved herein and hence no documentation is done for the review. It improves the quality of the document being prepared. Although there are many ways to do formal testing, the commonly used ones are informal ones. This process goes through 6 steps. These include:
- Review meeting
- Follow Up
- The formal review planning involves a moderator who inspects the table and takes care of scheduling details of the planning session. The kick-off meeting takes place and with the goal of having a cohesive and clear understanding all participants are given a timeline to document and commit to the required changes.
- A short introduction is given about the topic to everyone. After this, the participants individually review each document and share their artifacts with the reviewer. Then a formal review is carried in a review meeting which marks all issues as discussed and the final decision is taken. Any specific issues are also recorded. Based on these meetings reviews all defects that are found are reworked. Follow-ups are taken to check with the changes that are expected.
- The author takes the responsibility of these defects as not every defect needs to be worked upon. The moderator then checks if all expected actions are taken or not. All defects are logged with process improvement suggestions. It is the job of the moderator to check for all metrics and evaluate the exit criteria for the discussion and action items at hand.
- In the walkthrough, others are involved and collective feedback from the team is gained so that there is a common understanding which fulfills the purpose of the document. A team does not need to do a detailed study. The authors are already prepared for this review. All contents which are being presented should be evaluated. The proposed solutions should be validated before discussing it.
- The document under inspection is gone through the author of the document and other people are asked to check and provide their opinion on the document. There are many feedbacks given and these are taken into consideration. The step by step explanation helps the participants in getting a clear picture. They can study the code and review it before the meeting. It helps in creating a higher-level document.
- There is a broad section that is covered, and it ensures that no aspect of requirements is left out. A common understanding around the document is created and solutions or alternatives are suggested.
- This is a formal meeting where the technical content of the document is discussed. There is the guidance of an expert required. It focuses on getting the value of the technicalities present in the project. It helps in having consistency and ensures that all technical details are correct. By doing technical review it is expected to achieve consensus about technical aspects of all documents.
- Once the documentation is done the experts are asked to do an informal review. These experts can be architects, chief designers, key users, etc. The fellow programmers or peers can also be a part of this review. All technical concepts can be assessed by everyone in this review. It also made sure that the right concepts are being used in the right place.
- This is the most formal kind of review which is held. Here a senior or trained team personnel guides the inspection process. Before the meeting happens, all reviewers are prepared, and the documents are prepared. An inspection ensures that the complete product is examined, and defects are found. All defects that are found must be maintained in logs. Inspection focuses on improving the quality of the document which is being inspected.
- It is efficient in finding defects and creates documents that have a very high level of quality. It is also a way of making note of previous defects and not having similar defects again. All defects that are raised are recorded and discussed. Further discussions for these documents are done only when the defects are fixed. It focuses on finding defects in the early stages and in turn, improves the quality of software to a great extent.
Static Testing Tools
The static analysis tools are mainly used by developers. They can be seen as an extension to the compilers. Some compilers also have a static analysis feature in them. It checks for static requirements and also analyzes the static analysis of websites. By making use of these tools the code can be developed in a way that can be understood easily.
Coding standards can be set by using these tools. This step focuses on testing the technique, design, and code by using automated tools. The focus is on the software code. It is used by developers before and during integration testing.
Different Tools involved in Static Testing are as follows:
- Coding Standards: To have a uniform way followed by the developers it needs to be made sure that all coding standards that are set are being followed. Tools can be used for checking these standards. If there is no tool being used for this, then there is less surety of adherence to a coding standard.
- Code metrics: The structural attributes of code can be measured by making use of code metrics. When the software goes on building it makes the code complex. Code metrics help in designing effective and can also have alternatives while redesigning the code.
- Code Structure: The structure of the code like the control flow, data structures, and their flow are decided in this phase. It works upon the sequence in which the instructions are executed in the program. This includes the loops and iterations, different conditions which are to be used in the program. The code which is not at all being used, also known as dead code can be identified in this phase and eliminated. The flow of the program decides the data items which are accessed and then changes in code can be made accordingly. All data structures including complex data structures can be identified.
Advantages and Disadvantages
Below are some advantages and disadvantages of Static Testing
- The testing is usually conducted by experts who have good technical knowledge and knowledge about coding.
- To be agile and prompt in finding errors this technique can be used.
- Automation tools can be used in this testing which makes the process of scanning and reviewing fast.
- When static testing is involved, the errors can be found out at an early stage and hence reduces the cost of fixing those issues.
- All risks can be mitigated easily as automation tools are being used.
- The issues and weak points can create an issue when the code is executed in real time
- These tools scan only the code
- Static testing is very time-consuming when done manually.
- The automation tools can sometimes be providing false positive and negative cases. Also, they only scan the code which can lead to functional defects.
Static testing is the easiest and effective way of finding defects in code at an earlier stage. The code is reviewed by experts and issues are grabbed before reaching testing. It also helps in setting code standards which can be followed by everyone.
This testing is usually done by developers and hence technical issues can be curbed at an early stage. It reduces the risk of production defects due to silly issues of documentation. All these are verified in advance and hence lead to lesser issues.
This has been a guide to Static Testing. Here we have discuss how it is performed, techniques, tools, advantages, and disadvantages of static Testing. You can also go through our other suggested articles to learn more –