Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • Software Engineering Tutorial
  • Software Development Life Cycle
  • Waterfall Model
  • Software Requirements
  • Software Measurement and Metrics
  • Software Design Process
  • System configuration management
  • Software Maintenance
  • Software Development Tutorial
  • Software Testing Tutorial
  • Product Management Tutorial
  • Project Management Tutorial
  • Agile Methodology
  • Selenium Basics
Open In App
Next Article:
Dynamic Testing - Software Testing
Next article icon

Static Testing - Software Testing

Last Updated : 19 Jun, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

Static Testing is a type of Software Testing method that is performed to check the defects in software without actually executing the code of the software application. Whereas in Dynamic Testing checks, the code is executed to detect the defects. The article focuses on discussing Static Testing in detail.

Table of Content

  • What is Static Testing?
  • Need for Static Testing
  • Objectives of Static Testing
  • Features Tested in Static Testing
  • Static Testing Techniques
  • How Static Testing is Performed?
  • Benefits of Static Testing
  • Limitations of Static Testing
  • Best Practices for Static Testing
  • Static Testing Tools
  • Conclusion
  • FAQs

What is Static Testing?

Static Testing also known as Verification testing or Non-execution testing is a type of Software Testing method that is performed in the early stage of development to avoid errors as it is easier to find sources of failures and it can be fixed easily. The errors that cannot be found using Dynamic Testing, can be easily found by Static Testing. 

  1. Static can be done manually or with the help of tools to find bugs and improve the quality of the software.
  2. It helps to find errors in the early stage of development which is also called the verification process.
  3. It enhances maintainability and ultimately saves time and money in the long run.

Need for Static Testing

Static testing is needed whenever the following situations are encountered while testing an application or software:

  1. Increased software size: Static testing is required to get free from bugs in the early stages of development as with testing activity the size of the software increases which is difficult to handle due to a reduction in the productivity of the code coverage.
  2. Dynamic testing is expensive: Dynamic testing is more expensive than static testing as dynamic testing uses test cases that have been created in the initial stages and there is also a need to preserve the implementation and validation of the test cases which takes a lot of time from test engineers:
  3. Dynamic testing is time-consuming: Static testing is required as dynamic testing is a time-consuming process.
  4. Bugs detection at early stages: Static testing is helpful as it finds bugs at early stages, while dynamic testing finds bugs at later stages which makes it time-consuming and costly to fix the bugs.
  5. Improvement of development productivity: Static testing helps to identify bugs early in the software development thus it helps to reduce the flaws during production and increase development productivity.

Objectives of Static Testing

Below are some of the objectives of static testing:

  1. Decreases Flaws: Static testing will decrease the flaws in production as the bugs will be detected early in the software development.
  2. Saves Time: Early detection of the bugs helps to save a lot of time, effort, and cost that will be required to fix the bugs.
  3. Easy Bug Fixing: Static testing is used to identify the bugs early in software development, where it is quite easy to fix the bugs.
  4. Quality Improvement: Enhance overall software quality of the software product by ensuring the compliance with the coding standards and best practices.
  5. Cost Efficiency: Static testing helps to reduce the cost associated with dynamic testing by catching defects early.

Features Tested in Static Testing

Static testing involves testing the following things:

  1. Unit Test Cases: It ensures test cases are complete, written in the correct manner, and follow the specified standards.
  2. Business Requirements Document (BRD): It verifies that all business requirements are clearly mentioned in the documentation.
  3. Use Cases: It examines the use cases so that they accurately represent user interactions with the system.
  4. Prototype: It reviews the prototype to make sure that it accurately represents the main design and functionality.
  5. System Requirements: It check the system requirements document for complete accuracy.
  6. Test Data: It reviews the test data to ensure it is complete and covers all possible input scenarios.
  7. Traceability Matrix Document: This ensures that all requirements are mapped to corresponding test cases.
  8. Training Guides: It reviews training materials to make sure that they accurately reflect the system functionality and user procedures.
  9. Performance Test Scripts: It examines performance test scripts to ensure they cover all critical performance aspects.

Static Testing Techniques

There are mainly two types of techniques used in Static Testing:

1. Review

In static testing, the review is a process or technique that is performed to find potential defects in the design of the software. It is a process to detect and remove errors and defects in the different supporting documents like software requirements specifications. People examine the documents and sorted out errors, redundancies, and ambiguities. Review is of four types:

  1. Informal: In an informal review the creator of the documents put the contents in front of an audience and everyone gives their opinion and thus defects are identified in the early stage.
  2. Walkthrough: It is basically performed by an experienced person or expert to check the defects so that there might not be problems further in the development or testing phase.
  3. Peer review: Peer review means checking documents of one another to detect and fix defects. It is basically done in a team of colleagues.
  4. Inspection: Inspection is basically the verification of documents by the higher authority like the verification of software requirement specifications (SRS).

2. Static Analysis

