Random Testing Can KAYA 201171221 SQA&Testing – Cankaya University Ankara-TURKEY November 28,2012
Outline Who invented Random Testing ? What is Random Testing ? Why we use RT ? How we use RT? Main types of random testing techniques When we use RT ? Example Where we use RT ? Pros & Cons RT Tools
Spesification-Based Techniques Equivalance partitioning Boundary value analysis Decision table Finite-state machine method Testing from formal spesification Random testing
Who invented Random Testing ? Random testing was mentioned first time in the The Art Of Software Testing book of Glenford J. Myers in 1979
What is Random Testing ? All of the test inputs are generated randomly (often using a tool). İt is a black box testing
Why we use RT ?• Random testing gives us an advantage of easily estimating software reliability from test outcomes. Test inputs are randomly generated according to an operational profile, and failure times are recorded• The data obtained from random testing can then be used to estimate reliability. Other testing methods cannot be used in this way to estimate software reliability• Use of random test inputs may save some of the time and effort that more thoughtful test input selection methods require.(domain is well- structured)
How we use RT? Random Testing can be summarized as a four-step procedure1. The input domain is identified2. Test inputs are selected independently from the domain3. The system under test is executed on these inputs. This inputs constitude a random test set.4. The results are compared to the system spesification. The test is a failure if any input leads to incorrect results; otherwise it is a success.
Main types of random testing techniques:1. Random input data generation2. Random sequence of data input (sometimes called as stochastic testing)3. Random data selection from existing database It is possible to combine all the above testing techniques.
When we use RT ?• If we have a lot time and we want to more reliability product.• If we dont have enought time to testing product, but we must to test it.• We must consider the time needed to write a random test generator vs the time to write a set of directed tests(or generators).• We doing random testing ensure that our tests are sufficiently random, and they cover specifications.
Example:• For example, if the valid input domain for a module integers between 1 and 100, the tester using this approach would randomly, or unsystematically, select values from within that domain; for example, the values 55,24,3 mighht be chosen. Given this approach, some of the issues that remain open are the following:• Are the three values adequate to show that the module meets its specification when the tests are run ? Should additional or fewer values be used to make the most effective use of resources ?• Are there any input values, other than those selected, more likely to reveal defects ? For example, should positive integers at the beginning or end of the domain be specifically selected as inputs ?• Should any values outside the valid domain be used as test inputs? For example, should test data include floating point values, negative values, or integer values greater than 100 ?
Where we use RT ?• Random Testing techniques are applicable for any single project. They will change from project to project.• Usually required for the current project testing techniques are described in the test plan.• Different testing techniques can find different types of defects.
What is benefit ?• If the domain is well-structured, automatic generation can be used, allowing many more test cases to be run than if tests are manually generated.• We can give surprisingly good result by using correct alghorithm of course if the domain is well- structured
RT has the following weakness• They are not realistic• Many of the tests are redundant and unrealistic• You will spend more time analyzing results• You cannot recreate the test if you do not record what data was used for testing• There is no measure of risk• Random testing is, of course, the most used and least useful method
RT Tools• Jcheck• Randoop• Yeti-TEST• A Lightweight Tool
References• Software Testing and Quality Assurance: Theory and Practice By Sagar Naik, Piyu Tripathy• Software Testing By Koirala Koirala, Sheikh Sheikh• Practical Software Testing: A Process-Oriented Approach By Ilene Burnstein• http://c2.com/cgi/wiki?RandomTesting• http://extremesoftwaretesting.com/Techniques/Ran domTesting.html