![]() |
Automated Testing, Analysis, Performance and Monitoring Solutions |
| Home | Products | Services | Download | Purchase | Support | About Us |
|
AppPerfect Unit Tester > FAQs
What can I unit test with AP UT?Desktop and server applications. Desktop apps are tested using JUnit, server apps are tested using HttpUnit. For server testing, browser interaction with server app is recorded, and appropriate unit tests created. How does AP UT help with unit testing?AP UT helps your unit testing efforts in many ways: What is the UT Object Repository?AP UT implements a form of mock object framework for unit testing. When unit tests are initially generated, AP UT examines your source code and creates necessary test classes to instantiate and execute your source code. To correctly instantiate objects, AP UT extracts as much information about your source code as possible and stores that information in the UT Object Repository. There are a number of steps in the test case generation process? What are they and why are they needed?The first step is to generate the object repository. AppPerfect will add all objects (user classes as well as core Java classes) to the repository. It will try to create as valid an instance for each object as possible based on values in the repository. The second step is to compile the test classes that are created. I am having problems setting my classpath correctly. What could be the problem?A few tips on setting the classpath correctly: I already use JUnit. Can I still use AP UT?Yes, you can easily import and manage all existing JUnit test classes into an AP UT project. I have some UI classes in my application. How do I handle them?UI shows up, waits for response and times out. How can I use AP UT to detect memory leaks during unit testing?When defining the unit test project, specify "Check for memory leaks" I have a large application. How do I break down the testing?AppPerfect provides a number of ways to incrementally unit test your application.
Where should I place the AP UT project and the test cases?You can specify any location on your file system to store the project. You can specify any location to place your test cases. By default, the test classes are stored in the same folder as your source code. If a different location is specified, AppPerfect will create the same directory structure as your source code and place the test classes under the specified location. My application is dependent on a database. How do I unit test if the database is not available?AppPerfect provides functionality to create a mock database which acts as a substitute database when the real database is not available. AppPerfect uses HSql, an embeddable that supports most features of commercial databases. AppPerfect requires access to the real database only once to be able to extract the metadata and sample values to create the mock database. How are asserts handled?AppPerfect supports standard JUnit asserts that can be added to your test cases. Further, any custom asserts can be added via the UI. Lastly, AppPerfect also supports the assert key word in JDK 1.5. How do I generate reports and track trends?AppPerfect provides a full-featured reporting module called AppPerfect
Analytics. Numerous standard reports are already provided with it. You can
either generate default reports or build custom reports using AppPerfect
Analytics. AppPerfect also supports the ability to save a result of a test
run. These results can then be stored in a common location. A separate module
called AppPerfect Trend Analyzer can then be used to show trends over
multiple test results. I am having problems integrating with NetBeans 4.1. What do I do?NetBeans 4.1 is fully supported as of release 6 of AppPerfect. If using an older version of AppPerfect, please upgrade to version 6 or later. My target method returns an exception as expected. How do I tell AP UT to consider this test case result a "success" and not "failed"?AP UT supports specifying custom asserts to a unit test case. If you are expecting an exception in a given test case, add an "ExceptionAssert" to your test case in the AP UT Test Editor. How do I know what code was tested and what was not tested?AppPerfect provides a Code Coverage module that keeps track of source code lines that were executed. From the File view, click on the specific file or rule for which you want to view the code coverage. Lines that were not executed are highlighted with a yellow background. I want to run AP UT as part of my nightly build process. What do I need to do?Any AppPerfect project can be exported as an ANT script. This ANT script can be integrated into your nightly build process or run standalone. I want to improve the Code Coverage achieved by AP UT. What should I do?Often times due to some key values missing, the code coverage provided out of the box is not high. An example would be your application depends on data coming from a text file or a database. By providing the correct data file or database connection parameters, code coverage can be significantly improved. Which JDK version syntax are supported?All JDK version higher than 1.3.1 are supported. New keywords in JDK 1.5 are also supported. I have a lot of test cases and it takes a long time to execute the tests. How can I reduce the execution time?Reducing the timeout interval often reduces execution time significantly. Not performing memory leak testing also reduces execution time. Not performing null value tests also helps reduce execution time. My application implements a "factory" framework. Can I use AP UT to unit test such application?A "factory framework" typically refers to a software architecture whereby a central class is defined where all objects needed in your application are initialized and returned. This helps ensure all objects in the system are properly initialized. An example of a commonly used factory framework is the EMF in Eclipse. AP UT supports unit testing of applications that use such factory frameworks. AP UT automatically scans for public static "objname" methods in all specified source and use those constructors for internal use. How does AP UT support Apache Struts framework?AppPerfect can read a Struts mapping file automatically by which it can map your actions to underlying jsp files. How can I auto generate test cases using the parameters passed by the user while recording my web application?For a 'server' project you are allowed to navigate through the pages and enter values in different forms. This is how Unit Tester records the values entered by the user during recording and writes this information in the generated test class. How can I use user inputs in local projects?Firstly, unittesting will actually unit test the methods with different types of inputs & not just the one a user would actually like to record. But we understand that there could be certain inputs required to initialise the application like Database drivers settings, Ports etc which are normally passed as JVM arguments (These can be specified in the Target step in Common project properties dialog with project type as "Local"), Other initialisations are done by reading properties file which can be read by the application with a relative path from where it is expected to start (For this you can specify the working directory in the Unit Tester properties dialog in the tab "Test Classes"). Will generated test cases take care of boundary conditions?Yes, testcases are generated to check boundary conditions as well. What are the various modes by which we can provide the user defined inputs for testing?The various modes for providing user defined inputs are:
What are the differences between AP Pro vs. AP Std as far as the Unit Tester is concerned?Please visit AppPerfect to view the table of differences between the two versions. I'm getting an error again and again. I've tried everything, but I'm stuck. What should I do?
|
|
|
© 2002- 2007 AppPerfect Corporation |