Static Analysis includes the evaluation of the code quality that is written by developers. Different tools are used to do the analysis of the code and comparison of the same with the standard. It also helps in following identification of the following defects:

  1. Unused variables.
  2. Dead code.
  3. Infinite loops.
  4. Variable with an undefined value.
  5. Wrong syntax.

Static Analysis is of three types:

  1. Data Flow: Data flow is related to the stream processing.
  2. Control Flow: Control flow is basically how the statements or instructions are executed.
  3. Cyclomatic Complexity: Cyclomatic complexity defines the number of independent paths in the control flow graph made from the code or flowchart so that a minimum number of test cases can be designed for each independent path.

How Static Testing is Performed?

Below are the steps that can be followed to perform static testing:

  1. Planning: This step involves defining what needs to be tested, setting objectives, determining the scope of testing, and preparing a testing strategy. This should involve identifying the software components to be tested, developing the testing methods, and identifying the tools to be tested.
  2. Prepare artifacts: In this step, necessary artifacts like source codes, design documents, requirement documents, and test cases are prepared.
  3. Perform static analysis: Static analysis is conducted in this phase where the code is reviewed and analyzed for compliance with coding standards, code quality, and security issues using specialized static analysis tools without executing the code.
  4. Perform code reviews: Code reviews are performed where a small team of experts systematically reviews the code and finds potential errors using various methods.
  5. Report and document bugs: Bugs identified during static testing are reported and documented.
  6. Analyze results: The results collected during static testing are analyzed to determine the quality of the software product.

Benefits of Static Testing

Below are some of the benefits of static testing:

  1. Early defect detection: Static testing helps in early defect detection when they are most easy and cost-effective to fix.
  2. Prevention of common issues: Static testing helps to fix common issues like syntax errors, null pointer exceptions, etc. Addressing these issues early in development helps the teams to avoid problems later.
  3. Improved code quality: Static testing helps to make sure that the code is easy to maintain and well-structured. This leads to a higher quality code.
  4. Reduced costs: Early bug detection in static testing helps to fix them early in the development thus saving time, effort, and cost.
  5. Immediate feedback: Static testing provides immediate evaluation and feedback on the software during each phase while developing the software product.
  6. Helps to find exact bug location: Static testing helps to find the exact bug location as compared to dynamic testing.

Limitations of Static Testing

Below are some of the limitations of static testing:

  1. Detect Some Issues: Static testing may not uncover all issues that could arise during runtime. Some defects may appear only during dynamic testing when the software runs.
  2. Depends on the Reviewer's Skills: The effectiveness of static testing depends on the reviewer's skills, experience, and knowledge.
  3. Time-consuming: Static testing can be time-consuming when working on large and complex projects.
  4. No Runtime Environment: It is conducted without executing the code. This means it cannot detect runtime errors such as memory leaks, performance issues, etc.
  5. Prone to Human Error: Static testing is prone to human error due to manual reviews and inspections techniques being used.

Best Practices for Static Testing

Below are some of the best practices for static testing:

  1. Define Clear Objectives: Establish the objectives and scope of static testing early in the project.
  2. Develop Checklist: Create a checklist for reviews and coding standards that align with the industry best practices and specific project requirements.
  3. Focus on High-Risk Areas: Prioritize static testing on high-risk areas of the codebase that are more likely to contain defects.
  4. Team Training: Provide training to the team members on static testing techniques, tools, and best practices. Ensure everyone understands how to perform static testing.
  5. Prevent Test Execution Delays: Time and cost can be managed and reduced if the test execution can be delayed.
  6. Track Review Activities: It is good to plan the review activities and track them as walkthroughs and reviews are usually merged into peer reviews.
  7. Keep Process Formal: For efficient static testing, it is very important to keep the process and project culture formal.
  8. Regular Tool Updates: Keep static testing tools up to date to ensure they can effectively detect the new types of issues.

Static Testing Tools

Some of the most commonly used static testing tools are:

1. Checkstyle

Checkstyle is a static analysis tool that helps developers to write Java code and automates the process of checking Java code.

Features:

  • It can verify the code layout and formatting issues.
  • It can help to identify the method design problems and class design problems.
  • It is a highly configured tool that can support almost any coding standard like Google Java Style, and Sun code conventions.

2. Soot

Soot is a Java optimization framework that has several analysis and transformation tools.

Features:

  • It can detect unnecessary code and thus improve the overall code quality.
  • It is a framework for analyzing and transforming Java and Android applications to test aspects like named modules and modular jar files, automatic modules, exploded modules, etc.

3. SourceMeter

SourceMeter is a static testing tool for static source code analysis of various programming languages like C/ C++, Java, C#, Python, and RPG Projects.

Features:

  • It helps in the easy identification of vulnerable spots of the system under development from the source code.
  • It can analyze code in multiple programming languages and generates reports that help developers to make informed decisions.
  • The output of analysis and quality of analyzed source code can be used to enhance the product.

4. Lint

Lint is a static analysis tool that scans code to flag programming errors and bugs.

Features:

  • It helps enforce coding standards and prevent errors and bugs in the code.
  • It helps to identify and correct common code mistakes without having to run the application.

