1.

What Is Slice-based Testing?

Answer»

A program slice is a set of program statements that contribute to or affect a value for a VARIABLE at some point in the program. This is an informal definition.

Let us see now more formal DEFINITIONS of a program slice.

"Given a program, P and a set of V of variables in P, a slice on the variable set V at statement n, written as S(V, n), is the set of all statements in P that contribute to the values of variables in V".

It may be noted that listing elements in a slice S(V, n) will be cumbersome because the elements are the program statement fragments.

We can further refine the definition of a program slice.

"Given a program P and a program graph G(P) in which statements and statement fragments are numbered and a set V of variables in P, the slice on the variable set V at statement fragment n, written as S(V, n), is the set of node numbers of all statement fragments in P prior to n that contribute to the values of variables in V at statement fragment n."

The basic idea is to SEPARATE a program into components (slices) that have some useful / functional meaning.

It may be noted that we have used the words "prior to" (in the 2nd definition) in the dynamic SENSE. Thus a slice, captures the execution time behavior of a program with respect to the variables in the slice. This develops a lattice or a directed, acyclic graph of slices in which nodes are slices and edges correspond to the subset RELATIONSHIP.

We have also used a word -"contribute' which means that data declaration statements have an effect on the value of a variable. We simply exclude all non-executable statements. 

A program slice is a set of program statements that contribute to or affect a value for a variable at some point in the program. This is an informal definition.

Let us see now more formal definitions of a program slice.

"Given a program, P and a set of V of variables in P, a slice on the variable set V at statement n, written as S(V, n), is the set of all statements in P that contribute to the values of variables in V".

It may be noted that listing elements in a slice S(V, n) will be cumbersome because the elements are the program statement fragments.

We can further refine the definition of a program slice.

"Given a program P and a program graph G(P) in which statements and statement fragments are numbered and a set V of variables in P, the slice on the variable set V at statement fragment n, written as S(V, n), is the set of node numbers of all statement fragments in P prior to n that contribute to the values of variables in V at statement fragment n."

The basic idea is to separate a program into components (slices) that have some useful / functional meaning.

It may be noted that we have used the words "prior to" (in the 2nd definition) in the dynamic sense. Thus a slice, captures the execution time behavior of a program with respect to the variables in the slice. This develops a lattice or a directed, acyclic graph of slices in which nodes are slices and edges correspond to the subset relationship.

We have also used a word -"contribute' which means that data declaration statements have an effect on the value of a variable. We simply exclude all non-executable statements. 



Discussion

No Comment Found