implement developer tests 23B4C147






Tool Mentor: Implementing Developer Tests using Rational Test RealTime










var backPath = './../../../';
var imgPath = './../../../images/';
var nodeInfo=[{view: "view:_LVCagP5WEdmAzesbYywanQ", path: ["_LVCagP5WEdmAzesbYywanQ", "_AUv4MAIMEdq-_NKqZM1EhA", "_5ZuQsAIUEdqEutyfYo0quQ", "{18E6764A-2366-4F59-A5F2-FDF4891EBCE9}", "{FD49B4B3-FA09-4475-A99A-DA8EBBEA220E}"]}, {view: "view:_LVCagP5WEdmAzesbYywanQ", path: ["_LVCagP5WEdmAzesbYywanQ", "_mp7z0DIDEdqwaNnSEheSAg", "_9U7IkDIEEdqwaNnSEheSAg", "{18E6764A-2366-4F59-A5F2-FDF4891EBCE9}", "{FD49B4B3-FA09-4475-A99A-DA8EBBEA220E}"]}, {view: "view:_FCx1oN7CEdmsEI4YDGX2ag", path: ["_FCx1oN7CEdmsEI4YDGX2ag", "_jD8dUAIbEdqEutyfYo0quQ", "_F1OgYAIbEdqEutyfYo0quQ", "{18E6764A-2366-4F59-A5F2-FDF4891EBCE9}", "{FD49B4B3-FA09-4475-A99A-DA8EBBEA220E}"]}];
contentPage.preload(imgPath, backPath, nodeInfo, '', false, false, false);










Tool Mentor: Implementing Developer Tests using Rational Test RealTime















This tool mentor describes how to implement tests using RationalTest RealTime.


Tool: Rational Test RealTime






Relationships



Related Elements


Implement Developer Test


Implement Test Suite






Main Description



