我一定要做一个顶尖的软件测试工程师。。。加油。。加油。。加油

读书笔记

上一篇 / 下一篇  2008-07-28 21:07:34

每日构建

我们公司的一个项目是java 开发的,web 应用 基于 tomcat 运行,后台数据库oracle。   代码版本控制是 cvs 。 代码服务器在美国。

    作为 一家外包公司,每天我们程序员 在上班的第一天开始 从cvs 下载最新的代码,编译,如果有冲突,会解决冲突,没有的话,开始编码,作为我们公司的
测试人员,基于公司的模式,我们实现以下 构建。

编译
     ant 提供了强大的编译功能,我们在开始写 build.xml 的时候,并没有写 compile 这步,而是直接从cvs 里面下载相应模块的build。xml 后,调用。这样做的目的是为了保证测试 和 开发的 使用同一套 编译脚步编译,保证协调 ,一致性。
     这里,我们使用了 ant 的如下功能:
      <ant antfile="build.xml" dir="./${release.home}/cvs/DPS/PhaseII/AE/" target="all"/>

    编译好的代码,我们会 自己拷贝到对应的 目录。

单元测试
     junit ,对应的测试模块,我们的开发人员已经 提交到cvs ,我们从cvs update 后,编译运行。在运行之前,先在数据库里 初始化 相应的测试数据,在ant 中,我们使用下面的方法 插入数据到 数据库:
    <target name="dbinit_insert">
      <sql
               driver="oracle.jdbc.driver.OracleDriver"
               url="jdbc:oracle:thin:@192.168.100.1:1521:china"
               userid="uni_app2"
               password="ladodgers"
               onfiltered="continue"
               >
               <transaction  src="./sql/InsertTestOrderNoteData.sql"/>   <!-- For Test Case TestUserLiveValidation -->
               <transaction  src="./sql/TestUserLiveValidationBegin.sql"/>   <!-- For Test Case TestUserLiveValidation -->
               <transaction  src="./sql/InsertTestCreateInventoryData.sql"/> <!-- For Test Case TestCreateInventory -->
               <transaction  src="./sql/InsertTestPerformanceVenueData.sql"/> <!-- For Test Case TestPerformanceVenue -->
               <transaction  src="./sql/InsertTestPerformanceManifestData.sql"/> <!-- For Test Case TestPerformanceManifest -->
               <transaction  src="./sql/InsertTestPerformanceData.sql"/> <!-- For Test Case TestPerformance -->
               <transaction  src="./sql/InsertTestPerformancePriceCodeData.sql"/> <!-- For Test Case TestPerformancePriceCode -->
               <classpath>
   <path refid="lib.path"/>
        </classpath>
          </sql>
     </target>

    然后开始 运行单元测试。

   在单元测试结束后,把插入的册书数据 清空,目的是 下次 运行 的时候,可以再次初始化 数据库。
   
    <target name="dbinit_delete">
         <sql
               driver="oracle.jdbc.driver.OracleDriver"
               url="jdbc:oracle:thin:@192.168.100.1:1521:china"
               userid="uni_app2"
               password="ladodgers"
               onfiltered="continue"
               >
               <transaction  src="./sql/deleteTestOrderNoteData.sql"/>   <!-- For Test Case TestUserLiveValidation -->
               <transaction  src="./sql/TestUserLiveValidationEnd.sql"/> <!-- For Test Case TestUserLiveValidation -->
               <transaction  src="./sql/deleteTestCreateInventoryData.sql"/> <!-- For Test Case TestCreateInventory -->
               <transaction  src="./sql/deleteTestPerformanceVenueData.sql"/> <!-- For Test Case TestPerformanceVenue -->
               <transaction  src="./sql/deleteTestPerformanceManifestData.sql"/> <!-- For Test Case TestPerformanceManifest -->
               <transaction  src="./sql/deleteTestPerformanceData.sql"/> <!-- For Test Case TestPerformance -->
               <transaction  src="./sql/deleteTestPerformancePriceCodeData.sql"/> <!-- For Test Case TestPerformancePriceCode -->
               <classpath>
   <path refid="lib.path"/>
        </classpath>
          </sql>
     </target>

     


    在我们的 build.xml 中,以下列顺序执行 target:

   1。 cvs update code
   2.   call build.xml compile source code
   3.   call build.xml compile unit test source code
   4.   insert data to database .
   5.   run unit test
   6.   generate unit test report
   7.   run clover check unit test cover rate
   8.   generate unit test cover rate  report
   9.   delete test data from data base
   10.  Email all report to PM and Leader . deploy these report base on web service .


TAG:

 

评分:0

我来说两句

日历

« 2024-05-06  
   1234
567891011
12131415161718
19202122232425
262728293031 

数据统计

  • 访问量: 33294
  • 日志数: 38
  • 图片数: 1
  • 建立时间: 2008-07-28
  • 更新时间: 2013-02-16

RSS订阅

Open Toolbar