Blog / API Testing

A guide to smoke testing

Discover the fundamentals of smoke testing with our comprehensive guide. Learn the benefits and best practices for enhancing software testing procedures. Discover the advantages of automated versus manual testing, essential tools, and the difference between sanity and smoke testing. Suitable for QA specialists and developers.

Written byArman
Published OnMon Aug 23 2021
Last UpdatedWed Feb 14 2024

In software development, smoke testing is a crucial early stage, confirming fundamental functionality before more thorough testing. This quick initial check speeds up development and enhances quality by identifying critical problems early on. Smoke testing is a software development process where a sufficient amount of code is written for a product to function enough to test the basic functionality of the product. It is a type of rudimentary software testing and, when used for API testing, a variety of black-box testing. This post is about smoke testing. What is it? Why do we need it? How to do it? You’ll find the answers here.

What is smoke testing?

In software development, smoke testing is a fundamental testing technique to ensure that a program’s most important features continue performing as intended after a build or upgrade. Appropriately named, this type of testing is similar to hardware testing: software smoke testing verifies that the main aspects of the program are functional and prepared for additional testing, much like hardware smoke testing certifies a minimum operating level.

Unlike other testing methods, such as regression or functional testing, smoke testing focuses on breadth rather than depth. It aims to cover the application’s main pathways without going into further details, making it a more efficient and cost-effective initial assessment tool. This strategy enables developers to identify and correct critical issues early on, preventing them from progressing to later phases, which are more expensive and time-consuming.

Smoke testing is also known as sanity test, build verification test (BVT), or build verification (BV).

Smoke tests are typically automated and can be used to verify that the application is ready for further testing.

To illustrate, consider a table comparing smoke testing with regression testing:

Testing TypeObjectiveScopeWhen It’s Performed
Smoke TestingVerify basic functionality of the application.Broad, covering main pathsAfter a new build is deployed
Regression TestingEnsure recent changes haven’t affected existing functionalityDetailed, covering all aspectsAfter changes or updates

Origin of smoke testing

A quick search on the internet brings multiple stories about the origin of smoke testing. We shall share two of them with you!

The term smoke test comes from the practice of electronic hardware testing by checking for any sign of smoke before the device is soldered into place or further testing is commenced.

In the 1950s, the term “smoke testing ” was used by aircraft manufacturers to ensure that their planes were in good working condition before they took flight. Essentially, it was a way for the manufacturers to smoke out any faults on the aircraft (haha).

Types of Smoke Testing

Static vs. Dynamic

Static and dynamic smoke testing are two essential techniques in software development and quality assurance, each serving a different purpose and providing distinct benefits.

Static Smoke Testing is the analysis of a software’s codebase without running the program. It’s similar to checking a draft for syntax problems, missing declarations, or other anomalies that can be detected without running the software. This approach can be automated using static analysis tools, which analyze the code for predetermined patterns indicating frequent problems. A static analysis tool, for example, may identify code that could result in a null pointer exception.

Benefits and Use Cases: Static smoke testing helps developers find and fix bugs early in the process, saving time and money on more resource-intensive testing phases. Large projects, where a large amount of code may make manual code reviews impossible, benefit the most from it.

In contrast, Dynamic Smoke Testing involves running the program in a runtime environment to ensure the most important features operate as intended. In contrast to static testing, dynamic smoke testing concentrates on the operational features of the program rather than its code structure and necessitates that the program be in a runnable condition.

Examples include running software to ensure it launches correctly and performing simple user interactions to verify essential functionality. This type of testing is essential when evaluating software behaviour in conditions that closely mimic the end-user environment.

Benefits and Use Cases: After builds or deployments, dynamic smoke testing is crucial for identifying critical functional problems that could make the software unusable. Checking the software release’s health soon is a good idea before moving on to more complicated testing procedures.

AspectStatic Smoke TestingDynamic Smoke Testing
DefinitionExamination of the software’s codebase without executing the program.Executing the software in a runtime environment to verify critical functions work.
When to UseEarly in the development cycle to identify errors before moving to resource-intensive stages.After builds or deployments to catch major functional errors.
BenefitsIdentifies and rectifies errors early, beneficial for large projects.Quickly assesses the health of a software release before detailed testing phases.
ExamplesUsing static analysis tools to scan code for errors.Launching an application to ensure it starts up correctly or performing basic user interactions.

Manual vs. Automated

Manual Smoke Testing involves human testers running a predetermined set of tests without using automated tools. Testers manually interact with the software’s interface, ensuring the essential capabilities work as intended.