5. SonarQube

SonarQube is a static testing open-source tool to inspect code quality continuously.

Features:

  • It analyses and identifies the technical debt, bugs, and vulnerabilities across different programming languages.
  • It provides support for 29 languages and analyzes the quality of all the languages in your projects.
  • It has features like custom rules, integration with code repositories, detailed code reports, and extensible plugins.

Conclusion

Static testing is an important component of the software development lifecycle. It offers numerous benefits such as early defect detection, improved quality, reduced costs, and many more. By examining the code and documentation and without executing the code, static testing helps to identify the issues at an early stage.


Next Article
Dynamic Testing - Software Testing

P

pp_pankaj
Improve
Article Tags :
  • Software Engineering
  • Software Testing

Similar Reads

  • Software Testing Tutorial
    Software testing is an important part of Software Development, in which it checks that the software works as expected with the help of Software testing techniques. As developers grow from beginners to more experienced ones, it becomes even more important to understand the various types of testing, m
    10 min read
  • What is Software Testing?
    Software testing is an important process in the Software Development Lifecycle(SDLC). It involves verifying and validating that a Software Application is free of bugs, meets the technical requirements set by its Design and Development, and satisfies user requirements efficiently and effectively. Her
    11 min read
  • Principles of Software testing - Software Testing
    Software testing is an important aspect of software development, ensuring that applications function correctly and meet user expectations. In this article, we will go into the principles of software testing, exploring key concepts and methodologies to enhance product quality. From test planning to e
    10 min read
  • Software Development Life Cycle (SDLC)
    Software development life cycle (SDLC) is a structured process that is used to design, develop, and test good-quality software. SDLC, or software development life cycle, is a methodology that defines the entire procedure of software development step-by-step. The goal of the SDLC life cycle model is
    11 min read
  • Software Testing Life Cycle (STLC)
    The Software Testing Life Cycle (STLC) in which a process to verify whether the Software Quality meets to the expectations or not. STLC is an important process that provides a simple approach to testing through the step-by-step process, which we are discussing here. Software Testing Life Cycle (STLC
    7 min read
  • Types of Software Testing
    Software Testing is an important part of the Software Development Lifecycle, which includes many more Types of Software Testing that we are discussing here in detail. Read More: Software Development Life Cycle. Table of Content Different Types of Software Testing1. Manual Testing 2. Automation Testi
    15+ min read
  • Levels of Software Testing
    Software Testing is an important part of the Software Development Life Cycle which is help to verify the product is working as expected or not. In SDLC, we used different levels of testing to find bugs and errors. Here we are learning those Levels of Testing in detail. Table of Content What Are the
    4 min read
  • Test Maturity Model - Software Testing
    The Test Maturity Model (TMM) in software testing is a framework for assessing the software testing process to improve it. It is based on the Capability Maturity Model(CMM). It was first produced by the Illinois Institute of Technology to assess the maturity of the test processes and to provide targ
    8 min read
  • SDLC MODELS

    • Waterfall Model - Software Engineering
      The Waterfall Model is a Traditional Software Development Methodology. It was first introduced by Winston W. Royce in 1970. It is a linear and sequential approach to software development that consists of several phases. This classical waterfall model is simple and idealistic. It is important because
      13 min read

    • What is Spiral Model in Software Engineering?
      The Spiral Model is one of the most important SDLC model. The Spiral Model is a combination of the waterfall model and the iterative model. It provides support for Risk Handling. The Spiral Model was first proposed by Barry Boehm. This article focuses on discussing the Spiral Model in detail. Table
      9 min read

    • What is a Hybrid Work Model?
      Hybrid means a thing made by a combination of two different elements and the resulting hybrid element acquires characteristics of both underline elements. The following topics of the hybrid model will be discussed here: What is the Hybrid Model?Why the Hybrid Model?When To Use a Hybrid ModelProcess
      13 min read

    • Prototyping Model - Software Engineering
      Prototyping Model is a way of developing software where an early version, or prototype, of the product is created and shared with users for feedback. The Prototyping Model concept is described below: Table of Content What is Prototyping Model?Phases of Prototyping ModelTypes of Prototyping ModelsAdv
      7 min read

    • SDLC V-Model - Software Engineering
      The SDLC V-Model is a Types of Software Development Life Cycle (SDLC), which is used in Software Development process. In V-Model is the extension of the Traditional Software Development Model. It is creating a Structure like the "V" which includes the different phases which we are discussing here in
      10 min read

    TYPES OF TESTING

    • Manual Testing - Software Testing
      Manual testing is a crucial part of software development. Unlike automated testing, it involves a person actively using the software to find bugs and issues. This hands-on approach helps ensure the software works as intended and meets user needs. In this article, we'll explain what manual testing is
      12 min read

    • Automation Testing - Software Testing
      Automated Testing means using special software for tasks that people usually do when checking and testing a software product. Nowadays, many software projects use automation testing from start to end, especially in agile and DevOps methods. This means the engineering team runs tests automatically wi
      15+ min read

geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences