Chapter 6 Quantum Computing Based Software Testing Strategy (QCSTS)



Similar documents
Bits Superposition Quantum Parallelism

Quantum Computing. Robert Sizemore

Solving Mass Balances using Matrix Algebra

Quantum Computing and Grover s Algorithm

Orthogonal Projections

1 Review of Least Squares Solutions to Overdetermined Systems

Introduction to Matrix Algebra

Quantum Computing Lecture 7. Quantum Factoring. Anuj Dawar

Question 2: How do you solve a matrix equation using the matrix inverse?

Nonlinear Iterative Partial Least Squares Method

Lecture 13 - Basic Number Theory.

PATTERN RECOGNITION AND MACHINE LEARNING CHAPTER 4: LINEAR MODELS FOR CLASSIFICATION

Lecture 3: Finding integer solutions to systems of linear equations

[1] Diagonal factorization

Mathematics Course 111: Algebra I Part IV: Vector Spaces

x = + x 2 + x

Math 215 HW #6 Solutions

MAT 200, Midterm Exam Solution. a. (5 points) Compute the determinant of the matrix A =

Least-Squares Intersection of Lines

Binary search algorithm

Efficiency of algorithms. Algorithms. Efficiency of algorithms. Binary search and linear search. Best, worst and average case.

APP INVENTOR. Test Review

SYSTEMS OF EQUATIONS AND MATRICES WITH THE TI-89. by Joseph Collison

GRID SEARCHING Novel way of Searching 2D Array

Review Jeopardy. Blue vs. Orange. Review Jeopardy

Cryptography and Network Security. Prof. D. Mukhopadhyay. Department of Computer Science and Engineering. Indian Institute of Technology, Kharagpur

Solutions of Linear Equations in One Variable

Unified Lecture # 4 Vectors

Summary of important mathematical operations and formulas (from first tutorial):

3. INNER PRODUCT SPACES

A FUZZY BASED APPROACH TO TEXT MINING AND DOCUMENT CLUSTERING

Breaking The Code. Ryan Lowe. Ryan Lowe is currently a Ball State senior with a double major in Computer Science and Mathematics and

Data Mining: Algorithms and Applications Matrix Math Review

Using quantum computing to realize the Fourier Transform in computer vision applications

Recall that two vectors in are perpendicular or orthogonal provided that their dot

STATISTICS AND DATA ANALYSIS IN GEOLOGY, 3rd ed. Clarificationof zonationprocedure described onpp