Pros: Manual testing is flexible and easy to use, allowing testers to experience the program through the eyes of an end user. It’s beneficial for exploratory testing or when testing user interfaces and user experiences where subjective evaluation is required.

Cons: Manual testing is time-consuming and prone to human mistakes, particularly in repetitive tasks or large-scale projects.

Automated Smoke Testing uses tools and scripts to execute predefined test scenarios. This method is effective for repeatedly running the same set of tests, such as after each build or deployment.

Tools Used: Popular tools for automated smoke testing include Selenium for web applications, Appium for mobile apps, and Jenkins for continuous integration pipelines.

Pros: Automation saves time and resources on smoke testing, allowing for more frequent and consistent testing cycles. It is perfect for regression testing and large projects where manual testing is not an option.

Cons: The initial setup for automated testing can be complicated and time-consuming, involving a large upfront investment in scripting and tool configuration.

Scenarios Best Suited: Automated testing works well in stable environments with repetitive tasks, whereas manual testing excels in exploratory scenarios and user experience assessments. Combining the two methodologies can use their respective strengths, ensuring full coverage and efficient use of testing resources.

AspectManual Smoke TestingAutomated Smoke Testing
ImplementationHuman testers executing tests without automation tools.Using tools and scripts to execute predefined test cases automatically.
Tools UsedN/ASelenium, Appium, Jenkins, etc.
Scenarios Best SuitedExploratory testing, user interfaces, and experience assessments where subjective assessment is crucial.Stable environments with repetitive tasks, ideal for regression testing and large projects.
Pros and ConsFlexible and intuitive but time-consuming and prone to human error.Reduces time and resources required but needs significant upfront investment in scripting and setup.

What is the goal of smoke testing?

The goal of smoke testing is to determine if the software has any major faults or defects that need to be corrected. Smoke testing is conducted on an application after it has been coded, tested, and debugged.

Depending on the test target and test suite size, running functional and non-functional tests can be slow at times. As a result, QA teams often run smoke tests to discover what’s working and what isn’t before they invest more time and effort into complete functional testing and non-functional testing to save time and be nimble.

When should smoke testing be done?

Smoke testing makes sense when a sufficient amount of code is written for a product to function enough to test the basic functionality.

Continuous integration (CI) is a software development process in which new code changes are continuously delivered and immediately build, tested, and deployed into a live environment, usually with little or no human intervention. Smoke tests are generally one of the first tests executed by your CI pipeline as part of a build and deploy process. They should not replace your unit or functional tests, but they should help detect your codebase problems.

Smoke testing is a specific type of integration test that checks to see if a build is broken.

Key Benefits of Smoke Testing

Early Defect Detection

Smoke testing identifies major issues immediately by focusing on a software application’s key capabilities. This early action is critical because it prevents the advancement of problems, which could increase the difficulty and cost of resolving them later.

Saving Time and Resources

Development teams can evaluate the stability of a software build more quickly and with greater agility by using smoke testing instead of investing a lot of resources in more detailed testing phases. Because possible problems are resolved fast and without requiring a lot of rework, this efficiency is correlated with shorter development cycles and lower costs.

Improving Stability

Ensuring an application’s fundamental functions are operational before moving on to more detailed testing phases improves the software’s overall stability. This basic check serves as a quality gate, increasing the reliability of the development process.

Potential Savings Examples: Imagine a critical bug is discovered during smoke testing of an e-commerce platform’s checkout process. Detecting and correcting this issue early can save significant costs related to downtime and client dissatisfaction that would occur if the bug was discovered after deployment.

Best Practices for Smoke Testing

Several best practices can be implemented to maximize the effectiveness and efficiency of smoke testing in the software development lifecycle. These techniques ensure a more efficient and dependable development process by ensuring that smoke testing fulfils its objective of early problem discovery.

Automating Tests

One of the most common approaches is to automate smoke tests. Automating these basic checks can significantly reduce the time between development cycles, providing faster feedback on the stability of software builds. Automation tools like Selenium for web apps and Appium for mobile platforms can be used to execute smoke tests consistently and efficiently after each build or deployment.

Maintaining Test Cases

Keeping smoke test cases up to date is essential. As software evolves, so should the test cases to account for changes in functionality and user requirements. This maintenance ensures that smoke testing is still relevant and effective in detecting issues early in development.

Integrating with CI/CD Pipelines

Adding smoke testing to Continuous Integration/Continuous Deployment (CI/CD) pipelines is a best practice that uses automation to improve software quality. By performing smoke tests automatically as part of the CI/CD process, teams can quickly detect and address issues, ensuring that only builds that pass these first checks advance in the deployment pipeline.

