290 likes | 888 Views
Smoke testing. Gediminas Rimša. Origin of the Term. Used in the plumbing industry since 1875 . Smoke testing ( Software ). aka Build Acceptance Testing P reliminary testing to detect simple failures severe enough to reject a prospective software release
E N D
Smoke testing Gediminas Rimša
OriginoftheTerm • Usedintheplumbing industrysince1875.
Smoketesting (Software) • akaBuildAcceptanceTesting • Preliminarytesting to detectsimple failures severe enough to reject a prospective software release • Allows to quicklyrejectthebuilddue to obviousdefectsbefore testing it morethoroughly
Smoketestfeatures • Intendedto preventcatastrophicfailures • Testsmostcriticalfunctionality • Automatablenature • Cheap • Fast
Smoketestcategories • Unittests • Testsindividualfunctions/methods • Runaspartofthebuildassemblyprocess • Functionaltests • Testsapplicationas a whole • Runonnewlyassembledbuild
Common(?) scenario • Noautomatictests • Noresourcesdedicated to writingtests • Need to improvesoftwarequality
Possiblestrategy • Write a fewunittests to covermostcriticalfunctions/methods • Basicfunctionaltests (webapplication): • Doestheapplicationstart? • Doallwebpages loadwithouterrors? • Docorefeatures (e.g. login) work?
Functionalsmoketests: Tools • Simpleshellscripts (curl/wget)- Testing pageoutput / ifthepageloads at all • Specializedweb testing tools, e.g. Selenium- Testing morecomplexfeatures
curloutput >> curl -IsLmif.vu.lt HTTP/1.1 302 Found Date: Wed, 20 Nov 2013 22:02:21 GMT Server: Apache/2.2.16 (Debian) Location: http://mif.vu.lt/lt2/ Vary: Accept-Encoding Content-Type:text/html; charset=iso-8859-1 HTTP/1.1 200 OK Date: Wed, 20 Nov 2013 22:02:21 GMT Server: Zope/(2.13.10, python 2.6.7, linux2) ZServer/1.1 Content-Length: 701 Accept-Ranges:none Last-Modified:Wed, 20 Nov 2013 22:02:21 GMT Content-Type:text/html Vary: Accept-Encoding
Quicktestexample function test { res=`curl -s -o /dev/null -I -L -w %{http_code} $1` if [ $res -ne 200 ] then echo "Error: $res on $1" fi } test mif.vu.lt test http://mif.vu.lt/lt2/apie-mif-does-not-exist test http://mif.vu.lt/lt2/apie-mif Output: Error 404 on http://mif.vu.lt/lt2/apie-mif-does-not-exist
Integrateswellwithbuildprocess • Rununittests • Assemblewebapplication • Deployapplication • Runfunctionalsmoketests
Expectedoutcome • Timespent: a fewdays at most • A reliablewayto ensurethatapplication at leastsomewhatworks • Solidbase forgraduallydevelopingmoreand/ormoreelaborateautomatedunit/functionaltests