ArticleslgStudy

computer science

Linear code sequence and jump

Linear code sequence and jump is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Linear code sequence and jump rather than just read about it. In short: Linear code sequence and jump (LCSAJ), in the broad sense, 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?".

Key takeaways

  • Linear code sequence and jump belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Linear code sequence and jump to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Linear code sequence and jump from memory before moving on to harder problems.

Reference excerpt

Linear code sequence and jump (LCSAJ), in the broad sense, 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 structural coverage analysis. In a narrower sense, an LCSAJ is a well-defined linear region of a program's code. When used in this sense, LCSAJ is also called JJ-path, standing for jump-to-jump path.

History The LCSAJ analysis method was devised by Professor Michael Hennell in order to perform quality assessments on the mathematical libraries on which his nuclear physics research at the University of Liverpool depended. Professor Hennell later founded the Liverpool Data Research Associates (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). It has also been called Liverpool's Contribution to Silly Acronyms and Jokes.

Definition and characteristics of LCSAJ as a code region An LCSAJ is a software code path fragment consisting of a sequence of code (a linear code sequence) followed by a control flow Jump, and consists of the following three items:

the start of the linear sequence 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. Unlike (maximal) basic blocks, LCSAJs can overlap with each other because a jump (out) may occur in the middle of an LCSAJ, while it isn't allowed in the middle of a basic block. In particular, conditional jumps generate overlapping LCSAJs: one which runs through to where the condition evaluates to false and another that ends at the jump when the condition evaluates to true (the example given further below in this article illustrates such an occurrence). According to a monograph from 1986, LCSAJs were typically four times larger than basic blocks. The formal definition of a LCSAJ can be given in terms of basic blocks as follows:

a sequence of one or more consecutively numbered basic blocks, p, (p+1), ..., q, of a code unit, followed by a control flow jump either out of the code [unit] or to a basic block numbered r, where r≠(q+1), and either p=1 or there exists a control flow jump to block p from some other block in the unit. (A basic block to which such a control flow jump can be made is referred to as a target of the [LCSAJ] jump.) According to Jorgensen's 2013 textbook, outside Great Britain and ISTQB literature, the same notion is called DD-path.

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, Test Effectiveness Ratio 1 (TER1):

T E R 1 = number of statements executed by the test data total number of executable statements {\displaystyle TER_{\text{1}}={\frac {\text{number of statements executed by the test data}}{\text{total number of executable statements}}}}

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

T E R 2 = number of control-flow branches executed by the test data total number of control-flow branches {\displaystyle TER_{\text{2}}={\frac {\text{number of control-flow branches executed by the test data}}{\text{total number of control-flow branches}}}}

T E R 3 = number of LCSAJs executed by the test data total number of LCSAJs {\displaystyle TER_{\text{3}}={\frac {\text{number of LCSAJs executed by the test data}}{\text{total number of LCSAJs}}}}

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 early 1970s and the third dates from the late 1970s. The requirement for achieving TER1 = 100% was the level originally selected for the DO-178 avionics standard until it was supplemented by the MCDC (modified condition/decision coverage) additional requirement in 1992. Higher levels TER3 = 100% have been mandated for many other projects, including aerospace, telephony, and banking. One practical problem of using TER3 is that many LCSAJs can never be executed due to the conflicting conditions they contain.

Example Consider the following C code:

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. 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. A coverage level of TER3 = 100% would be achieved when the test data used causes the execution of each of these LCSAJs at least once.

References

Worked examples

Example 1 — a first encounter with Linear code sequence and jump

Start with the simplest possible case. Write down what Linear code sequence and jump claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Linear code sequence and jump before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Linear code sequence and jump ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Linear code sequence and jump

In research
Linear code sequence and jump appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Linear code sequence and jump in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Linear code sequence and jump is common in secondary-school and first-year university syllabi. It links to neighbouring topics History of computing in the United Kingdom, Science and technology in Merseyside, Software metrics, so understanding it makes those chapters shorter.
In everyday life
Look for Linear code sequence and jump outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Linear code sequence and jump in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Linear code sequence and jump means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Linear code sequence and jump out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Linear code sequence and jump in simple terms?

Linear code sequence and jump (LCSAJ), in the broad sense, 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?".

Why does Linear code sequence and jump matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Linear code sequence and jump?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Linear code sequence and jump.

Tags

  • History of computing in the United Kingdom
  • Science and technology in Merseyside
  • Software metrics
  • University of Liverpool

Keep exploring