API Testing

A guide to smoke testing

Figure out how smoke testing works and learn its benefits and best practices in this blog. You can also find out the advantages of automated testing versus manual testing and the difference between sanity and smoke testing.

Written by Arman
Published On Mon Aug 23 2021
Last Updated Fri May 24 2024

In software development, smoke testing is an important early stage that confirms that fundamental functionalities work before doing more thorough tests. Doing so speeds up the development process by identifying critical problems early on. If you want to find out what smoke testing is, why we need it, how to do it, and how to use it in API testing, you are in the right blog.

What is smoke testing?

In software development, smoke testing is a handy testing method to ensure that a program’s most important features are still working correctly after a build or an upgrade. Software smoke testing verifies that the main functionalities of the program are working and prepared for more thorough testing, just like hardware smoke testing, which certifies a minimum operating level.

Unlike regression or functional testing, smoke testing focuses on covering a wide range of features instead of going into depth. It covers the application’s main features without going into further details. This testing technique allows developers to find and fix critical issues early on instead of progressing to later phases with issues that will cause bigger problems and consume more time and budget.

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 up multiple stories about the origin of smoke testing. We shall share two of them with you!

The term “smoke test” comes from electronic hardware testing, where any sign of smoke is checked before doing further tests or soldering the device into place.

In the 1950s, the term “smoke testing ” was used by aircraft manufacturers to make sure their planes were in good working condition before flying. 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 kinds of smoke testing, both having their own benefits and purposes.

Static Smoke Testing analyses a software’s codebase without running the program. It’s similar to checking for syntax problems, missing declarations or other stuff that can be detected without running the software. Static analysis tools can automate this approach by scanning the code for specific patterns that indicate common issues. For instance, a static analysis tool can flag code that may cause 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. It is especially useful for large projects, where there is a lot of code that makes manual code reviews impossible.

In contrast, Dynamic Smoke Testing involves running the program in a runtime environment to ensure the most important features of the program work as they should. 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

In Manual Smoke Testing, human testers run a predefined set of tests without using automated tools. They manually interact with the software’s interface to ensure the essential functionalities work as they should.

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 when testing user interfaces and user experiences where subjective evaluation is required.

Cons: Manual testing is time-consuming, and human mistakes might be faced, especially in 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 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 is good for stable environments with repetitive tasks, while manual testing is better for scenarios where you need more investigations or when you want to deal with user experience stuff. When you combine these two methods, you can benefit from their strengths and make sure testing resources are used efficiently.

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?

Smoke testing aims to figure out if the software has any major faults or defects that need to be corrected.

Depending on the test target and test suite size, running functional and non-functional tests can be slow. Because of this, QA teams often run smoke tests to find out what’s working and what isn’t before spending more time and effort on complete functional testing and non-functional testing in order to save time and be more flexible.

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 where new code changes are continuously delivered, immediately built, tested, and deployed into a live environment, usually with minimal human intervention. Smoke tests are usually the first tests run by your CI pipeline as part of the build and deployment process. They should not replace your unit or functional tests, but they can help detect problems in your codebase.

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 quickly identifies major issues by focusing on an application’s main functionalities. Taking early action is important because it stops problems from getting worse, which could make fixing them later harder and more expensive.

Saving Time and Resources

Development teams can evaluate the stability of software more quickly and efficiently by using smoke testing instead of investing a lot of resources in more detailed testing phases. This approach allows possible problems to be solved quickly and without requiring a lot of rework, which leads to shorter development cycles and lower costs.

Improving Stability

Before moving to more detailed testing phases, it’s important to make sure that an application’s basic functions are working properly. This approach helps improve the overall stability of the software and makes the development process more reliable.

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

Best Practices for Smoke Testing

There are some best practices that can be implemented to make smoke testing more effective and efficient in the software development lifecycle. These techniques ensure that smoke testing does its job of early problem discovery.

Automating Tests

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

Maintaining Test Cases

It’s essential to keep your smoke test cases up to date. Test cases should evolve as the software does to cover changes in functionality. This will ensure that smoke testing is still effective in detecting issues early.

Integrating with CI/CD Pipelines

Another best practice that uses automation is adding smoke testing to Continuous Integration/Continuous Deployment (CI/CD) pipelines. When smoke tests are performed automatically as part of the CI/CD process, issues and bugs can be detected and addressed quickly and only builds that pass these first checks advance in the deployment pipeline.

Regular Updates

The smoke testing suite must be updated regularly to cover the application’s new features. This approach ensures that, throughout time, the smoke testing suite adjusts to the application’s growth and is still effective 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 important components of the software testing lifecycle, but they have different functionalities and are used at different stages of the development process. Knowing the differences can help teams to use each of them better to improve software quality and efficiency.

Smoke Testing is usually the first test performed on an initial or new build to check that all key functionalities are working and no major bugs are preventing the build from advancing to more detailed testing phases. Its main goal is to ensure that a build is stable enough for future testing.

On the other hand, Sanity Testing is more detailed and is performed later in the testing process. It is performed after receiving a software build with small changes to check that the bugs have been fixed and the new changes have not introduced new issues. Sanity testing is a kind of regression testing that focuses on examining certain functionalities rather than the entire system.

Choosing between smoke and sanity testing depends on the context and objective of the testing phase:

  • Smoke Testing is used when a new build is being created, and it has to be reviewed for major bugs or failures before it goes through more detailed testing.
  • Sanity testing is performed after a minor build or when specific issues in the software have been fixed to ensure that the changes 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 using 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 diagram below 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 because it works as an initial checkpoint to ensure that the main functionalities of an application are working as they should after a build or update. This technique helps detect major flaws early, which saves time and resources. Some best practices are also mentioned in this blog to use smoke testing’s maximum potential. If you have any questions or any feedback, feel free to drop them in the comments.

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.

Comments, Questions, or Feedback? Post it here!

0 comments

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.