Overview Test RealTime integrates three testing tools: Unit Testing automates C and Ada software component testing. Object Testing is an object-oriented approach to behavior testing of C++ code. System Testing is a powerful environment for testing message-based applications. The choice of which testing tool you should use with your application depends on the development environment and the nature of the application. For each testing tool, you need to develop a dedicated test script. Before writing the actual tests for your application, Test RealTime requires that you create the test project and link the project to the application under test. Tool Steps To create a test script in Test RealTime, perform the following actions: Run the Component Testing Wizard Enter test data and expected results Modify stub behavior 1. Run the Component Testing Wizard Test RealTime provides a component testing wizard which, when executed, analyzes specified source code and generates a fully executable test harness. All that remains for the developer to ensure the target code is tested as intended is to define stub behavior (see second Tool Step) and enter test data and expected results (see third Tool Step). NOTE: It is not required that the component testing wizard be used - all files and code necessary to support a test can be generated by hand. The wizard, however, can save a significant amount of effort. Either way, test execution and test reporting are automated. The component testing wizard can be accessed in one of two ways. Either method assumes that a Test RealTime project has already been opened Select the Activities link located on the left-hand side of the Test RealTime Start Page. Selection of this link brings up a list of the three primary activities that can be chosen by the developer. To perform component testing, the developer should now select the Component Testing link. Right-click any source file/class/method/function/procedure in the Asset Browser of the Project Window located on the right-hand side of Test RealTime. Selection of the Test... option in the popup menu opens the component testing wizard. The primary difference between these two methods of initiating the component testing wizard is that the first option requires the user to select the source file(s) containing the functions/methods/procedures to be tested - the second option already knows what source file will be used and thus skips the initial steps of the component testing wizard. In either case, the developer will be asked to select a Test Mode - either Typical or Expert. The difference is related to desired stubbing behavior. As a reminder, a stub is "a component containing functionality for testing purposes" - that is, a component designed to act in a predefined way to facilitate the testing of some other system component. In Typical Mode, Test RealTime will automatically generate a stub template for any function/method/procedure explicitly referenced in the selected source file(s). Expert Mode allows you to additionally select components not explicitly referenced in the chosen source file(s). Either way, the actual functionality of these stubs are defined later - see the second Tool Step below. Once the wizard has been executed to its conclusion, Test RealTime creates a node within the active project. This node contains a reference to the selected source file(s) as well as to the files required for test harness creation. These additional files need to be modified in order to: define stub behavior specify date used to drive the functions/methods/procedures under test specify expected results for each input data set For C, C++ and Ada, the test harness, test stubs and test script languages were built by Rational Software to accommodate the specific intricacies of those languages. For Java, Test RealTime uses Java as the test script language and bases its test harness and test stub frameworks on the JUnit framework (http://www.junit.org). For detailed information refer to the Rational Test RealTime User Guide, the chapter Graphical User Interface->Activity Wizards->Component Testing Wizard. 2. Enter test data and expected results The test scripts generated by the component testing wizard can execute immediately. However, until the developer specifies the actual data with which to drive the component under test - as well as the expected output values -the test will not be very useful nor informative. Each language supported by Test RealTime facilitates test creation in a different manner; each approach has been optimized for the unique characteristics of each language. C++ is further unique in that not only can standard tests be generated and executed, but optional contract checks can be made as well. Contract checks act like assertions - they are used to verify items such as pre/post-conditions and invariants. For detailed information related to C and Ada, refer to the following chapter in the Rational Test RealTime User Guide: Automated Testing->Component Testing for C and Ada->C and Ada Test Script->Overview->Test Script Structure Automated Testing->Component Testing for C and Ada->C and Ada Test Script->Ada and refer to the following chapters in the Rational Test RealTime Reference Guide Component Testing Scripting Languages->C Test Script Language->C Test Script Language Keywords->ELEMENT...END ELEMENT Component Testing Scripting Languages->C Test Script Language->C Test Script Language Keywords->ENVIRONMENT...END ENVIRONMENT Component Testing Scripting Languages->Ada Test Script Language->Ada Test Script Language Keywords->ELEMENT...END ELEMENT Component Testing Scripting Languages->Ada Test Script Language->Ada Test Script Language Keywords->ENVIRONMENT...END ENVIRONMENT For detailed information related to C++, refer to following chapters in the Rational Test RealTime User Guide: Automated Testing->Component Testing for C++->C++ Testing Overview and refer to the following chapters in the Rational Test RealTime Reference Guide Component Testing Scripting Languages->C++ Test Script Language->C++ Test Driver Scripts For detailed information related to Java, refer to following chapters in the Rational Test RealTime User Guide: Automated Testing->Component Testing for Java->Java Testing Overview->About JUnit and refer to the following chapters in the Rational Test RealTime Reference Guide Component Testing Scripting Languages->Java Test Primitives 3. Modify stub behavior Components are designed to act in a particular manner. These components, regardless of their level of granularity, should respond to a given set of inputs with a particular, predefinable set of outputs. "Predefinable" means the results can be specified, either explicitly or algorithmically, prior to test execution. Very often, components require the assistance of other components within the system in order to perform their functionality. These other components can be as simple as an additional function or as grandiose as an entire subsystem located somewhere else in the system. Either way, it is not uncommon for a developer to discover that their efforts at component testing are hampered by the fact that the components upon which their code relies do not yet exist, or at least are not yet reliably functioning. The act of stubbing compensates for this difficulty. (In fact, stubbing can be used to guarantee proper functioning by eliminating all reliance on third-party code.) It is the responsibility of the developer to properly simulate components upon which the component under test relies. Proper simulation means that the stubbed functionality must be sufficiently accurate to ensure that the success or failure of the component under test can always be traced to the component itself, rather than to incorrect information produced by the stubs. Rational Test RealTime facilitates the creation of stubs via the supported test scripting languages. In particular, for information about the creation of test stubs: For detailed information related to C and Ada, refer to the following chapter in the Rational Test RealTime User Guide: Automated Testing->Component Testing for C and Ada->C and Ada Test Script->Simulations->Stub Simulation Overview and refer to the following chapters in the Rational Test RealTime Reference Guide Component Testing Scripting Languages->C Test Script Language->C Test Script Language Keywords->STUB Component Testing Scripting Languages->Ada Test Script Language->Ada Test Script Language Keywords->STUB For detailed information related to C++, refer to following chapters in the Rational Test RealTime User Guide: Automated Testing->Component Testing for C++->C++ Testing Overview->C++ Test Driver Script and refer to the following chapters in the Rational Test RealTime Reference Guide Component Testing Scripting Languages->C++ Test Script Language->C++ Test Script Keywords->STUB For detailed information related to Java, refer to following chapters in the Rational Test RealTime User Guide: Automated Testing->Component Testing for Java->Java Testing Overview->Java Stub Harness For More Information For detailed information on how to run the test campaign, refer to the Tool Mentor titled Executing Tests Using Rational Test RealTime.





©  Copyright IBM Corp. 1987, 2006.  All Rights Reserved.







contentPage.onload();




Wyszukiwarka

Podobne podstrony:
tests logzone
implementation view?73E3B6
language tests 10a
03 Implementacja komputerowa algorytmu genetycznego
Podstawy projektowania i implementacji?z?nych
Yr4 Group 3 Tests 07 12
implement components?D1799D
implement componentsE3CB1D9
Answer Key Short Tests?B
rup implementation subsystem?48C12D
Implementacja
rup implementer?45E819
implementation?F0AAD4

więcej podobnych podstron