||This article needs additional citations for verification. (December 2009)|
Smoke testing refers to physical tests made to closed systems of pipes to detect cracks/breaks. By metaphorical extension, the term is also used for the first test made after assembly or repairs to a system, to provide some assurance that the system under test will not catastrophically fail. After a smoke test proves that "the pipes will not leak, the keys seal properly, the circuit will not burn, or the software will not crash outright," the system is ready for more robust testing.
History of the term 
|This section may contain previously unpublished synthesis of published material that conveys ideas not attributable to the original sources. (October 2012)|
The plumbing industry started using the smoke test in 1875.
Later this usage seems to have been forgotten, leading some to believe the term originated in the electronics industry: "The phrase smoke test comes from [electronic] hardware testing. You plug in a new board and turn on the power. If you see smoke coming from the board, turn off the power. You don't have to do any more testing." 
Smoke testing in various industries 
In plumbing a smoke test forces non-toxic, artificially created smoke through waste and drain pipes under a slight pressure to find leaks. Plumes of smoke form where there are defects. This test can be performed when the plumbing is brand new, but more often it is used to find sewer gas leaks that may plague a building or an area. Any sign of smoke escaping can be considered a possible site for sewer gas to escape. Sewer gas typically has a rotten egg smell and can contain methane gas, which is explosive, or hydrogen sulfide gas, which is deadly.
Plumbing smoke tests are also used to find places where pipes will spill fluid, and to check sanitary sewer systems for places where ground water and storm runoff can enter. Smoke testing is particularly useful in places such as ventilated sanitary sewer systems, where completely sealing the system is not practical.
When smoke testing a sanitary sewer system it is helpful to partially block off the section of sewer to be tested. This can be done by using a sand bag on the end of a rope. The sand bag is lowered into the manhole and swung into position to partially block lines. Completely blocking the line can cause water to back up and prevent smoke from escaping through defects. Smoke testing may not be done after rain or when ground water is unusually high as this may also prevent detection of defects.
Large downdraft fans, usually powered by gasoline engines, are placed on top of open manholes at either end of the section to be tested. If possible all lines in the manholes except for the line between the manholes are partially blocked. Smoke is created using either a smoke bomb or liquid smoke. Smoke bombs are lit and placed on a grate or in a holder on top of each fan, while liquid smoke is injected into the fan via a heating chamber. The fans create a pressure differential that forces the smoke into the sewer at a pressure just above atmospheric. With properly installed plumbing, the traps will prevent the smoke from entering the house and redirect it out the plumbing vents. Defective plumbing systems or dry traps will allow smoke to enter the inside of the house.
The area around the section being tested is searched for smoke plumes. Plumes coming from plumbing vents or the interface between the fan shroud and manhole rim are normal; however, smoke plumes outside of the manhole rim are not. Plumes are marked, usually with flags, and defects are noted using measurements from stationary landmarks like the corners of houses. The plumes or markers may also be photographed.
Woodwind instrument repair 
In woodwind instrument repair, a smoke test involves plugging one end of an instrument and blowing smoke into the other to test for leaks. Escaping smoke reveals improperly seated pads and faulty joints (i.e. leaks). After this test the instrument is cleaned to remove nicotine and other deposits left by the smoke. Due to tobacco smoke being used, this test may be hazardous to the health of the technician in the long run.
Described in a repair manual written in the 1930s. smoke testing is considered obsolete, and is no longer used by reputable technicians. The usual alternative to smoke is to place a bright light inside the instrument then check for light appearing around pads and joints.
Automotive repair 
In the same way that plumbing and woodwind instruments are tested, the vacuum systems of automobiles may be tested in order to locate difficult-to-find vacuum leaks. Artificial smoke is deliberately introduced into the system under slight pressure and any leaks are indicated by the escaping smoke. Smoke can also be used to locate difficult-to-find leaks in the fuel evaporative emissions control (EVAP) system.
Infectious disease control 
In infectious disease control a smoke test is done to see whether a room is under negative pressure. A tube containing smoke is held near the bottom of the negative pressure room door, about two inches in front of the door. The smoke tube is held parallel to the door, and a small amount of smoke is then generated by gently squeezing the bulb. Care is taken to release the smoke from the tube slowly to ensure the velocity of the smoke from the tube does not overpower the air velocity. If the room is at negative pressure, the smoke will travel under the door and into the room. If the room is not at negative pressure, the smoke will be blown outward or will stay stationary.
||It has been suggested that this section be split into a new article titled Smoke testing (entertainment). (Discuss) Proposed since March 2013.|
In the entertainment industry a smoke test is done to ensure that theatrical smoke and fog used during a live event will not set off the smoke detectors in a venue. To smoke test a venue the venue is filled to the full capacity with smoke to see if there are any smoke detectors still live, or if there are any leaks of smoke from the venue sufficient to set off detectors in other parts of the venue being tested.
Electronics and electrical engineering 
||It has been suggested that this section be split into a new article titled Smoke testing (Electronics and electrical engineering). (Discuss) Proposed since March 2013.|
In electronics and electrical engineering the term smoke test or power on test is used to refer to the first time a circuit under development is attached to power, which will sometimes produce actual smoke if a design or wiring mistake has been made. Most often this smoke comes from burning resistors, which produce a unique smell familiar to many technicians. For certain circuits, overheating and burning due to circuitry that is still not properly operating can be avoided by slowly turning up the input voltage to the unit under test by using a variable autotransformer and watching the electric current consumption. As a poor-man's "autotransformer", a properly sized incandescent light bulb in series with the power feed can provide a similar benefit: if the unit under test has a short circuit or other overload, the bulb will light up and provide a high resistance, limiting or preventing further damage to the unit being tested.
Overloaded integrated circuits typically produce "blue smoke" (or magic smoke). "Blue smoke" is the subject of jokes among technicians who refer to it as if it were a genie in the circuit: It's the blue smoke that makes it work—let out the blue smoke and it won't do anything.
Software development 
||It has been suggested that this section be split into a new article titled Smoke testing (software engineering). (Discuss) Proposed since March 2013.|
In computer programming and software testing, smoke testing is preliminary testing to reveal simple failures severe enough to reject a prospective software release. In this case, the smoke is metaphorical. A subset of test cases that cover the most important functionality of a component or system are selected and run, to ascertain if the most crucial functions of a program work correctly. For example, a smoke test may ask basic questions like "Does the program run?", "Does it open a window?", or "Does clicking the main button do anything?" The purpose is to determine whether the application is so badly broken that further testing is unnecessary. As the book "Lessons Learned in Software Testing"  puts it, "smoke tests broadly cover product features in a limited time ... if key features don't work or if key bugs haven't yet been fixed, your team won't waste further time installing or testing".
A daily build and smoke test is among industry best practices. Smoke testing is also done by testers before accepting a build for further testing. Microsoft claims that after code reviews, "smoke testing is the most cost effective method for identifying and fixing defects in software". In Microsoft's case, a smoke test is the process of validating code changes before they are checked into source control.
Smoke tests can either be performed manually or using an automated tool. When automated tools are used, the tests are often initiated by the same process that generates the build itself.
Smoke tests can be broadly categorized as functional tests or unit tests. Functional tests exercise the complete program with various inputs. Unit tests exercise individual functions, subroutines, or object methods. Both functional testing tools and unit testing tools tend to be third-party products that are not part of the compiler suite. Functional tests may be a scripted series of program inputs, possibly even with an automated mechanism for controlling mouse movements. Unit tests can be implemented either as separate functions within the code itself, or else as a driver layer that links to the code without altering the code being tested.
See also 
- Buchan, W.P. " Institution of the Smoke-Test for Drains. Read before the Royal Scottish Society of Arts, 13 April 1891. Retrieved 2011-06-24.
- Kaner, Bach, and Pettichord. "Lessons Learned in Software Testing". Wiley Computer Publishing, 2002, p. 95. ISBN 0-471-08112-4
- "Smoke Testing: The Diagnostic Secret Weapon". masterplumbers.com.
- Anthony Baines, Woodwind Instruments and their history", 1967 (page 355)
- Dustin, Rashka, Paul. "Automated Software Testing -Introduction, Management, and Performance". Addison-Wesley 1999, p. 43-44. ISBN 0-201-43287-0.
- Cem Kaner, James Bach, Bret Pettichord, Lessons learned in software testing: a context-driven approach. Wiley, 2001
- Author unknown (date unknown). "How to: Configure and Run Build Verification Tests (BVTs)". MSDN Library for Visual Studio 2005. Retrieved on 2010-11-20 from http://msdn.microsoft.com/en-us/library/ms182465%28v=VS.80%29.aspx.
- McConnell, Steve. "Rapid Development". Microsoft Press, p. 405
- Author unknown (date unknown). "Guidelines for Smoke Testing". MSDN Library for Visual Studio 2005. Retrieved on 2010-11-20 from http://msdn.microsoft.com/en-us/library/ms182613(VS.80).aspx.