发布新日志

  • JAVA测试工具

    2009-10-13 23:38:02

    1. 美国Segue公司的Silk系列产品Segue公司一直专注于软件质量优化领域。在Segue的产品套件中,拥有业内最强劲且最容易使用的、用于企业应用测试、调优和监测的自动化工具,能够帮助用户保障应用在其生命周期内的可靠性和性能。
     
      (1) SilkPerformer——企业级性能测试工具u 企业级自动化测试工具能够支持多种系统,如Java、。Net、Wireless、COM、CORBA、Oracle、Citrix、 MetaFrame、客户机/服务器、以及各种ERP/CRM应用u 多项专利技术精确模拟各种复杂的企业环境u 可视化脚本记录功能及自定义工具简化了测试创建工作u SilkPerformer的Java/.NET浏览器以及JUnit/NUnit测试输入功能简化了对并发访问情况下远程应用组件的早期负载测试工作u 方便易用,工作流向导会逐步引导用户完成整个测试流程

      (2) SilkTest International——业内唯一的Unicode功能测试工具u SilkBean 充分利用 Java 语言的“编写一次,随处使用”的优点,让用户不必修改现有的脚本而能够在多种基于 Unix 的系统上运行u 能够识别多种开发平台,如Java、JavaScript、HTML、ActiveX、Visual Basic 和C/C++等u 一套脚本可供所有支持的语言使用u 内置的错误恢复系统不仅具有自定义功能,可进行无人看守的自动测试赛格瑞(Segue)公司是全球范围内专注于软件质量优化解决方案的领导者。2005 年,赛格瑞(Segue)公司在中国设立了专门的销售服务公司,因此,赛格瑞(Segue)公司的软件测试产品在中国有了更好的技术支持。
     
      参考网站:http://www.segue.com.cn/推荐指数:★★★★★

      2. MaxQ MaxQ是一个免费的功能测试工具。它包括一个HTTP代理工具,可以录制测试脚本,并提供回放测试过程的命令行工具。测试结果的统计图表类似于一些较昂贵的商用测试工具。MaxQ希望能够提供一些关键的功能,比如HTTP测试录制回放功能,并支持脚本。
     
      参考网站:http://maxq.tigris.org/推荐指数:★★★☆☆

      3. Httpunit HttpUnit是一个开源的测试工具,是基于JUnit的一个测试框架,主要关注于测试Web应用,解决使用JUnit框架无法对远程Web内容进行测试的弊端。
     
      HttpUnit提供的帮助类让测试者可以通过Java类和服务器进行交互,并且将服务器端的响应当作文本或者DOM对象进行处理。HttpUnit还提供了一个模拟Servlet容器,让测试者不需要发布Servlet,就可以对Servlet的内部代码进行测试。本文中作者将详细的介绍如何使用 HttpUnit提供的类完成集成测试。
     
      参考网站:http://www.httpunit.org/推荐指数:★★★☆☆

      4. Junit是通用的测试 java 程序的测试框架JUnit可以对Java代码进行白盒测试。通过JUnitk可以用mock objects进行隔离测试;用Cactus进行容器内测试;用Ant和Maven进行自动构建;在Eclipse内进行测试;对Java应用程序、 Filter、Servlet、EJB、JSP、数据库应用程序、Taglib等进行单元测试。
     
      参考网站:http://www.junit.org/推荐指数:★★★★★

      5. Jtest Jtest是Parasoft公司推出的一款针对java语言的自动化白盒测试工具,它通过自动实现java的单元测试和代码标准校验,来提高代码的可靠性。Jtest先分析每个java类,然后自动生成junit测试用例并执行用例,从而实现代码的最大覆盖,并将代码运行时未处理的异常暴露出来;另外,它还可以检查以DbC(Design by Contract)规范开发的代码的正确性。用户还可以通过扩展测试用例的自动生成器来添加更多的junit用例。Jtest还能按照现有的超过350个编码标准来检查并自动纠正大多数常见的编码规则上的偏差,用户可自定义这些标准,通过简单的几个点击,就能预防类似于未处理异常、函数错误、内存泄漏、性能问题、安全隐患这样的代码问题。
     
      JTest最大的优势在于静态代码分析,至于自动生成测试代码,当然生成测试代码框架也是不错的,但要做好单元测试用户还要做大量的工作。
     
      参考网站:http://www.parasoft.com/jsp/aep/aep.jsp推荐指数:★★★★☆

      6. Hansel Hansel 是一个测试覆盖率的工具——与用于单元测试的 JUnit framework 相集成,很容易检查单元测试套件的覆盖情况。
     
      参考网站:http://hansel.sourceforge.net/推荐指数:★★☆☆☆

      7. Cactus Cactus是一个基于JUnit框架的简单测试框架,用来单元测试服务端Java代码。Cactus框架的主要目标是能够单元测试服务端的使用 Servlet对象的Java方法如HttpServletRequest,HttpServletResponse,HttpSession等针对外部可测试组件运行时,需要把JUnit测试运行为发送HTTP请求给组件的客户端进程。为了在服务器容器内部运行JUnit测试,可以用Cactus框架,它是一个免费的开源框架,是Apache Jakarta项目的一部分。Cactus 包含了关于JUnit客户端如何连接到服务器,然后使测试运行的详细信息。
     
      参考网站:http://jakarta.apache.org/cactus/推荐指数:★★★★☆

      8. JFCUnit JFCUnit使得你能够为Java偏移应用程序编写测试例子。它为从用代码打开的窗口上获得句柄提供了支持;为在一个部件层次定位部件提供支持;为在部件中发起事件(例如按一个按钮)以及以线程安全方式处理部件测试提供支持。
     
      参考网站:http://jfcunit.sourceforge.net/推荐指数:★★★☆☆

      9. StrutsTestCase StrutsTestCase(STC)框架是一个开源框架,用来测试基于 Struts 的 Web 应用程序。这个框架允许您在以下方面进行测试:u 在 ActionForm. 类中的验证逻辑(validate() 方法)
     
      u 在 Action 类中的业务逻辑(execute() 方法)
     
      u 动作转发(Action Forwards)。
     
      u 转发 JSP STC 支持两种测试类型:u Mock 方法 —— 在这种方法中,通过模拟容器提供的对象(HttpServletRequest、 HttpServletResponse 和 ServletContext),STC 不用把应用程序部署在应用服务器中,就可以对其进行测试。
     
      u Cactus 方法 —— 这种方法用于集成测试阶段,在这种方法中,应用程序要部署在容器中,所以可以像运行其他 JUnit 测试用例那样运行测试用例。
     
      参考网站:http:// strutstestcase.sourceforge.net/推荐指数:★★★★☆

      10. TestNG TestNG是根据JUnit 和 NUnit思想而构建的一个测试框架,但是TestNG增加了许多新的功能使得它变得更加强大与容易使用比如:u 支持JSR 175注释(JDK 1.4利用JavaDoc注释同样也支持)
     
      u 灵活的Test配置u 支持默认的runtime和logging JDK功能u 强大的执行模型(不再TestSuite)
     
      u 支持独立的测试方法参考网站:http://testng.org/推荐指数:★★★★☆

  • Java GUI Test Framework

    2009-10-12 23:39:50

    Getting Started with the Abbot Java GUI Test Framework
    Building unit tests and functional tests (AWTUnit/SwingUnit)

    Abbot helps you test your Java UI. It comprises Abbot, which lets you programmatically drive UI components, and Costello (built on Abbot) which allows you to easily launch, explore and control an application. The framework may be used with both scripts and compiled code.

    Costello Screen Shot

    Costello

    Run Costello

    (Get Webstart here)

    This overview of the Abbot system will give you an idea of the different system components and how it is used. There is also some background concerning the issues involved with Java GUI testing.

    You can see what Costello (the script. editor) looks like or try it out via Java Web Start by using the links to the right. The screen shot shows a sample application, its UI hierarchy, and some component properties as displayed by Costello.

    Here is what GUI unit test code looks like using Abbot (see Tutorial 1 or Tutorial 2 for more examples).

        // Suppose MyComponent has a text field and a button...
        MyComponent comp = new MyComponent();
        // Display a frame. containing the given component
        showFrame(comp);

        JTextField textField = (JTextField)getFinder().
            find(new ClassMatcher(JTextField.class));
        JButton button = (JButton)getFinder().find(new Matcher() {
            public boolean matches(Component c) {
                // Add as much information as needed to distinguish the component
                return c instanceof JButton && ((JButton)c).getText().equals("OK");
            }
        });
        JTextComponentTester tester = new JTextComponentTester();
        tester.actionEnterText(textField, "This text is typed in the text field");
        tester.actionClick(button);
        // Perform. some tests on the state of your UI or model
        assertEquals("Wrong button tooltip", "Click here to accept", button.getToolTipText());

    Refer to the API documentation for the ComponentTestFixture, ComponentTester and Robot classes, as well as the framework tests in the test source subdirectory.

    You can also record user actions directly into a script. which controls the event playback and testing. This form. of test is more suitable to integration/functional testing. The Costello script. editor is provided which can record user actions and facilitate script. construction and maintenance. It also provides insight into the hierarchy of the application under test. You can launch the editor with the Web Start link above and immediately point it at any application you wish to launch and examine. The editor provides a hieararchy browser which displays all components in use by the application, as well as a wealth of information about any component selected in the hierarchy.

    JUnit is used as the controlling harness for running tests and suites of tests, but scripts can easily be wrapped to run in other environments. Scripts may also be used to create a demo or tutorial for an application. You can drive the actual application and provide popup annotations while it is running.
Open Toolbar