Automated Testing, Analysis, Performance and Monitoring Solutions 

  Home Products Services Download Purchase Support About Us
 
Enterprise Server
Requirements Manager
License Manager
Test Manager
Issues/Defects Manager
Test Studio
Load Tester
Functional Tester for Windows
Functional Tester for Web
DevTest4J
Java Code Analyzer
Java Unit Tester
PDF Data Sheet
Overview
Key Features
Screenshots
Online Demos
Tutorials
Documentation
FAQs
Java/J2EE Profiler
Agentless Monitor
Monitor Server
 

Resources:
Tutorials
Online Demos
Discussion Forum
 

AppPerfect Unit Tester > FAQs

  1. What can I unit test with AP UT?
  2. How does AP UT help with unit testing?
  3. What is the UT Object Repository?
  4. There are a number of steps in the test case generation process? What are they and why are they needed?
  5. I am having problems setting my classpath correctly. What could be the problem?
  6. I already use JUnit. Can I still use AP UT?
  7. I have some UI classes in my application. How do I handle them?
  8. How can I use AP UT to detect memory leaks during unit testing?
  9. I have a large application. How do I break down the testing?
  10. Where should I place the AP UT project and the test cases?
  11. My application is dependent on a database. How do I unit test if the database is not available?
  12. How are asserts handled?
  13. How do I generate reports and track trends?
  14. I am having problems integrating with NetBeans 4.1. What do I do?
  15. 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"?
  16. How do I know what code was tested and what was not tested?
  17. I want to run AP UT as part of my nightly build process. What do I need to do?
  18. I want to improve the Code Coverage achieved by AP UT. What should I do?
  19. Which JDK version syntax are supported?
  20. I have a lot of test cases and it takes a long time to execute the tests. How can I reduce the execution time?
  21. My application implements a "factory" framework. Can I use AP UT to unit test such an application?
  22. How does AP UT support Apache Struts framework?
  23. How can I auto generate test cases using the parameters passed by the user while recording my web application?
  24. How can I use user inputs in local projects?
  25. Will generated test cases take care of boundary conditions?
  26. What are the various modes by which we can provide the user defined inputs for testing?
  27. What are the differences between AP Pro vs. AP Std as far as the Unit Tester is concerned?
  28. I'm getting an error again and again. I've tried everything, but I'm stuck. What should I do?

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:
1. Automates unit test generation
2. Automates unit test execution
3. Automates unit test maintenance

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:
1. Make sure all jar files are correctly included in your project
2. Make sure you click on the "Verify Classpath" button to ensure proper setting
3. Make sure there are no conflicting classes (perhaps from multiple versions of same product)

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.

  1. Based on scope
  2. Based on object type
  3. Based on packages

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:

  1. User can addd/modify the testcases directly by right clicking on the Testclass View panel and editing the source in the default Java Editor.
  2. By adding/ modifying repository instances in the Repoasitory tab. After which the testclasses are regenerated.
  3. By passing a different object instance as parameter for a testcase from the Design View.
  4. By adding/ modifying asserts from the Design View.

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?

  • Close the currently opened project if it is open. Stop and close the application if it is running.
  • Go to Tools ->Options-> Log Settings. Make sure the settings selected for all the products is: Debug (not Fatal).
  • Open the project. Perform the operations that are giving you the error. The moment you get the error, stop all operations and send us the following files:
    1. All files present in <LoadTest_Home>\logs folder.
    2. Project file i.e. *.adt file of that project.
    3. Build number of the application. (Help->About AppPerfect...)
 

© 2002- 2007 AppPerfect Corporation
AppPerfect is a trademark of AppPerfect Corporation.
Terms of Use | Privacy Statement