770 likes | 1.01k Views
System testing chapter 14. Csci 565 Spring 2007. objectives. System testing All about threads at system level How big a thread should be? How to identify them? The role of threads in Structural/functional testing SATM Test Threads. System level testing. System testing
E N D
System testingchapter 14 Csci 565 Spring 2007
objectives • System testing • All about threads at system level • How big a thread should be? • How to identify them? • The role of threads in Structural/functional testing • SATM Test Threads
System level testing • System testing • Can be considered a final step in integration testing • A check of consistency between the software system and its specification • Encompasses system wide properties against a system specification • System, acceptance, and regression testing are all concerned with the behavior of a entire software system
System test design • It is considered a good practice to design system test cases as early possible • Why? • Exposes critical behaviors • Avoids unpleasant surprises • Testing global properties may require extensive simulation of the execution environment
Threads: some interpretations • Primitives concepts with different meaning at different levels • Think of them as Use-cases/scenarios • Threads and level of abstractions • System level behavior corresponds to a sequence of Atomic System Functions (ASFs) • Integration level behavior corresponds to a sequence of MM-path • Unit level behavior corresponds to a DD-path
Threads: some generic examples • Example of threads may include • A scenario of normal usage • A stimulus/response pair • A sequence of source instructions • A sequence of atomic system functions (ASFs) • A sequences of a state machine description of the system • …
Threads at different levels: some specific examples (SATM) • Candidate threads for SATM • Not Ok (too concrete) • Digit Entry (concrete) • an ASF works with only one stimuli/response • PIN Entry (abstract) • ASFs work with a set of stimuli/response • max integration, min system level • A transaction (very abstract) • A system level thread because of end-to-end completion • <Card entry, menu selection, perform operation, report the results> • An ATM session or multiple transactions (very very abstract) • A sequence of threads • OK for system level • Good for interactions among threads
System testing and requirement specification • System testing w.r.t. requirement specifications • Any system can be specified using • Data (ERD) • Actions (DFD) • Ports (source/destination of input-level system) • Events (occurrence of data or actions on the ports) • Threads (scenarios or paths in control models)
Data-centric models • When the focus is on the persistent data, data-centric models must be used (e.g., ERD) • developed using CRUD (create, retrieve, Update, Delete) • In SATM, Data • PAN (different accounts) • PIN (personal identification number)
Ports • Ports (devices) • The source and destination of system level inputs and outputs • the points at which an I/O device are connected to the system • Examples in SATM • The digits and cancel keys • Functions keys (buttons) • Display screen • Slots
Events • refer to system level input (or output) • the translation point between physical (external) and logical (internal) • Event can be • Discrete (e.g., keystroke) • Continuous (e.g., pressure, temperature)
actions • Process, or transformation point • DFD • work with • Inputs/outputs for both control and/or data
Examples of Models • Models can be • Structural models • Used for development • Express the functional decomposition and decomposition • Contextual models • Emphasize system ports (or external environment) • Behavioral models • Emphasize the control aspects of the system • Identification of models? • Right models for right problems
Finding Threads from behavioral models • FSM models of the SATM is the appropriate staring point for the system testing threads • The model can be interpreted as follows • States (processing steps or the abstraction of the history) • Transitions (logical events)
Table 3: An example of a path (or thread) with a correct PIN (1234) Logical event
Table 4: An example of a thread (1235, 123C, 1234) Logical events
Structural Strategies (or path testing) for thread testing • Generating thread test cases is easy • Too many threads (explosion problem) • Strategies • Bottom-up threads • 6 paths can be tested in the PIN Try FSM to test (see table 5) • Correct recognition of digits • Response to the cancellation • Matching expected and entered PINs
Table 5: 6 thread in the PIN Try FSM correct incorrect cancellation
Bottom-up (next upper level) • Once the lower level is tested, move to the upper level (the PIN Entry FSM) • Four paths tested to achieve these objectives • Correct recognition of PIN • Incorrect PIN • Response to the cancel key • Matching expected and actual PIN entered • `See table 6’
Coverage Metrics for FSM • FSM are directed graphs • use a graph-based coverage metrics • Hierarchical relationship means • Super node (upper level node) • Sub-node (lower level) • Super nodes treat sub-nodes as a procedure with enter/exist semantics
States and transitions Coverage matrices • Two Coverage (metrics) can be applied • State coverage • States correspond to nodes • Transition coverage • Transitions correspond to edges • Path Coverage? • ‘See table 14.7’
Problems with path testing (FSM) • The main assumption revolves around path traversing to uncover faults • Can be counter-productive • E.g., CCC in table 6 causes a three-try to fail • Some path cannot be executed by themselves because of dependency between lower levels and upper levels • E.g., 1235 in table 5 causes a transition to Second PIN try • What happens if the user does not press any key?