Linear Code Sequence and Jump
Encyclopedia
Linear code sequence and jump (LCSAJ) is a software analysis method used to identify structural units in code under test. Its primary use is with dynamic software analysis to help answer the question "How much testing is enough?". Dynamic software analysis is used to measure the quality and efficacy of software test data, where the quantification is performed in terms of structural units of the code under test. When used to quantify the structural units exercised by a given set of test data, dynamic analysis is also referred to as coverage analysis.

History

The LCSAJ analysis method was devised by Professor Michael Hennell
Michael Hennell
Professor Michael A. Hennell is a British computer scientist who has made leading contributions in the field of in software testing.Michael Hennell is Professor Emeritus of Mathematical Sciences, University of Liverpool in England....

 in order to perform quality assessments on the mathematical libraries on which his nuclear physics
Nuclear physics
Nuclear physics is the field of physics that studies the building blocks and interactions of atomic nuclei. The most commonly known applications of nuclear physics are nuclear power generation and nuclear weapons technology, but the research has provided application in many fields, including those...

 research at the University of Liverpool
University of Liverpool
The University of Liverpool is a teaching and research university in the city of Liverpool, England. It is a member of the Russell Group of large research-intensive universities and the N8 Group for research collaboration. Founded in 1881 , it is also one of the six original "red brick" civic...

 depended. Professor Hennell later founded the Liverpool Data Research Associates
Liverpool Data Research Associates
Liverpool Data Research Associates is a provider of software analysis, test and requirements traceability tools for the Public and Private sectors and a pioneer in static and dynamic software analysis.-History:...

 (LDRA) company to commercialize the software test-bed produced for this work, resulting in the LDRA Testbed product.

Introduced in 1976, the LCSAJ is now also referred to as the jump-to-jump path (JJ-path).

Definition

An LCSAJ is a software code path fragment consisting of a sequence of code (a linear code sequence, or basic block) followed by a control flow Jump, and consists of the following three items :
  • the start of the linear sequence (basic block) of executable statements
  • the end of the linear sequence
  • the target line to which control flow is transferred at the end of the linear sequence.


When used for coverage analysis, LCSAJs are considered to have a test effectiveness ratio of 3.

Test effectiveness ratio

Coverage analysis metrics are used to gauge how much testing has been achieved. The most basic metric is the proportion of statements executed, considered to have a Test Effectiveness Ratio (TER) of one :

TER1 =

Higher level coverage metrics can also be generated, in particular :

TER2 =

TER3 =

These metrics satisfy a pure hierarchy, whereby when TER3 = 100% has been achieved it follows that TER2 = 100% and TER1 = 100% have also been achieved.

Both the TER1 & TER2 metrics were in use in the 1940s and the third dates from the 1970s. The requirements for achieving TER1 = 100% became an industrial norm during the late 1960s, and was the level originally selected for the DO-178 avionics standard until it was supplemented by the MCDC (modified condition/decision coverage
Modified Condition/Decision Coverage
Modified condition/decision coverage , is used in the standard DO-178B to ensure that Level A software is tested adequately.To satisfy the MC/DC coverage criterion, during testing all of the below must be true at least once:...

) additional requirement in 1992. Higher levels TER3 = 100% have been mandated for many other projects, including aerospace, telephony and banking.

Example

Consider the following C code:

  1. include
  2. include
  3. include

  1. define MAXCOLUMNS 26
  2. define MAXROW 20
  3. define MAXCOUNT 90
  4. define ITERATIONS 750


int main (void)
{
int count = 0, totals[MAXCOLUMNS], val = 0;

memset (totals, 0, MAXCOLUMNS * sizeof(int));

count = 0;
while ( count < ITERATIONS )
{
val = abs(rand) % MAXCOLUMNS;
totals[val] += 1;
if ( totals[val] > MAXCOUNT )
{
totals[val] = MAXCOUNT;
}
count++;
}

return (0);

}


From this code, the following is a complete list of the LCSAJ triples for this code
LCSAJ Number Start Line Finish Line Jump To Line
1 10 17 28
2 10 21 25
3 10 26 17
4 17 17 28
5 17 21 25
6 17 26 17
7 25 26 17
8 28 28 −1


A coverage level of TER3 = 100% would be achieved when test data is used that causes the execution of each of these LCSAJs at least once.

From this example it can be seen that the basic block identified by an LCSAJ triple may span a decision point, reflecting the conditions that must be in place in order for the LCSAJ to be executed. For instance, LCSAJ 2 for the above example includes the 'while' statement where the condition '(count < ITERATIONS)' evaluates to TRUE.

In addition, it can also be seen that each line of code has an LCSAJ 'density' associated with it; line 17, for instance, appears within 6 unique LCSAJs - i.e. it has an LCSAJ density of 6.

This is helpful when evaluating the maintainability of the code; If a line of code is to be changed then the density is indicative of how many LCSAJs will be affected by that change.
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK