Docsity

Testing Timing Constraints: Patterns and Techniques - Prof. Wei-Tek Tsai, Study notes of Computer Science

Toggle sidebar
bg1
1
1/13/2002 Arizona State University 1
Testing Timing
Wei-Tek Tsai
Department of Computer Science and Engineering
Arizona State University
Tempe, AZ 85287
1/13/2002 Arizona State University 2
Patterns for Testing Timing Constraints
•Data overhead reduction patterns:
–Patterns that describe techniques that apply to reducing
the overhead involved in collecting data necessary for
testing.
•Event generation patterns:
–Patterns that describe techniques that generate events
with certain characteristics useful for testing.
•Event monitoring and analysis patterns:
–Patterns that cover techniques useful in collecting
events necessary for analyzing test results.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe

Partial preview of the text

Download Testing Timing Constraints: Patterns and Techniques - Prof. Wei-Tek Tsai and more Study notes Computer Science in PDF only on Docsity!

1/13/2002 Arizona State University 1

Testing Timing

Wei-Tek Tsai Department of Computer Science and Engineering Arizona State University Tempe, AZ 85287

1/13/2002 Arizona State University 2

Patterns for Testing Timing Constraints

  • Data overhead reduction patterns:
    • Patterns that describe techniques that apply to reducing the overhead involved in collecting data necessary for testing.
  • Event generation patterns:
    • Patterns that describe techniques that generate events with certain characteristics useful for testing.
  • Event monitoring and analysis patterns:
    • Patterns that cover techniques useful in collecting events necessary for analyzing test results.

1/13/2002 Arizona State University 3

Testing Timing Aspects

Wei-Tek Tsai Department of Computer Science and Engineering Arizona State University Tempe, AZ 85287

1/13/2002 Arizona State University 4

Data Overhead Reduction Patterns

• One of the main problems with testing

timing constraints is the impact of

collecting data.

• In other words, the intrusive nature of the

data collection part of the testing can

adversely impact the test results.

1/13/2002 Arizona State University 7

Multiple Levels of Tracing

  • When a system executes, much information may

be available and can be collected: state changes,

alarms, database updates, incoming events and

outgoing events.

  • However, while testing a particular requirement,

only a few of these may be needed to verify if the

requirement is satisfied.

  • To make the testing minimally intrusive, it is

necessary to collect only the relevant information.

1/13/2002 Arizona State University 8

Multiple Levels of Tracing (Cont’d)

  • Multiple levels of tracing can be used to record

different kinds of data with different tracing

levels.