Section 5.3. Section 5.3. u m ] l jj. = l jj u j + + l mj u m. v j = [ u 1 u j. l mj

Operation Count; Numerical Linear Algebra

Lecture L3 - Vectors, Matrices and Coordinate Transformations

The last three chapters introduced three major proof techniques: direct,

CS3220 Lecture Notes: QR factorization and orthogonal transformations

Solution of Linear Systems

Agile Development and Testing Practices highlighted by the case studies as being particularly valuable from a software quality perspective

Keywords Quantum logic gates, Quantum computing, Logic gate, Quantum computer

MASSACHUSETTS INSTITUTE OF TECHNOLOGY 6.436J/15.085J Fall 2008 Lecture 5 9/17/2008 RANDOM VARIABLES

Mehtap Ergüven Abstract of Ph.D. Dissertation for the degree of PhD of Engineering in Informatics

9.4. The Scalar Product. Introduction. Prerequisites. Learning Style. Learning Outcomes

MATH APPLIED MATRIX THEORY

Lecture 8 February 4

SALEM COMMUNITY COLLEGE Carneys Point, New Jersey COURSE SYLLABUS COVER SHEET. Action Taken (Please Check One) New Course Initiated

8 Square matrices continued: Determinants

Automated Model Based Testing for an Web Applications

Test Automation Framework

6. Standard Algorithms

5. Orthogonal matrices

Time Domain and Frequency Domain Techniques For Multi Shaker Time Waveform Replication

Chapter 7: Additional Topics

Cryptography and Network Security Department of Computer Science and Engineering Indian Institute of Technology Kharagpur

Algebra 2 Chapter 1 Vocabulary. identity - A statement that equates two equivalent expressions.

WESTMORELAND COUNTY PUBLIC SCHOOLS Integrated Instructional Pacing Guide and Checklist Computer Math

In mathematics, it is often important to get a handle on the error term of an approximation. For instance, people will write

Linear Algebra Notes for Marsden and Tromba Vector Calculus

1 VECTOR SPACES AND SUBSPACES

Sensitivity Analysis 3.1 AN EXAMPLE FOR ANALYSIS

Example: Credit card default, we may be more interested in predicting the probabilty of a default than classifying individuals as default or not.

Performance Tuning for the Teradata Database

Matrices 2. Solving Square Systems of Linear Equations; Inverse Matrices

Vector Notation: AB represents the vector from point A to point B on a graph. The vector can be computed by B A.

AMATH 352 Lecture 3 MATLAB Tutorial Starting MATLAB Entering Variables

Method To Solve Linear, Polynomial, or Absolute Value Inequalities:

LINEAR ALGEBRA W W L CHEN

CBE 6333, R. Levicky 1. Tensor Notation.

MATH10212 Linear Algebra. Systems of Linear Equations. Definition. An n-dimensional vector is a row or a column of n numbers (or letters): a 1.

1 Solving LPs: The Simplex Algorithm of George Dantzig

CSCE 465 Computer & Network Security

External Sorting. Chapter 13. Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 1

Data Structures. Algorithm Performance and Big O Analysis

Exploratory Factor Analysis

Oracle Insurance Policy Administration System Quality Assurance Testing Methodology. An Oracle White Paper August 2008

Chapter 6: Sensitivity Analysis

Solutions to Math 51 First Exam January 29, 2015

PROG0101 Fundamentals of Programming PROG0101 FUNDAMENTALS OF PROGRAMMING. Chapter 3 Algorithms

AP Physics - Vector Algrebra Tutorial

Chapter 6. Orthogonality

DERIVATIVES AS MATRICES; CHAIN RULE

Math Quizzes Winter 2009

Chapter 17. Orthogonal Matrices and Symmetries of Space

Applied Linear Algebra

Pseudo code Tutorial and Exercises Teacher s Version

LINEAR INEQUALITIES. less than, < 2x + 5 x 3 less than or equal to, greater than, > 3x 2 x 6 greater than or equal to,

External Sorting. Why Sort? 2-Way Sort: Requires 3 Buffers. Chapter 13

Content. Chapter 4 Functions Basic concepts on real functions 62. Credits 11

TIBCO Spotfire Guided Analytics. Transferring Best Practice Analytics from Experts to Everyone

Continued Fractions and the Euclidean Algorithm

Part I. Introduction

Cryptography and Network Security Prof. D. Mukhopadhyay Department of Computer Science and Engineering Indian Institute of Technology, Karagpur

How to Turn an AC Induction Motor Into a DC Motor (A Matter of Perspective) Steve Bowling Application Segments Engineer Microchip Technology, Inc.

Quantum Computers. And How Does Nature Compute? Kenneth W. Regan 1 University at Buffalo (SUNY) 21 May, Quantum Computers

Transcription:

Chapter 6 Quantum Computing Based Software Testing Strategy (QCSTS) 6.1 Introduction Software testing is a dual purpose process that reveals defects and is used to evaluate quality attributes of the software, such as reliability, security, usability, and correctness. The critical problem in software testing is its time complexity. In this chapter a new concept of software testing strategy, based on quantum computing, has been explored to show how software testing time complexity can be reduced by the application of quantum computing based algorithms, in common, and Grover s algorithm, in particular. The significance of said algorithm is to minimize not only time but also cost. Another added benefit of the algorithm is that the complexity is much less than other searching algorithms in use. As described in [52] the quantum computer is very suitable for handling problem that is hard to be dealt with by conventional computers because of the need for one by one solution. To remedy this problem, the said algorithm is proposed for solving the issue of database inquires. As per discussion [49, 52], it is expected that the said quantum computer would be marketed in the next five years. Some progress in this direction has already been made. As described in [25, 35, 46], 5% of the total system development time is spent in testing and costs accordingly. To resolve this problem some algorithms, tools or techniques to reduce the testing time and cost are required. The main problem of time taken may occur when the database is large and unsorted. As the tester executes test suites, the output message may show errors on a particular record. It becomes very difficult to reach the 139

particular record due to prolonged time and efforts required for correct record insertion because of a large sized database. To overcome the problems of time and cost, we studied several search algorithms and finally decided Grover s Algorithm to minimize both time and cost. The reason is that the complexity of the said algorithm is much lesser than other search algorithms. 6.2 Quantum Algorithm Based Software Testing A possible software testing technique is to verify that the system should satisfy its state equation y = f(x) for all possible values of x-input(s) i.e. for all possible states of input(s), the actual states of y-output(s) should be the same as the desired ones. The desired outputs can be stored in a look-up table along with their corresponding inputs. Finding an error state in such a scenario is just like searching a record in an unsorted database. This can then be achieved effectively using the quantum algorithm namely, Grover s algorithm. The purpose of Grover s Algorithm is described as searching unsorted databases with N entries using quantum computing in O(N 1/2 ) time and using O(LogN) storage space, which makes it the fastest possible algorithm for searching an unsorted database as described in [1, 2, 36, 4]. This is because of the fact that searching an unsorted database in classical computing, requires at least a linear search, which is O(N) in time. Grover s algorithm is obviously very useful and efficient when database (or N) is very large, just as in the case of complex software testing. Like many quantum computers algorithms, Grover s algorithm is probabilistic in the sense that it gives the correct 14

answer with high probability. Repeating the algorithm can decrease the probability of failure. The algorithm is based on quantum computing whereas Quantum Computers are expected in the world market in the near future as described in [36, 49]. By application of this algorithm it is expected that the testing time will be reduced considerably. Our existing digital computers are not capable to execute this algorithm because digital computers are based on & 1 logic but quantum computers are based on qubits [,..., 1]. The qubit is a system that belongs to closed interval [, 1]. It takes the values >and 1>, where notation > is called Dirac notation, and is a combination of intermediate values of and 1. An important concept that is extensively used in Grover s algorithm is that of Hadamard matrix, which is a square matrix whose entries are either +1 or 1 and whose rows are mutually orthogonal. This means that every two different rows in a Hadamard matrix represent two perpendicular vectors. This matrix is directly used as an error correcting code and to generate random numbers [9, 16, 18] Grover s algorithm is well organized, highly formal and unambiguous for inverting a function. This is because the algorithm is based on backtracking from output to input as we can always come up with a function y=f (x) that produces a particular value of y if x matches a desired entry in a database. 6.3 Application of Grover s Algorithm for Software Testing In order to express how the Grover s algorithm contributes in software testing, we have automated the steps of the algorithm in an application program. The program takes m 141

as input, which is the value of required number of bits, necessary to hold N records and can be expressed as log 2 N. It then automatically generates the 2 m x2 m Hadamard matrix (shown with/without the normalization factor) as well as the matrix of inversion about average transformation (shown with/without the normalization factor). The pseudo code for the important function of Hadamard matrix generation along with the pseudo code for the application of Grover s algorithm is given below: 6.3.1 Pseudo code for Hadamard Matrix Generation: function HM(m, matrix, x, y) if(m=) matrix[x,y]:=1; else for(i:=; i<2 m ; i:=i+2 m-1 ) for(j:=; j<2 m ; j:=j+2 m-1 ) if(i=j&&i=2 m-1 ) HM(m-1,matrix,x+i,y+j); //negate the following portion of the matrix matrix[x+i:2 m-1-1,y+j:2 m-1-1):=- matrix[x+i:2 m-1-1,y+j:2 m-1-1); else HM(m-1,matrix,x+i,y+j); end if end for end for end if end function 142

6.3.2 Pseudo code for Application of Grover s Algorithm: input m; had_mat:=define a matrix of dimensions 2 m x 2 m ; HM(m,had_mat,,); //Normalise the Hadamard matrix had_mat_norm:=had_mat/(2 m/2 ); A:=Define a matrix of dimensions 2 m x 2 m for inversion about average transformation; //Step1 of Grover s algorithm Qureg:= Define a matrix of dimensions 2 m x 1; Qureg[,]:=1; display(qureg); //Step2 of Grover's algorithm Qureg:=multiply(HMn,Qureg); display(qureg); //Step3 of Grover's algorithm Random subroutine:=new Random(); rnum:=subroutine.next(,2 m ); do if(qureg[rnum,]>=) Qureg[rnum,]:=-Qureg[rnum,]; end if display(qureg); //Step4 of Grover's algorithm Qureg:=multiply(A,Qureg); 143

display(qureg); until(desired probability not achieved); end do-until Then, it applies the Grover s algorithm step-by-step and displays the state of the Q- register after each step. Figure 1: Application prompt to give new value or quit the application. Figure 2: Application prompt to enter value of m (database items) and to generate the Hadamard matrix of order 2 m x 2 m. 144

Figure 3: Consider m=3 i.e. the database has N=8 records Figure 4: Displays a Hadamard Matrix of order 8x8 without normalization factor. Where, Hadamard matrix is a square matrix whose entries are either +1 or 1 and whose rows are mutually orthogonal. This means that every two different rows in a Hadamard matrix represent two perpendicular vectors. This matrix is directly used as an error correcting code. The Hadamard matrix can also be used to generate random numbers. 145

Figure 5: shows Hadamard matrix after multiplying the normalization factor which is 1/2 3/2 Figure 6: Displays an inversion about average, is represented by a matrix without normalization factor. This inversion operator is meant to rotate the phase of a given search record. 146

Figure 7: Shows inversion about average with normalization factor Then the Grover s algorithm was applied step-by-step and the results were as follow: After step-1 of Grover s algorithm, Qureg is: 1 After step-2 of Grover s algorithm, Qureg is: 147

After step-3 of Grover s algorithm, Qureg is: - After step-4 of Grover s algorithm, Qureg is: 1 148

In the last step of Grover s algorithm, the 6 th row gets the probability 1, identifying itself to be the desired mark state. The important point to note here is that the complexity statistics of this application program would clearly contradict the desired complexity of Grover s algorithm that is O (N 1/2 ). This is because of the fact that the algorithm is dependent on a quantum subroutine that marks a unique state, satisfying the condition C (S v) =1, in unit time. Obviously no reason can be assigned to this contradiction because of the current usage of a classical computer. This contradiction shall be defeated when the quantum subroutine becomes operational. Since the working procedure of the quantum subroutine is something in a black box for the Grover s algorithm, therefore, the application program takes assistance of a randomnumber generator that marks any record randomly whenever required. However, even this random marking of the record requires a traversing of the database and the worstcase complexity of even this traversal is O (N). Therefore, this useful program (especially for large values of m) is only for application purposes. For achieving the same complexity and optimization as that of the Grover s algorithm, we would have to wait for the quantum subroutine to become operational and its incurrence. As per discussion above, it is possible that this time complexity can be achieved by applying a fast searching mathematical algorithm known as Grover s Algorithm for unsorted database which is O(N 1/2 ). If quantum subroutine is available (which is expected in the near future), this time complexity will be at least 1 times faster than any other 149

possible algorithm for searching an unsorted data base (If N is very large). For example, if the number of database items is N=1 and the error occurred at N=9998, then this algorithm technique will search the required error item in maximum of 1 iterations. In comparison to this algorithm, any other possible algorithm requires a traversing of the database and the worst traversal is of O (N). 6.4 Conclusions and Future Enhancement The complexity and time-consuming task of identification and correction of errors in software-testing phase can easily be transformed into a scenario of searching a record in a database. It is very much expected that the application of quantum-computing, based on the quantum algorithm, can accomplish more accurately and unambiguously and in much lesser time the database testing phase successfully. The novelty of the said algorithm is the provision of the facility of reducing the time-complexity by a factor of O (N 1/2 ). As and when the Quantum computing becomes operational in the market it is very much hoped that the said strategy shall play a vital role to reduce time factor. 15