Regular Updates

Finally, the smoke testing suite must be updated regularly to cover the application’s new features and critical areas. This method ensures extensive coverage throughout time, adjusting to the application’s growth and changes while keeping its effectiveness in detecting issues early.

Common Tools for Smoke Testing

ToolFeaturesAdvantagesBest Suited For
SeleniumCross-browser automation, multiple language supportFlexibility, cross-platform testing, community supportWeb application smoke testing
AppiumPlatform-independent, supports native and hybrid appsNo app modification required, multi-language supportMobile application smoke testing

Smoke Testing vs. Sanity Testing: Understanding the Differences

Smoke testing and sanity testing are both essential components of the software testing lifecycle, but they serve different functions and are used at different stages of the development process. Understanding the differences can help teams use each strategy more successfully to improve software quality and efficiency.

Smoke Testing is frequently the first test performed on an initial or fresh build to check that all key functionalities are operational and that no major bugs prevent the build from advancing to more detailed testing phases. Its primary goal is ensuring a build is stable enough for future testing.

On the other hand, Sanity Testing is more concentrated and is performed later in the testing process. After receiving a software build with minor changes, it is performed to check that the bugs have been fixed and that these changes have introduced no new issues. As a kind of regression testing, sanity testing focuses on examining certain functionalities rather than the entire system.

The selection factors for choosing between smoke and sanity testing depend on the context and objectives of the testing phase:

  • Smoke Testing is used when a new build is being created and has to be reviewed for major failures before it is put through detailed testing.
  • Sanity testing is performed after minor builds or specific issues in the software have been resolved to ensure that the changes function as expected and do not cause new problems.

How to do smoke testing (step by step)

Ideally, smoke testing should be one step within a CI pipeline. Moreover, we highly recommend leveraging functional tests for some of the most critical aspects of your software in a test suite for smoke testing.

We highly recommend running smoke tests daily against the code in the main branch

As we mentioned earlier, smoke tests are meant to be executed many times, and during each build, it’s essential to pick the functional tests that run fast enough. The below diagram shows a standard software development workflow with smoke testing included in it:

Agile software development workflow with smoke testing

Example smoke test for API

Login is one of the most critical aspects of any application, and most APIs offer some endpoint for token generation. Considering how vital the login feature is for an online business, A functional test for login validation makes it a good candidate for a smoke test. The diagram below shows a two-step smoke test for login verification.

Example API smoke test

Conclusion

Smoke testing is an important stage in the software development lifecycle since it serves as an initial checkpoint to ensure that key functionalities of a software application are operational after a build or update. This technique not only allows for the early detection of major flaws, saving time and resources, but it also significantly improves product quality by ensuring stability before deeper testing phases. The use of best practices, such as automating tests and integrating them into CI/CD pipelines, is critical for maximizing smoke testing’s potential. Encouraging developers and testers to implement smoke testing into their processes emphasizes the necessity of delivering reliable, high-quality software efficiently.

Frequently Asked Questions

We got an answer for your questions

  • Is smoke testing required for all projects?

    Absolutely. Regardless of the project's scale, smoke testing is critical for ensuring the fundamental functionality of a new build or update. It guarantees that critical issues are identified and fixed before additional in-depth testing is performed.

  • Can smoke tests be automated?

    Yes, and doing so can considerably improve the efficiency of the testing procedure. Smoke tests can be automated and executed quickly whenever a new build is distributed, providing immediate feedback on the build's stability. Selenium for web applications and Appium for mobile apps are popular choices.

  • What is the difference between smoke testing and regression testing?

    While smoke testing is an initial check to ensure that the software's key features work after a new build, regression testing is more detailed to identify any bugs that may have been introduced during recent updates. Smoke testing is broad and shallow, whereas regression testing is thorough and detailed.

  • What are the best methods for conducting smoke tests?

    Best practices include automating the smoke testing process to allow for faster feedback, keeping a well-documented suite of smoke tests that cover core functionalities, and incorporating smoke testing into the continuous integration and continuous deployment (CI/CD) pipeline to ensure that every build is tested.

  • Should smoke testing be performed manually or automatically?

    While both procedures have advantages, automated smoke testing is widely chosen because of their speed and consistency. Automated smoke testing is useful in agile development contexts, when frequent builds and prompt feedback are required. On the other hand, manual smoke testing may be useful when automated tests are not possible or where exploratory testing requires human touch.

Testfully is a bootstrapped startup from Sydney, Australia.
We're funded by our supportive & amazing customers.

The word `testfully` is a registered trademark of Testfully Pty Ltd.