void handlePSMM(PSMMMsg psmm){ // Received PSMM Message TRACE (MESSAGE_RCVD, “Received PSMM Message”); // Processing of PSMM Message … if (psmm->pilotPN != refPN) { // ERROR Case TRACE (DATA_ERROR, “Invalid pilotPN value received in PSMM”); return; } … // Sending HODir Message sduIwm->sendMessage (hoDir); TRACE (MESSAGE_SENT, “SentHODir Message”); return; }

1/13/2002 Arizona State University 9

  • The general steps involved in using multiple tracing levels pattern:
    • Define different tracing levels required for testing.
    • Define a TRACE utility that has the following features:
      • Provides a software utility (TRACE macro in the code fragment shown) takes as its input a trace level and additional output information.
      • Maintains a TRACE MASK that represents the current trace levels that are enabled for recording data. The TRACE MASK must be dynamically modifiable by the tester.
      • If the input trace level of a TRACE statement is enabled in the current TRACE MASK, the TRACE utility will record the output information associated with the TRACE statement.
      • The information recorded should include at least a time-stamp and information about what event has occurred.
    • Instrument the software being tested with TRACE statements at appropriate locations. The locations and what TRACE levels to use must be determined based on an up-front analysis during the development phase of the lifecycle.
    • Run the tests after setting the appropriate TRACE levels to the application.
    • Analyze the data recorded for the test results.

1/13/2002 Arizona State University 10

Partial Buffer Recording Pattern

  • Sometimes systems receive packets or events that

contain a large amount of data.

  • Expensive and may not be feasible.
  • The partial buffer recording strategy focuses on

recording only part of the buffer/data received for

testing.

  • The types of information depends on the

application and needs to be determined as part of

the test case development.

1/13/2002 Arizona State University 13

Event Generation Patterns

  • Event Tracker Pattern:
    • Have a unique identifier within that event so that it can be traced from the sender to the receiver.
    • For instance, a monotonically increasing sequence number is one example.
    • The unique identifier that is setup needs to be accessible from the event on all elements and can then be used to record information about the event.

1/13/2002 Arizona State University 14

Event Stream Generator

  • To test certain requirements, it is necessary to

have a capability of controlling the stream of

events being generated, e.g., at a certain

frequency.

  • An Event Stream Generator is a component:
    • Ability to generate events of a particular type starting at a certain time and ending at a certain time at a specified rate.
    • Ability to specify the number of times an event must be generated.
    • Ability to change certain parameters within the events being generated.

1/13/2002 Arizona State University 15

Event Monitoring and Analysis Patterns

• Active Monitoring Patterns: the test suites

query the systems for required data during

test execution and process the returned data.

  • Continuous Polling
  • Discrete Polling
  • Periodic Polling

1/13/2002 Arizona State University 16

Continuous Polling

  • Consider a requirement which specifies that a

certain event or state change must occur within a

certain time after some other state change or event

has occurred:

  • E.g., If magnet abort/inhibit therapy control is enabled and if magnet is applied for at least 1 second, then the magnet task shall place the device if it is in therapy or sense into temporary detect mode within 3 seconds of the start of the magnet application.

1/13/2002 Arizona State University 19

teststart( "Test Temporary Detect Mode " ); nominals ();/* Set device to the default state / report( "======================================================= ======\n" "Requirement being tested: If Magnet abort/inhibit therapy control is enabled and if magnet\n" "is applied for atleast 1 second, then the magnet task shall place the device if it is in Therapy\n" "or Sense into Temporary Detect Mode within 3 seconds of the start of the magnet application \n"); SetMagTherapyControl (ENABLED); / Enable magnet abort/inhibit therapy control / prog_perm_device_mode (THERAPY); / Place the Device in Therapy Mode / status = FAILURE; ApplyMagnet (1.5); // apply magnet for 1.5 second / Use Discrete Polling at 1 second intervals for 3 seconds to see if required change has happened. */ while (TRUE) { wait (1); if (read_curr_device_mode () == DETECT) { status = SUCCESS; break; } wait (1); if (read_curr_device_mode () == DETECT) { status = SUCCESS; break; } wait(1); if (read_curr_device_mode () == DETECT) { status = SUCCESS;break; } } if (status == SUCCESS) elsereport ("Test Temporary_Detect_Mode successfully completed\n"); report ("Test Temporary_Detect_Mode failed\n"); testcomplete( "Test Temporary_Detect_Mode" );

1/13/2002 Arizona State University 20

Periodic Polling

• Periodic polling is just a variant of discrete

polling scheme. In this scheme, instead of

polling at certain discrete instants as in

discrete polling, polling is done at periodic

intervals.

1/13/2002 Arizona State University 21

Consequences of Active Monitoring Schemes

  • All polling schemes impose an overhead on both

the poller and the pollee. Therefore it must be

used only if does not cause any intrusive impact

on the system behavior.

  • Since the system is continuously polled, the

detection of any significant state change is done

with minimal delay in a continuous polling

scheme. The test case execution is therefore faster,

whereas in discrete and periodic polling schemes,

the detection can take longer. On the other hand,

the overhead for continuous polling scheme would

be the maximum among all three schemes.

  • They are relatively simple to implement.

1/13/2002 Arizona State University 22

Passive Monitoring Patterns

• In passive patterns, test suites wait for the

system being tested to report events and use

such data for analysis.

  • Requirement: “Activate Traffic Confirm

message must be received within 500 ms after

sending a Activate Traffic Channel Message”.

1/13/2002 Arizona State University 25

  • Transport changes:
    • If transport links between elements are considered to be bottlenecks for performance, then more bandwidth can be added to the links.
  • Algorithm improvements:
    • Algorithms used in systems play an important role in how a system performs timing wise. For instance, in wireless systems, radio link protocol (RLP) algorithms determine how fast a system can recover from lost packets transmitted to or from a mobile system. Algorithm enhancements therefore are a means to improve system behavior.

1/13/2002 Arizona State University 26

  • Field usage guidelines :
    • Sometimes, lessons are learned in the labs with regard to the timing constraints that need to be used in the field to maximize system throughput.
    • For instance, use of a particular algorithm under certain loading conditions can improve the timing behavior compared to an alternative. If the algorithms are dynamically configurable, then the field usage guidelines can specify the different cases when the different algorithms need to be used.
    • The operators in the field can thus program the system dynamically to use the specific algorithms at appropriate times.

1/13/2002 Arizona State University 27

  • Link Budget Refinement:
    • Testing in a lab is a means to gather data about how much time is spent on different phases of an operation. Such data can be used to refine link budget estimations, i.e., determining how much time is reasonable for a certain phase.
    • Based on this, certain timeout values can be adjusted to more closely reflect the system’s actual behavior. This can be used to avoid spurious timeouts that may happen otherwise if unrealistic numbers are used. Link budget refinement (the process of adjusting time taken for different phases or links of an operation) is an important by-product of testing timing constraints.

1/13/2002 Arizona State University 28

  • Requirement Changes:
    • In many cases, feedback from testing results forms a useful input to writing the requirements for future products.
    • For a new product line with no existing architecture it is difficult to estimate how much time it would take a certain operation or any of its phases.
    • Although requirements may specify certain numbers and the system architecture tries to meet those requirements, they may sometimes turn out to be unrealistic or unachievable in some cases or in other cases be significantly more than what is really needed in others.