我想做些事,我想做些有用的事,我想做些我可以做到的事,我想做些软件开发和测试的事……

发布新日志

  • IE打不开.xml文件弹出下载对话框的解决办法

    2008-07-23 13:57:41

    今天查看某网站用.xml文件做的时,才是提示下载。根本打不开

    我试图在文件夹选项可注册表中重新设置打开方式,结果还是不行。。

    到网上搜索一下相关的方法呢。

    果然搜索到了,使用以下命令就可以恢复XML文件的默认关联:
     
    REGSVR32 MSXML3.DLL

    运行之后,XML的打开方式就恢复默认了。

  • 使用LoadRunner监控Linux方法

    2008-04-23 10:53:22

    需要下载3个包,到网上google一个吧:

    (1)rsh-0.17-14.i386.rpm

    (2)rsh-server-0.17-14.i386.rpm

    (3)rpc.rstatd-4.0.1.tar.gz

    1.安装rsh,和rsh-server两个服务包。

    a. 卸载rsh

    rpm –q rsh----------查看版本号

    rpm -e 版本号---------卸载该版本。

    b.安装

    rpm –ivh rsh-0.17-14.i386.rpm rsh-server-0.17-14.i386.rpm

    这两个包在我的目录下有共享。

    2.下载并安装rstatd

    gunzip rpc.rstatd-4.0.1.tar.gz

    Tar –cvf rpc.rstatd-4.0.1.tar.

    ./configure ---配置

    make ---编译

    make install ---安装

    rpc.rstatd ---启动rstatd进程

    3. 打开/etc/xinetd.conf

    里面内容是:

    # Simple configuration file for xinetd

    #

    # Some defaults, and include /etc/xinetd.d/

    defaults

    {

    instances = 60

    log_type = SYSLOG authpriv

    log_on_success = HOST PID

    log_on_failure = HOST

    cps = 25 30

    }

    includedir /etc/xinetd.d

    4.重启xinetd:

    A: service xinetd reload

    B: /sbin/service xinetd rstart

    5.修改/etc/xinetd.d/下的三个conf文件 rlogin ,rsh,rexec 这三个配置文件

    打这三个文件,将里面的disable = yes都改成 disable = no (disabled用在默认的{}中禁止服务)

    或是把# default: off都设置成 on ,并把“#”去掉,这个的意思就是在xinetd启动的时候默认都启动上面的三个服务!

    6.启动rstatd: rpc.rstatd

    7.查看rstatd是否启动:

    rpcinfo –p

    假如能看到:

    100001 5 udp 618 rstatd

    100001 3 udp 618 rstatd

    100001 2 udp 618 rstatd

    100001 1 udp 618 rstatd

    就说明rstatd服务已经启动。可以用LR去添加LINUX机器监视它了。

  • JAVA对象中的hashCode()方法

    2008-02-28 14:02:09

    有效和正确定义hashCode()和equals() 

    每个Java对象都有hashCode()和 equals()方法。许多类忽略(Override)这些方法的缺省实施,以在对象实例之间提供更深层次的语义可比性。在Java理念和实践这一部分,Java开发人员Brian Goetz向您介绍在创建Java类以有效和准确定义hashCode()和equals()时应遵循的规则和指南。您可以在讨论论坛与作者和其它读者一同探讨您对本文的看法。(您还可以点击本文顶部或底部的讨论进入论坛。) 
    虽然Java语言不直接支持关联数组 -- 可以使用任何对象作为一个索引的数组 -- 但在根Object类中使用hashCode()方法明确表示期望广泛使用HashMap(及其前辈Hashtable)。理想情况下基于散列的容器提供有效插入和有效检索;直接在对象模式中支持散列可以促进基于散列的容器的开发和使用。 
    定义对象的相等性 
    Object类有两种方法来推断对象的标识:equals()和hashCode()。一般来说,如果您忽略了其中一种,您必须同时忽略这两种,因为两者之间有必须维持的至关重要的关系。特殊情况是根据equals() 方法,如果两个对象是相等的,它们必须有相同的hashCode()值(尽管这通常不是真的)。 
    特定类的equals()的语义在Implementer的左侧定义;定义对特定类来说equals()意味着什么是其设计工作的一部分。Object提供的缺省实施简单引用下面等式: 
    public boolean equals(Object obj) { return (this == obj); } 
    在这种缺省实施情况下,只有它们引用真正同一个对象时这两个引用才是相等的。同样,Object提供的hashCode()的缺省实施通过将对象的内存地址对映于一个整数值来生成。由于在某些架构上,地址空间大于int值的范围,两个不同的对象有相同的hashCode()是可能的。如果您忽略了hashCode(),您仍旧可以使用System.identityHashCode()方法来接入这类缺省值。 
    忽略 equals() -- 简单实例 
    缺省情况下,equals()和hashCode()基于标识的实施是合理的,但对于某些类来说,它们希望放宽等式的定义。例如,Integer类定义equals() 与下面类似: 
    public boolean equals(Object obj) { 
    return (obj instanceof Integer 
    && intValue() == ((Integer) obj).intValue()); 

    在这个定义中,只有在包含相同的整数值的情况下这两个Integer对象是相等的。结合将不可修改的Integer,这使得使用Integer作为HashMap中的关键字是切实可行的。这种基于值的Equal方法可以由Java类库中的所有原始封装类使用,如Integer、Float、Character和Boolean以及String(如果两个String对象包含相同顺序的字符,那它们是相等的)。由于这些类都是不可修改的并且可以实施hashCode()和equals(),它们都可以做为很好的散列关键字。 
    为什么忽略 equals()和hashCode()? 
    如果Integer不忽略equals() 和 hashCode()情况又将如何?如果我们从未在HashMap或其它基于散列的集合中使用Integer作为关键字的话,什么也不会发生。但是,如果我们在HashMap中使用这类Integer对象作为关键字,我们将不能够可靠地检索相关的值,除非我们在get()调用中使用与put()调用中极其类似的Integer实例。这要求确保在我们的整个程序中,只能使用对应于特定整数值的Integer对象的一个实例。不用说,这种方法极不方便而且错误频频。 
    Object的interface contract要求如果根据 equals()两个对象是相等的,那么它们必须有相同的hashCode()值。当其识别能力整个包含在equals()中时,为什么我们的根对象类需要hashCode()?hashCode()方法纯粹用于提高效率。Java平台设计人员预计到了典型Java应用程序中基于散列的集合类(Collection Class)的重要性--如Hashtable、HashMap和HashSet,并且使用equals()与许多对象进行比较在计算方面非常昂贵。使所有Java对象都能够支持 hashCode()并结合使用基于散列的集合,可以实现有效的存储和检索。 
    实施equals()和hashCode()的需求 
    实施equals()和 hashCode()有一些限制,Object文件中列举出了这些限制。特别是equals()方法必须显示以下属性: 
    Symmetry:两个引用,a和 b,a.equals(b) if and only if b.equals(a) 
    Reflexivity:所有非空引用, a.equals(a) 
    Transitivity:If a.equals(b) and b.equals(c), then a.equals(c) 
    Consistency with hashCode():两个相等的对象必须有相同的hashCode()值 
    Object的规范中并没有明确要求equals()和 hashCode() 必须一致 -- 它们的结果在随后的调用中将是相同的,假设“不改变对象相等性比较中使用的任何信息。”这听起来象“计算的结果将不改变,除非实际情况如此。”这一模糊声明通常解释为相等性和散列值计算应是对象的可确定性功能,而不是其它。 
    对象相等性意味着什么? 
    人们很容易满足Object类规范对equals() 和 hashCode() 的要求。决定是否和如何忽略equals()除了判断以外,还要求其它。在简单的不可修值类中,如Integer(事实上是几乎所有不可修改的类),选择相当明显 -- 相等性应基于基本对象状态的相等性。在Integer情况下,对象的唯一状态是基本的整数值。 
    对于可修改对象来说,答案并不总是如此清楚。equals() 和hashCode() 是否应基于对象的标识(象缺省实施)或对象的状态(象Integer和String)?没有简单的答案 -- 它取决于类的计划使用。对于象List和Map这样的容器来说,人们对此争论不已。Java类库中的大多数类,包括容器类,错误出现在根据对象状态来提供equals()和hashCode()实施。 
    如果对象的hashCode()值可以基于其状态进行更改,那么当使用这类对象作为基于散列的集合中的关键字时我们必须注意,确保当它们用于作为散列关键字时,我们并不允许更改它们的状态。所有基于散列的集合假设,当对象的散列值用于作为集合中的关键字时它不会改变。如果当关键字在集合中时它的散列代码被更改,那么将产生一些不可预测和容易混淆的结果。实践过程中这通常不是问题 -- 我们并不经常使用象List这样的可修改对象做为HashMap中的关键字。 
    一个简单的可修改类的例子是Point,它根据状态来定义equals()和hashCode()。如果两个Point 对象引用相同的(x, y)座标,Point的散列值来源于x和y座标值的IEEE 754-bit表示,那么它们是相等的。 
    对于比较复杂的类来说,equals()和hashCode()的行为可能甚至受到superclass或interface的影响。例如,List接口要求如果并且只有另一个对象是List,而且它们有相同顺序的相同的Elements(由Element上的Object.equals() 定义),List对象等于另一个对象。hashCode()的需求更特殊--list的hashCode()值必须符合以下计算: 
    hashCode = 1; 
    Iterator i = list.iterator(); 
    while (i.hasNext()) { 
    Object obj = i.next(); 
    hashCode = 31*hashCode + (obj==null ? 0 : obj.hashCode()); 

    不仅仅散列值取决于list的内容,而且还规定了结合各个Element的散列值的特殊算法。(String类规定类似的算法用于计算String的散列值。) 
    编写自己的equals()和hashCode()方法 
    忽略缺省的equals()方法比较简单,但如果不违反对称(Symmetry)或传递性(Transitivity)需求,忽略已经忽略的equals() 方法极其棘手。当忽略equals()时,您应该总是在equals()中包括一些Javadoc注释,以帮助那些希望能够正确扩展您的类的用户。 
    作为一个简单的例子,考虑以下类: 
    class A { 
    final B someNonNullField; 
    C someOtherField; 
    int someNonStateField; 

    我们应如何编写该类的equals()的方法?这种方法适用于许多情况: 
    public boolean equals(Object other) { 
    // Not strictly necessary, but often a good optimization 
    if (this == other) 
    return true; 
    if (!(other instanceof A)) 
    return false; 
    A otherA = (A) other; 
    return 
    (someNonNullField.equals(otherA.someNonNullField)) 
    && ((someOtherField == null) 
    ? otherA.someOtherField == null 
    : someOtherField.equals(otherA.someOtherField))); 

    现在我们定义了equals(),我们必须以统一的方法来定义hashCode()。一种统一但并不总是有效的定义hashCode()的方法如下: 
    public int hashCode() { return 0; } 
    这种方法将生成大量的条目并显著降低HashMaps的性能,但它符合规范。一个更合理的hashCode()实施应该是这样: 
    public int hashCode() { 
    int hash = 1; 
    hash = hash * 31 + someNonNullField.hashCode(); 
    hash = hash * 31 
    + (someOtherField == null ? 0 : someOtherField.hashCode()); 
    return hash; 

    注意:这两种实施都降低了类状态字段的equals()或hashCode()方法一定比例的计算能力。根据您使用的类,您可能希望降低superclass的equals()或hashCode()功能一部分计算能力。对于原始字段来说,在相关的封装类中有helper功能,可以帮助创建散列值,如Float.floatToIntBits。 
    编写一个完美的equals()方法是不现实的。通常,当扩展一个自身忽略了equals()的instantiable类时,忽略equals()是不切实际的,而且编写将被忽略的equals()方法(如在抽象类中)不同于为具体类编写equals()方法。关于实例以及说明的更详细信息请参阅Effective Java Programming Language Guide, Item 7 (参考资料) 。 
    有待改进? 
    将散列法构建到Java类库的根对象类中是一种非常明智的设计折衷方法 -- 它使使用基于散列的容器变得如此简单和高效。但是,人们对Java类库中的散列算法和对象相等性的方法和实施提出了许多批评。java.util中基于散列的容器非常方便和简便易用,但可能不适用于需要非常高性能的应用程序。虽然其中大部分将不会改变,但当您设计严重依赖于基于散列的容器效率的应用程序时必须考虑这些因素,它们包括: 
    太小的散列范围。使用int而不是long作为hashCode()的返回类型增加了散列冲突的几率。 
    糟糕的散列值分配。短strings和小型integers的散列值是它们自己的小整数,接近于其它“邻近”对象的散列值。一个循规导矩(Well-behaved)的散列函数将在该散列范围内更均匀地分配散列值。 
    无定义的散列操作。虽然某些类,如String和List,定义了将其Element的散列值结合到一个散列值中使用的散列算法,但语言规范不定义将多个对象的散列值结合到新散列值中的任何批准的方法。我们在前面编写自己的equals()和hashCode()方法中讨论的List、String或实例类A使用的诀窍都很简单,但算术上还远远不够完美。类库不提供任何散列算法的方便实施,它可以简化更先进的hashCode()实施的创建。
    当扩展已经忽略了equals()的 instantiable类时很难编写equals()。当扩展已经忽略了equals()的 instantiable类时,定义equals()的“显而易见的”方式都不能满足equals()方法的对称或传递性需求。这意味着当忽略equals()时,您必须了解您正在扩展的类的结构和实施详细信息,甚至需要暴露基本类中的机密字段,它违反了面向对象的设计的原则。 
    结束语 
    通过统一定义equals()和hashCode(),您可以提升类作为基于散列的集合中的关键字的使用性。有两种方法来定义对象的相等性和散列值:基于标识,它是Object提供的缺省方法;基于状态,它要求忽略equals()和hashCode()。当对象的状态更改时如果对象的散列值发生变化,确信当状态作为散列关键字使用时您不允许更更改其状态。 
  • PostgreSQL 8.2.5 + PostGIS 1.3.1 安装 (修改kylin日志)

    2008-01-16 14:23:37

    一、LINUX下安装

    1. 环境
    OS: RedHat AS4 Update4
    PostgreSQL: 8.2.5
    PostGIS: 1.3.1

    2. 需要的软件包
    postgresql-8.2.5.tar.gz
    proj-4.5.0.tar.gz
    geos-3.0.0rc4.tar.bz2
    postgis-1.3.1.tar.gz

    3. 编译安装源码
    (1)PostgreSQL 的安装
    # tar xvfz postgresql-8.2.5.tar.gz
    # cd postgresql-8.2.5
    # ./configure --prefix=/opt/postgresql-8.2.5
    # make
    # make install
    # cd /usr/local
    # ln -s /opt/postgresql-8.2.5 pgsql
    # useradd postgres
    # su - postgres
    $ mkdir data
    $ /usr/local/pgsql/bin/initdb -D data

    (2)Proj 的安装
    # tar xvfz proj-4.5.0.tar.gz
    # cd proj-4.5.0
    # ./configure --prefix=/opt/proj-4.5.0
    # make
    # make install
    # ln -s /opt/proj-4.5.0 /usr/local/proj

    (3)Geos 的安装
    # tar xvfj geos-3.0.0rc4.tar.bz2
    # cd geos-3.0.0rc4
    # ./configure --prefix=/opt/geos-3.0.0rc4
    # make; make install
    # ln -s /opt/geos-3.0.0rc4 /usr/loca/geos

    (4)PostGIS 的安装
    # tar xvfz postgis-1.3.1.tar.gz
    # cd postgis-1.3.1
    # LDFLAGS=-lstdc++ ./configure --prefix=/opt/postgis-1.3.1 --with-pgsql=/usr/local/pgsql/bin/pg_config --with-proj=/usr/local/proj --with-proj-libdir=/usr/local/proj/lib --with-geos=/usr/local/geos/bin/geos-config --with-geos-libdir=/usr/local/geos/lib
    # make; make install
    # ln -s /opt/postgis-1.3.1 /usr/local/postgis

    4. 配置环境
    (1)创建用户 postgres
    # groupadd postgres
    # useradd -g postgres postgres

    (2)用户postgres的环境变量
    # su - postgres
    $ vi .bash_profile

    PGDATA=$HOME/data
    PGSQL_HOME=/usr/local/pgsql
    PROJ_HOME=/usr/local/proj
    GEOS_HOME=/usr/local/geos
    POSTGIS_HOME=/usr/local/postgis
    LD_LIBRARY_PATH=$PGSQL_HOME/lib:$PROJ_HOME/lib:$GEOS_HOME/lib:$POSTGIS_HOME/lib
    PATH=$PGSQL_HOME/bin:$PATH:$HOME/bin

    export PATH PGDATA PGSQL_HOME PROJ_HOME GEOS_HOME POSTGIS_HOME LD_LIBRARY_PATH

    $ exit

    (2)PostgreSQL 数据库配置
    # su - postgres
    $ cd data
    修改postgres.conf, pg_hba.conf, 使用户可以远程访问。

    (3)PostGIS 安装配置
    # su - postgres
    $ postgres -D data &
    $ createdb gisdb
    $ createlang plpgsql gisdb
    $ cd $POSTGIS_HOME/share
    $ psql -d gisdb -f lwpostgis.sql
    $ psql -d gisdb -f lwpostgis_upgrade.sql
    $ psql -d gisdb -f spatial_ref_sys.sql

    至此安装成功,注意LD_LIBRARY_PATH里的路径设置一定要包含 proj 和 geos 的库的路径,否则 psql -f xxxx.sql 的时候会失败。

    5. 最后安装Windows客户端 PgAdminIII,安装好了,就可以用PgAdminIII连接的数据库服务器,可以查看到gisdb数据库里有了PostGIS的空间函数,数据类型等支持了。

    二、WINDOWS下安装,相对很简单就不再细化步骤了。

    在此要提醒一下,安装完成之后,使用客户端调用GIGS模板创建数据库时老是会弹出有另一用户在使用该数据库!然而根本就没有另外的用户在使用它。找了半天都不知其原因,最后在服务里面把数据库重启一下,就OK了。

  • QTP录制不了的原因

    2008-01-07 16:27:14

    问题起因:
    在安装QTP后,或者禁用IE浏览器里的一些ActiveX控件后,正常录制QTP事,不能产生相应的录制脚本,脚本内容为空。

    解决方法:QTP在IE中录制脚本是依靠一个叫BHOManager Class的动态链接库来完成的。当这个控件没有被加载,或者被禁用时,就会出现上述症状。于是,解决方法就很简单了,重新加载,或启用这个控件,一切就OK啦。

    具体步骤:
    打开IE,在菜单中选择[工具]/[Internet选项]进入Internet配置界面。选择[程序]/[管理加载项],查看目前加载的ActiveX的情况。

    当看到存在BHOManager Class并且其状态是“禁用”时,点击“启用”开启这个功能,并保存后退出即可解决问题。
    当在管理加载项里找不到BHOManger Class这个加载项时,如果你安装了QTP,那么在C:\WINDOWS\system32下会存在一个叫BHOManager.dll的动态链接库,或者可以直接在计算机里搜索BHOManager.dll,然后查看其路径。加载这个dll,加载方法为:点击[开始]/[运行],输入cmd,然后定位到dll所在目录,键入regsvr32 BHOManager.dll命令,即可注册此dll。问题解决。

    注:如发现BHOManger Class是启用状态,但仍录制不了,就先禁用再重新启用一遍!

     

  • 〔转〕10年跳槽经验总结 高级人才不用找工作

    2008-01-03 18:19:14

    首先,真正的高级人才是不用找工作的,因为只有被工作找的份。

    但是,难免有些高级人才厌倦了旧的工作环境,或者遇到天花板,没有了发展空间,或者遇到新老板上任后排除异己来提拔自己的亲信等等,如果您真打算自己去找工作,那么至少需注意以下几点:

    1、网上求职尤其需注意那些一天到晚在网上打招聘广告的公司。这类公司通常分成两类:
    一类是垃圾公司,如一些别有用心的保险公司、中介公司等。这类公司以获取你的个人资源和个人信息为目的。

    二类是某些小有名气的公司,但由于用人条件苛刻并且薪资待遇与他们的苛刻要求不匹配,所以一年到头在招人,却总也招不到让他们满意的人。还有一些著名公司,以打广告为目的,招人为幌子,一个破烂职位能放在网上招一两年。

    2、千万小心猎头公司。他们更象是猎狗公司,他们嗅觉灵敏,对打探个人隐私有着狂热而又执着的癖好,往往是工作没给你找成功,却把你现在工作的公司,以前工作的公司闹得沸沸扬扬。如果你不想丢掉现在的工作,不想让你以前的同事议论非非,那么,请慎重选择猎头公司,慎重透露你的隐私给猎头公司。切记切记。

    3、只给你发邮件而不打电话叫你去面试的公司,必须不予理睬。通常是一些垃圾公司,没有能力满足你的基本要求。他们自己也没把握雇得起你,所以连电话费也免了。

    4、第一次电话就让你于某月某日几点钟去哪里面试的公司,必须立刻回绝。因为你到时候到那里一看,一堆刚毕业2、3年的年轻后生正爬在桌子上填写简历。你跟这些人竞争的结果就是你的工资最多只有他们的1倍高,5、6千顶天了。那么应该怎么回答呢?告诉人事经理,我没空,我只有莫月某日下午几点钟才有空,若不然,就不用去了,浪费时间,肯定是低级职位。
     
    5、第一次面试就让你带好学历学位证书去面试的公司,千万别去,因为不用问,肯定是低级职位。

    6、去公司面试前必须问清楚是谁面试你,如果得知不是总经理或副总经理来面你,那么我劝你立刻回绝这个职位,因为如果面你的是个低三下四的中层干部,那么你的职位肯定是低四下五的低贱职位。总之,打扮得笔挺结果给猪看了,即花钱又浪费时间。

    7、一进门就让你填一堆表格的公司,必须立马走人,因为这是招聘中低等员工的惯用伎俩,特别是对那些喜欢出一些狗屁不通的试卷的公司,千万不要跟他们浪费时间。况且,应聘的人为了得到这份工作,根本就不可能按自己的真实情况回答这种测试卷,废纸一堆,招聘的人根本不懂人事管理。

    8、不要去人才市场找工作,高端职位不是放在菜市场上卖的。

    9、如果公司所在城市离你较远,需要飞机前往,一定要问明公司报销不报销路费。如果不报销,或者说如果录取就报销的公司,建议不要冒险去试。即使十个面试者中最后被你淘汰了九个,你还是会发现该公司的福利待遇极差极差。惨痛教训,切记勿再试。

    10、要知道一个公司的整体面貌和素质如何,那就请留意人事部职员的面貌,尤其是人事经理的素质往往是一个公司整体素质的缩影。如果接待你的人事经理较热心较礼貌周到,那么该公司的工作氛围一般较好,如果人事经理较冷漠或不很礼貌,那么该公司同事关系往往较残酷较冷漠。

    11、不要试图跟新加坡或台湾老板共事,否则你就等着身心接受摧残和扭曲吧。

    12、注意Hr的职业病,几乎每个HR都有窥探癖和多疑症。

    13、最后一条,也是最重要的一条,12年的跳槽经验表明,较好的中国公司及正规的外企正愈来愈倾向于日本企业的终身雇佣制度,即:拒绝跳槽,拒绝人才流动。所有的HR都有一种固执而又变态的心理:他不希望成为你的第一个开苞的男人,但却强烈地希望是你的第二个雇主,并且是在该领域被第一个雇主用了5年到八年之后,同时希望自己是你的最后一个雇主。所以HR对你的跳槽经历往往怀有一种强烈的偏见和关注,对你跳槽原因的研究兴趣近乎变态。所以,对于绝大多数求职者来讲,最好的选择就是:不跳槽。或者至少在一个单位工作5~8年再考虑跳槽,而作为对这5~8年经验的积累的回报,薪水往往应该加倍,否则就是你贱卖了自己。这就是薪水一路加倍的秘密。

    14、最后,祝各位达人职业生涯中薪水加倍加倍再加倍

     

  • QuickTest Plus小工具,大作用(转)

    2007-12-26 15:12:23

    象我这样初学QTP的朋友刚开始时很可能没有注意到QuickTest Plus,因为QTP安装后默认是
    没有安装plus的,千回百转知道了plus,大概看了看,发现plus虽然都是些辅助性的小工具,但
    往往会给你的工作带来事半功倍的效果。

    一、安装QuickTest plus

      QTP安装后,在 程序 > QuickTest Professional下点击QuickTest Plus,然后按照提示一步步往下安装即可,
      其中要求输入序列号,输入和QTP安装时相同的序列号就可以了(8888-8888888888)。

    二、提示和技巧

      plus不仅提供了一些工具,还在它的帮助手册里给出了一些提示和技巧,以及一些实用的Function。
      在这里我把一些比较常用的好东东贴出来,其他的就看plus的帮助吧。

    1、创建action template.
        当希望在每一个新建action时都增加一些头部说明,比如作者、创建日期、说明等,用action template
        来实现最简单快捷。
        方法:用记事本等文本编辑器,输入如下类似的内容:
              'Company: xxxx
              'Author: xxx
              'Product: xxx
              'Date: xx
             然后将文件保存为ActionTemplate.mst,并存放到QTP安装目录下的dat目录,重启QTP,新建一个action试试,新建的action会包含以上信息。

    2、关于设置测试报告里只显示error的信息。
        帮助中说:修改安装目录下bin\QTReport.ini文件,增加以下内容:
             [FilterDialog]
             ReportAppDefaultFilter=1 # for error only
             ReportAppDefaultFilter=3 # shows all messages (default)
        但根据我的测试结果,不尽其然:
         1)当ReportAppDefaultFilter=1时,如果Object Repository中缺少对象,在报告中会在相应的
           action前打叉,但不会提示具体错误,而成功的步骤都有具体信息显示。
         2)用Reporter.ReportEvent测试的结果是:
            ReportAppDefaultFilter=1时,只显示micDone的具体信息;
            ReportAppDefaultFilter=2时,只显示micFail的具体信息;
            ReportAppDefaultFilter=3时,只显示micDone和micFail的具体信息;
            ReportAppDefaultFilter=4时,只显示micPass的具体信息;

        似乎无规律可寻,所以我的结论暂时是:不要设置这个参数,用默认的,显示所有信息,更多的信息有利于分析结果。

    3. 启动IE的语句:SystemUtil.Run "iexplore.exe", "http://www.mercuryinteractive.com"
    4. 关闭IE或其他程序的语句:SystemUtil.CloseProcessByName "app.exe"
         or  SystemUtil.CloseProcessByWndTitle "Some Title"

    三、Function Libraries

        plus的帮助中提供了一些常用的Function,把这些function copy到文本编辑器中保存为.vbs文件,并添加到Resources中就可以直接调用了,
      或直接copy到你的action中,就可以在当前的action中调用。更推荐第一种方法,所有的action都可以调用。

    1、文件操作相关的function,如下,望名则可生意:
        Function CreateFile(sFilename, bOverwrite);
        Function OpenFile(sFilename, iomode, create);
        Function AppendToFile(sFilename, sLine);
        Function WriteToFile(sFilename, sLine);
       
    2、Function NormalizeString(OrgStr); (将字符串变成regular express)

    3、GlobalDictionary的使用,这是另外一种可以共享全局变量的方法,在所有的action中,包括local和external action中都可以访问。

    4、使用文件系统相关的function:
        Function ReadLineFromFile (byref FileRef);
        Sub FileDelete ( FilePath);
        Function FileCompare (byref FilePath1, byref FilePath2, byref FilePathDiff, ignoreWhiteSpace);
        Function CheckFileExists (FilePath)

    5. web table相关的function:
        Function ItemByKeyColumn(): 根据table中某列的值,得到同一行中另一列的对象。(这个功能非常有用。)
        Function ObjectsByMicClass(Obj, micClass): 得到table中所有的micClass类型的对象集合。


    四、工具
      
      1、Automation Generator Utility
         添加一系列动作,然后自动完成。如:启动QTP,然后执行test1, test2, test3...,最后关闭QTP,还可以连接或断开Quality center.
         值得注意的是,每个test都可以分别指定test result文件,这样可以把所有test result指定到同一个目录下,所有test执行完成后,
         用Test Result Viewer就可以快速的查看测试报告。

      2、External Action Call Modifier Utility
         外部Action调用修改工具。当删除一个Reusable action前,如果没有先删除其他test中对它的调用,则打开其他test时,会提示找不到某某
         action,这种情况下启用该工具,工具会列出test下所有调用的外部action(如果调用的action是使用相对路径,则不会列出来),如果外部
         action找不到,会用红色的问号表示,删除它并保存后就OK了。
         也可以在此处修改外部action的来源,修改后原来的action parameter仍会保留。
      
      3、Repository Merge Utility
         合并多个对象库文件中的对象,如果出现冲突,可以选择忽略,或手工合并,或自动合并。
         对象库文件是Action目录下的Resource.mtr文件。

      4. Report Analyzer
         Test Result的另一个查看工具,提供了一些过滤条件,比如只查看failed step, 或只查看checkpoints,或只查看某个action。

    先就写这么多了,抛砖引玉,希望你能发现你想要的东西。写得不对的,不要客气,请指出来,不胜感激。
  • 八种反应表示员工认可你

    2007-12-18 10:34:45

    发表在www.hr.com上的一篇文章指出,欲了解你的管理风格是否为员工所认可,有八种迹象可供参考。

      第一,即使你不在办公室,你的员工也知道你期望他们做什么。这意味着你已经让每个人明白了你对他们的期望,并且赋予了他们充分的自由去做自己认为正确的事情。

      第二,当你回到办公室,你的员工会主动告诉你他们做了什么,为什么那样做,出现了什么样的结果。这意味着他们对自己做的事情相当自信,并且相信你也认为他们做对了。

      第三,在你召开例行会议时,你的员工个个都很放松,并且能够畅所欲言。如果开口的人寥寥无几,意味着你平时可能太过独裁。

      第四,对于公司里发生的一切,鲜有人传播小道消息或无端猜测。这意味你的沟通工作做得相当不错。

      第五,你的员工对待客户的方式与你对待客户的方式一样。这意味着你已经在这方面给员工确立了一个适当的标准,也意味着他们非常清楚公司的目标,知道自己应该做什么。

      第六,你的员工能够彼此尊重,合作无间。通常,员工之间冲突不断,是因为领导容忍某些人的不良表现。当他们之间合作无间,往往意味着你是一个公平、得力的领导者。

      第七,在收到你的负面反馈后,你的员工不会生气或觉得震惊。这意味着员工认可你的看法,也意味着你很好地掌握了在不伤害他们自尊的情况下,提供负面反馈的技巧。

      第八,当出现人手不足的情况时,你的员工会主动推荐好的候选人,公司的员工流失率低。这意昧着他们乐意追随你,乐意与你一起工作。
  • 相信就是效率,相信就是力量,相信就是成功的起点

    2007-12-18 00:13:53

    路在你的脚下延伸
      1、努力有结果但不一定有好结果,你想过没有,你的结果为什么不好?
      2、你好忙!好忙!你停下来仔细想过没有,到底为谁在忙?
      3、你没时间!你时间好紧张!你想过没有,你有24小时,我也只有24小时呢?
      4、你只会说你好累!好辛苦!你会不会说你明天一定不会再累!再辛苦了?
      5、你老是说你不行!你有没想过,生活在这个社会里,你不行也得要行?
      6、问你要一个电话好似要你的命一样,就算有几个烦心的电话,你都应对不了,你还想成功?
      7、说多了好象骗子,想多了你是在骗自己,越想还越信以为真,你想那么多干什么,问题是想出来的,不想就没有问题!
      8、你生来是解决问题的,不要被问题解决了!
      9、门开着也许好的、坏的都会进来,但是,如若你的门关着,肯定是好的也进不来了,打开你的心灵之门,好事会源源而来的!
      10、你要时常记住:不是你有话要说,而是你听不听得懂!
      11、你老是说你知道,你确实也知道很多,但是我要告诉你的是:知道你又没有得到,知道是没有力量的,相信才有力量!
      12、你这样不想做那样不想做,你想做什么?你要做自己该做的事情,不要做自己想
      做的事情,当你成功以后你才可以说,我想做什么就去做什么!成功是要有些勉强的!
      13、你老是说你不习惯,你习惯什么?你习惯上班打卡、你习惯挤大巴、你习惯不想
      起床也得起、你习惯回家坐汽车,你不习惯也得习惯、但是、你要养成一个成功的习惯!
      14、你那么痛苦的去爱人,还不如让别人来爱你!
      15、不相信的事情并不等于不存在,不了解的事情并不等于不发生!
      16、奇迹就是把不可能变为可能!
      17、说来就话长了,总之是你今天没有做明天的事吧,所以你的明天永远是今天,而今天通常是好累的!
      太多了,要想知道,你就找我吧,但不要费话太多,不然你会失去机会的!
      因为问题是你想出来的,不想就没有问题!解决了问题你还会出来好多好多的问题!
      人的一生就是在解决问题,你可以是自己解决,也可以是请别人为你解决,也有可能你是被问题解决了,谁是解决问题的高手谁就成功了!
      在我这里,你只要拥有一份相信,你就开始走向成功了!
      相信就是效率,相信就是力量,相信就是你成功的起点。。。 
  • MYECLIPSE6.0.1注册码(转载)!仅共学习研究使用

    2007-12-15 23:47:53

    package test;

    import java.io.*;

    public class MyEclipseGen {
        private static final String LL = "Decompiling this copyrighted software is a violation of both your license agreement and the Digital Millenium Copyright Act of 1998 (http://www.loc.gov/copyright/legislation/dmca.pdf). Under section 1204 of the DMCA, penalties range up to a $500,000 fine or up to five years imprisonment for a first offense. Think about it; pay for a license, avoid prosecution, and feel better about yourself.";
        public String getSerial(String userId, String licenseNum) {
            java.util.Calendar cal = java.util.Calendar.getInstance();
            cal.add(1, 3);
            cal.add(6, -1);
            java.text.NumberFormat nf = new java.text.DecimalFormat("000");
            licenseNum = nf.format(Integer.valueOf(licenseNum));
            String verTime = new StringBuilder("-").append(new java.text.
                    SimpleDateFormat("yyMMdd").format(cal.getTime())).append("0").
                             toString();
            String type = "YE3MP-";
            String need = new StringBuilder(userId.substring(0, 1)).append(type).
                          append("300").append(licenseNum).append(verTime).toString();
            String dx = new StringBuilder(need).append(LL).append(userId).toString();
            int suf = this.decode(dx);
            String code = new StringBuilder(need).append(String.valueOf(suf)).
                          toString();
            return this.change(code);
        }

        private int decode(String s) {
            int i;
            char[] ac;
            int j;
            int k;
            i = 0;
            ac = s.toCharArray();
            j = 0;
            k = ac.length;
            while (j < k) {
                i = (31 * i) + ac[j];
                j++;
            }
            return Math.abs(i);
        }

        private String change(String s) {
            byte[] abyte0;
            char[] ac;
            int i;
            int k;
            int j;
            abyte0 = s.getBytes();
            ac = new char[s.length()];
            i = 0;
            k = abyte0.length;
            while (i < k) {
                j = abyte0[i];
                if ((j >= 48) && (j <= 57)) {
                    j = (((j - 48) + 5) % 10) + 48;
                } else if ((j >= 65) && (j <= 90)) {
                    j = (((j - 65) + 13) % 26) + 65;
                } else if ((j >= 97) && (j <= 122)) {
                    j = (((j - 97) + 13) % 26) + 97;
                }
                ac[i] = (char) j;
                i++;
            }
            return String.valueOf(ac);
        }

        public MyEclipseGen() {
            super();
        }

        public static void main(String[] args) {
            try {
                System.out.println("please input register name:");
                BufferedReader reader = new BufferedReader(new InputStreamReader(
                        System.in));
                String userId = null;
                userId = reader.readLine();
                MyEclipseGen myeclipsegen = new MyEclipseGen();
                String res = myeclipsegen.getSerial(userId, "20");
                System.out.println("Serial:" + res);
                reader.readLine();
            } catch (IOException ex) {
            }
        }
    }

     

    ===========================

    运行该代码,在控制台中会出现:

    please input register name:
    ×××××(你的name)

    即生成序列号:

    please input register name:
    camille
    Serial:pLR8ZC-855575-53668556514322852

  • QTP功能点解释

    2007-12-15 23:43:31

    1、消息的作用:

    将消息发送到测试结果:如检查站点是否有密码编辑框,把消息发送到测试结果。

    2、注释

    可以在编程时向测试或组件中添加注释。注释是程序中的解释性备注。运行测试
    或组件时, QuickTest 不处理注释。可以使用注释来解释测试和组件中的各部
    分,以提高可读性,并使其更易于更新。

    3、操作模板

    如果要在测试中的每个新建操作中包含一个或多个语句,则可以创建一个操作模
    板。例如,如果始终输入您的姓名作为操作的作者,则可以向操作模板中添加该
    注释行。操作模板仅适用于在您的计算机上创建的操作。

    4、同步测试或组件

    运行测试或组件时,应用程序可能并不总是以相同的速度响应。例如,它执行下
    列操作可能会花几秒钟;可以通过同步测试或组件来处理这些预料中的计时问题,以确保 QuickTest 在等到应用程序准备就绪后才执行某个步骤。

    5、度量事务

    通过定义事务,可以度量运行测试的某个部分所用的时间。事务表示应用程序中
    用户想要度量的进程。在测试中,可以将该测试的适当部分用 start 和 end 事务
    语句括起来,从而定义事务。例如,可以定义一个事务,用于度量预定航班座位
    以及在客户终端显示确认信息所用的时间。该项与性能测试相关。


  • hibernate中的save和saveOrUpdate(单主键情况)[转]

    2007-12-15 23:39:33

    在单主键情况,两个方法到底有啥区别:

    如果持久对象使用了自增长的单主键(一般情况下也都是这么做)。通常两者没什么区别。

    但是如果持久对象使用自己赋值的单主键,那么使用saveOrUpdate就不大合适了。
    例如:如果你将一个持久对象的主键赋值了,你本想插入这条记录,但实际上执行的是更新,因为hibernate会认为你的主键存在了,那么它会采用更新。但如果你使用save,那么hibernate直接插入数据。

  • 托业七大题型详解Photographs

    2007-12-15 23:38:11

    1.Sentences About Photographs

        Format
     ------

        The first part of TOEIC consists of twenty numbered photographs that are in your test book. For each photograph, you will hear on the audio program four sentences that refer to it. You must decide which of the sentences best describes something you can see in each photograph.

        The photographs are pictures of ordinary situations. Around two-thirds of the photographs involve a person or people; around one-third involve an object or a scene without people.

        The sentences are short and grammatically simple. They generally deal with the most important aspects of the photographs, but some focus on small details or on objects or people in the background.

        Each item is introduced by a statement that tells you to look at the next numbered photograph. The pacing for this part is fast: There is only a five-second pause between items, and there is no pause between sentences (A), (B), (C), and (D).

        Tactics
      -------

        1. Always complete each item as quickly as possible so that you can preview the photograph for the next item. Don't wait for the statement that says, "Now look at photograph number __. "

        2. If you are previewing a photograph that involves a person or people, look for aspects of the photographs that are often mentioned in the sentences:

        * What are the people doing?
        * Where are they?
        * Who are they? (Is there a uniform. or piece of equipment or anything else that indicates their profession or role?)
        * What distinguishes them? (Is there a hat, a mustache, a puree, a pair of glasses, a tie, or anything else that differentiates the people?)
        * What do the people's expressions tell you? (Do they look happy? Unhappy? Excited? Bored? Upset?)

        3. If you are previewing a photograph of an object, focus on these aspects:

        * What is it?
        * What is it made of?
        * What —— if anything —— is it doing?
        * Where is it?

        4. If you are previewing a photograph of a scene, focus on these aspects:

        * Where is it?
        * What is in the foreground (the "front" of the picture)?
        * What —— if anything —— is happening?
        * What is in the background (the "distant" part of the picture)?

        5. Don't mark an answer until you have heard all four choices. When you hear a choice that you think is correct, rest your pencil on that oval on your answer sheet. If you change your mind and hear a sentence that you think is better, move your pencil to that choice. Once you have heard all four sentences, mark the oval that your pencil is resting on. (This technique helps you remember which choice you think is best.)

        6. Try to eliminate choices with problems in meaning, sound, and sound + meaning.

        7. Most correct answers involve verbs in the simple present ("The furniture looks new.") or present progressive tense ("The woman is riding a bicycle."). Be suspicious of answer choices involving any other tenses.

        8. Never leave any blanks. Always guess before going on to the next item.

        9. As soon as you have finished marking the answer, stop looking at and thinking about that photograph and move on to the next item.

        * Testing Points and Skill-Building Exercises
        A. Sentences with Meaning Problems
        B. Sentences with Sound Problems
        C. Sentences with Sound and Meaning Problems

    2.Questions/Responses

    Format
      --------

      This part of TOEIC consists of thirty items. Each item consists of a question on the audio program followed by three possible responses (answers) to the question, also on the audio program. Your job is to decide which of these three best answers the question. Between each item is a five-second pause. Part II problems do not involve any reading skills; therefore, this part is considered a "pure" test of listening skills. Your test book simply tells you to mark an answer for each problem.

    Tactics
      -------

      1. There are no answer choices to consider before or while the item is being read. You should just concentrate on the question and the three responses on the audio program, and pay no attention to the test book.

      2. Try to identify the type of question (information question, yes/no question, alternative question, and so on). The correct response, of course, often depends on the type of question being asked.

      3. Try to eliminate distractors.

      4. Don't mark an answer until you have heard all three responses. When you hear a response that you think is correct, rest your pencil on that oval on the answer sheet. If you change your mind and hear a response that you think is better, move your pencil to that choice. Once you have heard all three responses, mark the oval that your pencil is resting on. (This technique helps you remember which choice you think is best.)

      5. If you hear all three responses and none of the three seems correct, take a guess and get ready for the next item.

      6. There is very little time (only five seconds) between items in Part II. You need to decide on an answer and fill in the blank quickly to be ready for the next item.

    * Testing Points and Skill-Building Exercises

      A. Information Questions
      B. Yes/No Questions
      C. Other Types of Questions
      D. Recognizing Sound/Meaning Distractors
      E. Recognizing Other Types of Distractors

    3.Short Conversations

    Format
      ------

        This part of TOEIC consists of thirty short conversations, either between a man and a woman or between two men. The conversations airs three-part exchanges: The first speaker says something, the second speaker responds, and the first speaker says something else. Two typical patterns airs given below:

        Speaker 1: Asks a question. Speaker 1: Makes a statement.

        Speaker 2: Responds to the question. Speaker 2: Questions the statement.

        Speaker 1: Comments on the response. Speaker 1: Responds to the question.

        In your test book, each question is written out, followed by four possible answer choices. Your job is to decide which one of these best answers the question. Then you need to mark the corresponding answer on your answer sheet.

    Tactics
      -------

        1. Between each conversation theirs is an eight-second pause. This may not sound like a long time, but you can actually accomplish quite a bit during this pause. You need to mark the answer for the item that you just heard and then preview the next item. Previewing the item consists of reading the question —— this tells you what to listen for —— and of quickly looking over the four answer choices.

        2. While listening to the conversation, keep your eyes on the answer choices. Don't close your eyes or look away. Try to evaluate the four choices as you airs listening.

        3. Remember that distractors are sometimes mentioned in the conversations but are not answers to the question. Don't choose an answer justbecause you hear a word or two from the answer in the conversation.

        4. If the correct answer is not obvious, try to eliminate answers that seem to be incorrect. If more than one answer choice is left, take a guess.

        5. Mark your answers as quickly as possible so that you can preview the next item.

        6. Never leave any answers blank. If you are not sure, always guess.

    * Testing Points and Skill-Building Exercises
      A. Overview Questions
      B. Detail Questions
      C, Inference Questions

    4.Short Talks

    Format
      ------

      In Part IV, you will hear a number of talks on the audio program. There are two, three, and sometimes four questions for each talk. The questions are written in your test booklet. There are four answer choices following each question. You have to choose the best answer to the question based on the information that you hear in the talk. Before each of the talks, there is an introductory statement.

    Examples of introductory statements:

      Questions 80 and 81 are based on the following announcement:

      Questions 93 to 96 refer to the following lecture:

      Following each talk, you'll hear instructions to answer particular questions, with eight-second pauses between each of them. (You do not have to wait for these announcements to answer the questions.)

      Because this part of the test consists of both spoken material on the tape and written questions and answer choices, it tests both listening and reading skills.

      1. The talks: The talks are all monologues —— that is, they are delivered by one speaker. They are fairly short —— most are less than one minute long.

      2. The questions: Three main types of questions are asked about the talks: overview questions, detail questions, and inference questions.

    * Overview questions require a general understanding of the lecture or of the situation in which it is given. Overview questions ask about the main idea or purpose of the lecture, or about the speaker, the audience, or the location where the talk is given. Some typical overview questions:

    Who is speaking?
      What is the purpose of the talk?
      What kind of people would probably be interested in this talk?
      What is happening in this talk?
      Where is this announcement being made?

    * Detail questions relate to specific points in the talk. They begin with question words: who, what, where, why, when, how, how much, and so on. Some ars negative questions; they ask what was not mentioned in the talk:

    Which of the following is NOT true about…… ?

    * Inference questions require you to make a conclusion based on the information provided in the talk. These questions often contain the word probably or forms of the verbs imply or infer:

    What is probably true about…… ?
      What does the speaker imply about…… ?
      What can be inferred from this talk?

      3. The answer choices: All the answer choices are plausible answers to the questions, in many cases, the distractors are mentioned in the talk. Justbecause you hear an answer choice mentioned in the talk does not mean it is the correct answer for a particular question.

    Tactics
      -------

      1. Listen carefully to the introductory announcement that is given before each talk. It will tell you what kind of talk you are going to hear (an announcement or a commercial, for example) as well as which questions to look at during that talk.

      2. Always look at the questions as the talk is being given on the audio program. Do not look away or close your eyes in order to concentrate on the spoken material. You must focus on both the talk and the written questions.

      3. Because the questions ars written out, you can use them to focus your listening for particular information.

      4. Do not mark your answer sheet while the talk is going on, even if you know the answer. The act of answering a question may cause you to miss the information you need to answer the question or questions that follow.

      5. Do not wait for the speaker on the audio program to instruct you to answer the questions. In fact, you should ignore those announcements. Begin answering as soon as the talk is over, and answer all the questions related to that talk as soon es you can. If you have a few seconds left before the next talk begins, preview the next few questions in your test booklet.

      6. Never continue working on the questions about one talk after another talk has begun.

      7. If you are not sure of an answer, eliminate unlikely choices and then guess.

      8. Always answer each question. Never leave any blanks.

    * Testing Points and Skill-Building Exercises
      A. Public Announcements
      B. News, Weather, and Public Service Bulletins
      C. Commercial Messages
      D. Business Talks
      E. Recorded Messages

    5. Sentence Completion

        Format
        ------

        This section consists of forty sentences, each missing one or more words. Below each sentence are four words or phrases. Your job is to decide which of these four choices produces a complete, grammatical, and logical sentence when it is put into the sentence.

        Tactics
        -------

        1. Begin by reading each item carefully. Try to guess what word or words are missing. Look for these words or similar words among the answer choices.

        2. The most common testing point in Part V involves word choice. You can identify these itemsbecause the four answer choices look alike or have similar meanings. Use the context of the sentence to help you choose the answer, and look for any grammar clues that help you eliminate distractors.

        3. The second most common type of item in Part V involves word form. You can recognize these because the answer choices are all forms of the same word. Use the endings of the words to determine which choice is correct in the context of the sentence.

        4. Verb problems are the third most common item type in Part V. The answer choices for these items are four forms of the same verb. Look for time words and other clues.

        5. If the correct choice is not obvious, eliminate choices that are clearly incorrect and guess. Put a mark by items that you found difficult so that you can come back to them if you have time. Never leave any items unanswered.

        6. Never spend too much time on any one item.

        7. As soon as you finish Part V, go on to Part VI.

        * Testing Points and Skill-Building Exercises
        A. Word Choice
        B. Word Forms
        C. Word Choice/Word Forms
        D. Verbs
        E. Prepositions
        F. Connecting Words
        G. Gerunds, Infinitives, and Simple Forms

    6. Error Identification

        Format
        ------

        Section VI of TOEIC tests your ability to recognize mistakes in grammar or usage in written sentences. It consists of twenty items. In each item, four expressions —— usually one or two words each —— are underlined. You have to examine all four items and decide which one must be rewritten (it can't simply be omitted) to form. a correct sentence. In other works you need to find the underlined expression that contains a mistake.

        Tactics
        -------

        1. Read each item word for word. Don't just look at the underlined portion of the sentencesbecause the error is often incorrect only because of the context of the sentence.

        2. Don't read too quickly. If you do, your eyes may skip over errors, especially those involving "small words" (prepositions, pronouns, articles). Try to pronounce each word in your mind as you read. This will help you catch errors that "sound wrong."

        3. If you are unable to find an error after the first reading, look at the verbs in the sentence to see if they are used correctly, since verb errors are the most common errors in Part VI. Check the verb's tense, form, and agreement with the subject.

        4. If the verb seems to be used correctly, check for other common errors: word choice, word form, preposition use, and so on.

        5. If you still cannot find an error, eliminate choices that seem to be correct. If more than one choice remains, make a guess. Put a mark on your answer sheet next to items that you are not sure of so that you can come back to these items if you have time at the end of Section VI. (Be sure to erase all these marks before the end of the test.)

        6. Never spend too much time on any one item.

        7. Never leave any blank answers. Always guess.

        8. As soon as you finish Part VI, go on to Part VII. Keep in mind that Part VII (Reading Comprehension) takes more time to complete than either Part V or Part VI.

        *Testing Points and Skill-Building Exercises
        A. Verb Errors
        B. Word-Choice Errors
        C. Word-Form. Errors
        D, Preposition Errors
        E. Errors with Gerunds, Infinitives, and Simple Forms
        F. Errors with Pronouns
        G. Errors with Singular and Plural Nouns
        H. Errors with Comparative and Superlative Forms of Adjectives
        I. Errors with Articles
        J. Word-Order Errors
        K. Errors with Connecting Words
        L. Errors with Participial Adjectives

      7. Short Readings

        Format
        ------

        Part VII is the longest part of TOEIC. It's also the last part, so you may be starting to get tired. However, you need to stay focused on the test for a little longer. (Of course, if you want, you may work on part VII before you work on parts V and VI.)

        Part VII consists of short reading passages followed by questions about the passages. There are four possible answer choices for each question. You must pick the best answer choice based on the information in the passage and then mark that answer on your answer sheet.

        The Passages

        There are from twelve to fifteen passages. Most are quite short. Some consist of only three or four sentences; the longest have around 150 words. The passages deal with a wide variety of topics and involve many different types of written materials.

        There are from two to five questions per passage for a total of 40 questions. They include these three main types:

        1. Overview questions
        2. Detail questions
        3. Inference questions

        * Overview questions occur after most of the passages. To answer overview questions correctly, you need a "global" (overall) understanding of the passage. The most common overview question asks about the purpose or the main topic of the passage:

        What does this article mainly discuss?
        What is the purpose of this letter?
        Why was this notice written?

        Some ask about the best title or heading of a passage:

        What is the best heading for this announcement?
        Which of the fo/lowing is the best title for the article?

        Other overview questions ask about the writer of the passage, the readers of the passage, or the place of publication:

        In what business is the writer of the passage?
        What is the author's opinion of ____ ?
        Who would be most interested in the information in this announcement?
        For whom is this advertisement intended?
        Where was this article probably published?

        * Detail questions, the most common type of Part VII question, ask about specific points in the passage. You will usually have to scan the passage to find and identify the information. Sometimes the answer and the information in the passage do not look the same. For example, a sentence in a passage may read "This process is not as simple as it once was." The correct answer may be "The process is now more complex."

        Some detail questions are negative questions. These almost always include the word NOT, which is printed in uppercase (capital) letters:

        Based on the information in the passage, which of the following is NOT true?

        Negative questions usually take longer to answer than other detail questions.

        * A few questions in Part VII are inference questions. The answers to these questions are not directly stated in the passage. Instead, you must draw a conclusion about the information that is given. Some typical inference questions:

        Which of these statements is probably true?
        Which of the following can be inferred from this notice?

        Answer Choices

        All are believable answers to the questions. Incorrect choices often contain information that is presented somewhere in the passage but does not correctly answer the question.

        A Note About Vocabulary

        Most of the vocabulary in the passages consists of relatively common English words and phrases, but there will certainly be expressions that you do not know. However, you can understand most of a reading and answer most of the questions even if you don't know the meaning of all the words. Also, you can guess the meaning of many unfamiliar words in the passages through context. In other words, you can use the familiar words in the sentence in which an unfamiliar word appears to get an idea of what the unfamiliar word means.

        Tactics
        -------

        1. First, look at the passage quickly to get an idea of what it is about.

        2. Next, read the questions about the passage. You should not read the answer choices at this time. Try to keep these questions in the back of your mind as you read the passage.

        3. Read the passage. Try to read quickly, but read every word; don't just skim the passage. Look for answers to the questions that you read.

        4. Answer the questions. For detail and inference questions, you will probably have to refer back to the passage. Use the eraser-end of your pencil as a pointer to focus your attention as you look for the information needed to answer the question.

        5. If you are unsure of the answer, eliminate answer choices that are clearly wrong, and then guess.

        6. Don't spend too much time on any item. If you find a question or even an entire passage confusing, guess at the answer or answers and come back to these items later if you have time.

        7. If you have not answered all the questions and only a few minutes ere left, read the remaining questions without reading the passages, and choose the answers that seem most logical.

        * Types of Readings and Practice Exercises
        A. Articles
        B. Business Correspondence
        C. Advertisements
        D. Announcements
        E. Non-Prose Readings

     

  • 七条锦囊妙计助你获得托业考试高分

    2007-12-15 23:32:07

    妙计一:了解自身的优势和弱点,在自己欠缺的地方下功夫

    你可能已经很清楚自己的英语在哪方面还需要提高,或者你也可能想通过本书中的“试题预览”来判断一下自己英语方面的薄弱点。那么在开始学习之前做一做这些试题预览吧。 你是否觉得有一道或者几道题特别难?如果有,那么就把更多的时间和精力投入到对本书中与之相应的部分的学习中去吧。

    妙计二:抓紧时间备考

    参加一个诸如托业这样重要的考试,就如同面对你生命中的一次挑战。你得进行大量的训练准备考试,而且必须是系统的训练。

    在开始复习备考之前,准备一份时间表,计划好每个小时的学习内容。如果你每天或者每周有 3 、 4 天都如此细致地制订复习计划,你的学习效率会比仅有个笼统的计划高得多。按照你制订的这个计划学习一周后,再根据需要把它适当地修改一下,然后就尽量遵照这个计划进行复习,要一直坚持到考试前的几天。到了这个时候,再复习时你的考试成绩也不会有多少影响了,此时你该做的最好就是去放松放松。

    可能的话,专门为备考托业安排一段时间,在这段时间里不做其他的功课,也不要被其他事情占用,只是专心复习备考托业。

    采用“ 30 — 5 — 5 ”法学习:

    ●首先,学习 30 分钟。

    ●休息 5 分钟。离开课桌,做点别的事情。

    ●回来以后,花 5 分钟复习一下刚才那30分钟里学的东西,再预习一下将要学习的东西。

    定期与其他准备参加托业考试的人交流交流也很好。研究表明,这种“学习小组”的学习效果非常好。

    妙计三:熟悉托业考试的题型和各部分的考试要求

    如果你的头脑中有一张清晰的托业考试的“地图”,考试那天就不会手忙脚乱了,你就会知道现在做到哪里了,接下来会是什么题。

    通常来说,各部分的考试要求,甚至举的例子都是一样的。如果你很熟悉这些要求,考试时就不必再看了,可以节省很多宝贵的考试时间。由于版权的原因,本书中的题目要求和正式考试中的略有不同,但也都差不多。假如你明白了本书中的要求,你也就能明白实际考试中的考试要求。

    妙计四:知道如何在答题纸上涂写答案

    考试时最让人恼火的事情之一,就是突然发现你正在做的试题的题号和答题纸上的题号错位了。你得返回去追根溯源,看你究竟是从哪道题开始写串了行,然后再从那道题开始把后面的答案依次改正过来。为避免此类问题的发生,你可以用考卷作记号。用考卷把答题纸上尚未作答的题目遮住,每做完一题就将试卷向下移动一行。

    多带几支2B铅笔,一块好用的橡皮,还有一个小铅笔刀。别用钢笔或签字笔涂写。涂答案时一定要把整个框涂满,不要随意乱涂。

    一定要把答案涂满,并且每题只涂选一个答案。如果要修改答案,一定要彻底擦干净。

    妙计五:管它是什么,猜!

    托业考试答错了不倒扣分,也就是说,如果你不知道该选哪个答案的话,就猜一个写上,千万不要空着不写。记住,即便你是瞎猜的,你猜对的几率也有 1/4 ( 25% )。(而在第二部分试题中,你答对的几率是 1/3 ,即 33.3% 。)

    如果你一点也不知道哪个答案是对的,则按照一般的猜题标准,建议你选择(C),这比漫无目的地瞎猜要好。

    妙计六:用排除法筛选出正确答案

    在妙计六中,你知道了在遇到不会做的题时就猜一个答案。然而,不到考试即将结束的最后时刻,最好还是不要盲目地去猜,相反,你还是应该尽量做出一个最佳的选择。这个时候,排除法就派上用场了,换句话说,找不出正确答案的时候,就把那些明显错误的和不太对头的选项排除掉;此时如果有多个选项无法排除,则再从这些剩余的备选答案中猜选一个。

    下面是一道典型的单项选择题:

    题干………………

    [A]备选答案

    [B]备选答案

    [C]备选答案

    [D]备选答案

    4个选项中当然只有 1 个是最佳选择,这个选项就是正确答案,另外 3 个就是错误选项,因为这些错误选项都是误导你的。

    题干………………

    [A]错误选项

    [B]错误选项

    [C]正确答案

    [D]错误选项

    然而,并不是所有的错误选项的错误都那么明显,有一两个选项一眼就能看出是错的,而另外一个就不那么好分辨了,它很接近正确答案。大多数人错就错在这个选项上,它就是主错误选项。

    题干………………

    [A]主错误选项

    [B]错误选项

    [C]正确答案

    [D]错误选项

    即使你只能从 4 个选项中排除掉 1 个,你也将猜对的几率从 1/4 ( 25% )提高到了 1/3 ( 33.3% ),而如果你能排除掉两个的话,你答对的几率就会非常高了——达到 1/2 ( 50% )。

    排除掉一两个选项之后还是无法确定该选哪一个怎么办?这时候,如果你的“预感”(一种本能的感觉)告诉你其中一个选项更好一些,那就选这个好了。如果没有任何预感,那你就选那个“标准选项”;而如果你的“标准选项”已经被排除掉了,那就干脆随便选一个,然后继续做下面的题。

    我们从第五部分题中找一个例子来具体看一下排除法在实际当中的运用:

    I'm eager ____ the new member Of the product development team.

    [A]meeting

    [B]will meet

    [C]to meet

    [D]met

    你可能首先会排除掉选项 B 和 D ,因为在这两个选项中, meet 作动词,而句中已经有了一个动词 am 。而且,选项D表达的是过去的时态。那么现在要在 A 和 C 中作选择就有点难度了, A 选项 meeting 是动名词, C 选项 to meet 是动词不定式。但即便如此,你仍有可能根据所学过的语法知识作出正确的判断。而且从语感上来讲,其中一个答案放在句中读起来感觉更顺畅。

    如果你选的是 C ,答对了!不过并不是所有的托业考试题都是这个模式,甚至想排除掉一个错误选项都很难。但对于应试者来说,排除法仍不失为一个有效的答题工具。

    妙计七:学会控制考试时的情绪

    考试前感到紧张焦虑是很正常的。像托业这样的标准化考试通常都会在一定程度上对你未来的规划产生影响。假如你去参加一个运动会或者作一个重要的商务演讲,你也会感到紧张。英语里有这么一个说法很形象地描述了这种感觉:“ butterflies in your stomach”(紧张得感到恶心)。不过一旦考试开始,这种紧张的感觉也就消失了。有一点紧张对你也是有好处的,它能使你的注意力更加集中。但是过度的紧张就会使你发挥失常,犯低级错误。

    考试之前自我减压的方法之一是提前到考场。如果你是急急忙忙地赶到或者干脆就迟到了,考试时就会非常紧张。

    如果你在做第二节(阅读)时感到很紧张,那就停下来稍微休息一会——“给自己放 15 秒钟假”。靠在椅背上,闭上眼,做几次深呼吸,尽量放松——然后继续答题。(进行听力考试的时候可千万不要使用这个技巧——否则好多题目就会错过听不到了!)

    总之,消除考试焦虑的最佳办法,就是要以一个积极、自信的心态去面对考试。当你熟悉了整个考试,熟练地掌握了考试技巧,完整地做过一套真题之后,你的这种心态就会逐渐地建立起来了。

  • 什么是开放基金和封闭基金

    2007-12-15 23:27:48

    开放式基金的基金单位的总数不固定,可根据发展要求追加发行,而投资者也可以赎回,赎回价格等于现期净资产价值扣除手续费。

    由于投资者可以自由地加入或退出这种开放式投资基金,而且对投资者人数也没有限制,所以又将这类基金称为共同基金。大多数的投资基金都属于开放式的。

    封闭式基金发行总额有限制,一旦完成发行计划,就不再追加发行。投资者也不可以进行赎回,但基金单位可以在证券交易所或者柜台市场公开转让,其转让价格由市场供求决定。

    两者的区别如下:

    1、基金规模的可变性不同。

    2、基金单位的交易价格不同。开放式基金的基金单位的买卖价格是以基金单位对应的资产净值为基础,不会出现折价现象。封闭式基金单位的价格更多地会受到市场供求关系的影响,价格波动较大。

    3、基金单位的买卖途径不同。开放式基金的投资者可随时直接向基金管理公司购买或赎回基金,手续费较低。封闭式基金的买卖类似于股票交易,可在证券市场买卖,需要缴手续费和证券交易税。一般而言,费用高于开放式基金。

    4、投资策略不同。开放式基金必须保留一部分基金,以便应付投资者随时赎回,进行长期投资会受到一定限制。而封闭式基金不可赎回,无须提取准备金,能够充分运用资金,进行长期投资,取得长期经营绩效。

    5、所要求的市场条件不同。开放式基金的灵活性较大,资金规模伸缩比较容易,所以适用于开放程度较高、规模较大的金融市场;而封闭式基金正好相反,适用于金融制度尚不完善、开放程度较低且规模较小的金融市场。
  • 后台报SQL Error: 1064, SQLState: 42000错误

    2007-12-15 23:15:10

     今天在调试程序中发现类似下面这种错误
    - SQL Error: 1064, SQLState: 42000- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'REQUIRE, PLAN_DATE, COMPILE, AUDITOR, AGREE_PERSON, AGREE_DATE, ADD_BY, MOD_BY, ' at line 1- Could not synchronize database state with sessionorg.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update

    所以要注意,在定义字段时,不要和MYSQL的保留字段有相同的。


    MySQL的保留字有以下这些,使用中需要注意。

    ADD ALL ALTER
    ANALYZE AND AS
    ASC ASENSITIVE BEFORE
    BETWEEN BIGINT BINARY
    BLOB BOTH BY
    CALL CASCADE CASE
    CHANGE CHAR CHARACTER
    CHECK COLLATE COLUMN
    CONDITION CONNECTION CONSTRAINT
    CONTINUE CONVERT CREATE
    CROSS CURRENT_DATE CURRENT_TIME
    CURRENT_TIMESTAMP CURRENT_USER CURSOR
    DATABASE DATABASES DAY_HOUR
    DAY_MICROSECOND DAY_MINUTE DAY_SECOND
    DEC DECIMAL DECLARE
    DEFAULT DELAYED DELETE
    DESC DESCRIBE DETERMINISTIC
    DISTINCT DISTINCTROW DIV
    DOUBLE DROP DUAL
    EACH ELSE ELSEIF
    ENCLOSED ESCAPED EXISTS
    EXIT EXPLAIN FALSE
    FETCH FLOAT FLOAT4
    FLOAT8 FOR FORCE
    FOREIGN FROM FULLTEXT
    GOTO GRANT GROUP
    HAVING HIGH_PRIORITY HOUR_MICROSECOND
    HOUR_MINUTE HOUR_SECOND IF
    IGNORE IN INDEX
    INFILE INNER INOUT
    INSENSITIVE INSERT INT
    INT1 INT2 INT3
    INT4 INT8 INTEGER
    INTERVAL INTO IS
    ITERATE JOIN KEY
    KEYS KILL LABEL
    LEADING LEAVE LEFT
    LIKE LIMIT LINEAR
    LINES LOAD LOCALTIME
    LOCALTIMESTAMP LOCK LONG
    LONGBLOB LONGTEXT LOOP
    LOW_PRIORITY MATCH MEDIUMBLOB
    MEDIUMINT MEDIUMTEXT MIDDLEINT
    MINUTE_MICROSECOND MINUTE_SECOND MOD
    MODIFIES NATURAL NOT
    NO_WRITE_TO_BINLOG NULL NUMERIC
    ON OPTIMIZE OPTION
    OPTIONALLY OR ORDER
    OUT OUTER OUTFILE
    PRECISION PRIMARY PROCEDURE
    PURGE RAID0 RANGE
    READ READS REAL
    REFERENCES REGEXP RELEASE
    RENAME REPEAT REPLACE
    REQUIRE RESTRICT RETURN
    REVOKE RIGHT RLIKE
    SCHEMA SCHEMAS SECOND_MICROSECOND
    SELECT SENSITIVE SEPARATOR
    SET SHOW SMALLINT
    SPATIAL SPECIFIC SQL
    SQLEXCEPTION SQLSTATE SQLWARNING
    SQL_BIG_RESULT SQL_CALC_FOUND_ROWS SQL_SMALL_RESULT
    SSL STARTING STRAIGHT_JOIN
    TABLE TERMINATED THEN
    TINYBLOB TINYINT TINYTEXT
    TO TRAILING TRIGGER
    TRUE UNDO UNION
    UNIQUE UNLOCK UNSIGNED
    UPDATE USAGE USE
    USING UTC_DATE UTC_TIME
    UTC_TIMESTAMP VALUES VARBINARY
    VARCHAR VARCHARACTER VARYING
    WHEN WHERE WHILE
    WITH WRITE X509
    XOR YEAR_MONTH ZEROFILL

  • eclipse中VI插件的安装,转码properties

    2007-11-21 17:41:18

         和大家分享一个不错的编写properties文件的Eclipse插件(plugin),有了它我们在编辑一些简体中文、繁体中文等Unicode文本时,就不必再使用native2ascii编码了。您可以通过Eclipse中的软件升级(Software Update)安装此插件,步骤如下:


    1、展开Eclipse的Help菜单,将鼠标移到Software Update子项,在出现的子菜单中点击Find and Install;
    2、在Install/Update对话框中选择Search for new features to install,点击Next;
    3、在Install对话框中点击New Remote Site;
    4、在New Update Site对话框的Name填入“PropEdit”或其它任意非空字符串,在URL中填入http://propedit.sourceforge.jp/eclipse/updates/;
    5、在Site to include to search列表中,除上一步加入的site外的其它选项去掉,点击Finsih;
    6、在弹出的Updates对话框中的Select the features to install列表中将所有结尾为“3.1.x”的选项去掉(适用于Eclipse 3.2版本的朋友);
    7、点击Finish关闭对话框;
    8、在下载后,同意安装,再按提示重启Eclipse,在工具条看到形似vi的按钮表示安装成功,插件可用。此时,Eclpise中所有properties文件的文件名前有绿色的P的图标作为标识。

  • 正交试验设计法

    2007-09-05 14:14:13

      我们在设计用例的时候,解析需求各功能点时,常常依据是每个功能点的不同输入条件会遍历出N多个用例,使我们的测试工作量之巨大;在测试的过程中感觉有的用例好像不需要再执行了,因为前一个用例感觉已经把它覆盖到了;但又好像不是很牢,应该再执行一下这个用例的。在这种左右为难的情况下,感觉通过正交试验设计法来设计这种用例会让我们的工作做起来比较轻松,而且质量方面也得到很好的保障。
      正交试验设计法,是通过所遍历出的用例做分析,根据公式或经验挑出覆盖面比较全的用例,过滤掉一些不必要的用例,也减轻我们的工作量,定位测试重点。此方法的详细介绍见下……

    ===============================

    OATS:即Orthogonal Array Testing Strategy,正交表测试策略。

     

    1      OATS的概念:

    次数(Runs):简单的说,就是次数是多少,就有多少个用例。

    因素数(Factors):简单的说,就是有多少个变量。

    水平数(Levels):比如有三个变量,其中变量取值最多的是四个值,那么水平数就是四。

    强度(Strength):即变量间的相互关系,当强度为二时,只考虑变量两两之间的影响,如果强度为三,同考虑三个变量对结果的影响;当强度增加时,用例的个数会急剧增加。

     

    正交表的表现形式: L runslevels^factors 

     

     Runs=factors*(levels-1)+1

    介绍混合水平数正交表的知识,混合水平数的正交表中的因素数的水平数是不同的,比如,有5个变量,一个因素数的水平数为4,另外四个因素数的水平数为2,则用正交表表示如下:

    L 841×24

     

    2       OATS的好处:

    对有些组合测试,我们可选择的一种测试途径是测试所有变量的迪卡尔积(即统计学中的全面搭配法),无疑,这种方式得到的是所有变量、所有取值的完全组合,是最全面的测试。而在变量多的情况下,这无疑也是最不可能实现的方法,所以我们要选择一种方法,即可以测试大部分的BUG,又能极大的缩短我们的时间,正交表是我们的选择:

     

    其特点为:

         完成测试要求所需测试用例少。

         数据点的分布很均匀。

         可用其他统计学的方法等对测试结果进行分析。

     

    OATS用来设计测试用例的方法如下的好处:

    1,可以组合所有的变量;

    2,得到一个最小的测试集,这个集合,包括最少的测试用例,并且,包括了所有变量的组合,

    3,得到的变量的组合是均匀的分布的(这一点可以参照上面的正交表的特点);

    4,可以测试用一些复杂的组合;

    5,它生成的测试用例是有迹可循日,即有规律的,不像手工测试那样会遗漏一些用例的组合。

    3       选择OATS的基本原则

    一般都是先确定测试的因素、水平和交互作用,后选择适用的正交表。在确定因素的水平数时,主要因素应该多安排几个水平,次要因素可少安排几个水平。

        1)先看水平数。若各因素全是2水平,就选用L(2)表;若各因素全是3水平,就选L(3)表。若各因素的水平数不相同,就选择适用的混合水平正交表。

        2)每一个交互作用在正交表中应占一列或二列。要看所选的正交表是否足够大,能否容纳得下所考虑的因素和交互作用。为了对试验结果进行方差分析或回归分析,还必须至少留一个空白列,作为“误差”列,在极差分析中要作为“其他因素”列处理。

        3)要看测试精度的要求。若要求高,则宜取测试次数多的正交表。

        4)若测试费用很昂贵,或测试的经费很有限,或人力和时间都比较紧张,则不宜选实验次数太多的正交表。

        5)按原来考虑的因素、水平和交互作用去选择正交表,若无正好适用的正交表可选,简便且可行的办法是适当修改原定的水平数。

    6)对某因素或某交互作用的影响是否确实存在没有把握的情况下,选择L表时常为该选大表还是选小表而犹豫。若条件许可,应尽量选用大表,让影响存在的可能性较大的因素和交互作用各占适当的列。

     

    4       OATS的步骤:

    1,先要知道你有多少个变量,这个不用说了,很简单的就能确定了。它对应到正交表的概念中的因素数。

    2,查看每个变量的测试取值个数(这里我用a代替,以方便后面调用),这个取值不是说这个变量的取值范围中包括多少个值,而是用等价类划分出来的。关于等价类的方法,这里就不说了。

    3,选择正交表,我们选择正交表时,要满足两点:因素数(即变量个数)和水平数。在选择正交表的时候,要保存:

    A、正交表的列不能小于变量的个数;

    B、正交表的水平数不能小于a

    4,拿着自己的因素数和水平数,去找对应的正交表,按3中说的原则,现在正交表有一部分已经在网上公布了,在很大程度上已经够设计测试用例用了,如果你的情况太特殊,也可以考虑自己去推算。

    5,如果你选择的正交表中某个因素数有剩余的水平数,就拿这个因素数的值从上到下循环代进去。以增加发现缺陷的机会。

    6,按次数设计用例,每次数对应一个用例。设计完成后,如果觉得有些组合是可能会有问题的,而正交表中又没有包括,那就增加一些用例。

     

    5       OATS的实例:

    5.1    实例

    下面介绍一个混合正交表的例子:

    变量个数:4个  分别为:ABCD

    取值为:

    A->3个值(A1A2A3)、

    B->4个值(B1B2B3B4)、

    C->4个值(C1C2C3C4)、

    D->4个值(D1D2D3D4)。

    把上述数值对应到正交表的概念中去,如下:

    因素数:4

    水平数:其中3个变量的水平数为41个变量的水平数为3

    对应到正交表中写法如下:

    L runs3^1 4^3

    1  只考虑强度为:2的情况。

    A 其对应的正交表如下:

    Runs    A   B  C   D

     1  |    1   1   1   1

       2  |    2   2   2   2

       3  |    3   3   3   3

       4  |    -   4   4   4

       5  |    1   2   3   4

       6  |    2   1   4   3

       7  |    3   4   1   2

       8  |    -   3   2   1

       9  |    1   3   4   2

      10  |    2   4   3   1

      11  |    3   1   2   4

      12  |    -   2   1   3

      13  |    1   4   2   3

      14  |    2   3   1   4

      15  |    3   2   4   1

      16  |    -   1   3   2

     

    即应用到次数为16的正交表,我们可以得到16个用例。

     

    B、把各个变量的代入正交表得到如下正交表:

    Runs   A    B   C    D

     1  |    A1   B1   C1   D1

       2  |    A2   B2   C2   D2

  • 等价划分法

    2007-09-05 14:07:51

    等价类的定义:


    等价类:是指某个输入域的子集合。在该子集合中,各个输入数据对于揭露程序中的错误都是等效的
    有效等价类:符合《需求规格说明书》,合理的输入数据集合
    无效等价类:不符合《需求规格说明书》,无意义的输入数据集合


    等价类划分的步骤:
    1.先考虑输入数据的数据类型(合法类型和非法类型)
    2.再考虑数据范围(合法类型中的合法区间和非法区间)
    3.画出示意图,区分等价类
    4.为每一个等价类进行编号
    5.从一个等价类中选举一个测试数据构造测试用例


    常用的等价类划分方法:
    (1)如果规定了输入值的范围(闭区间),可以分为一个有效等价类,两个无效的等价类;
    如:1<x<100,则有效等价类为“1<x<100”,无效等价类则为输入范围两边的值
    (2)如果输入是布尔表达式,可以分为一个有效等价类和一个无效等价类
    如:要求密码非空,则有效等价类为非空密码,无效等价类为空密码
    (3)如果规定了输入数据的一组值,而且程序对不同输入值做不同的处理,则每个允许的输入值是一个有效的等价类,此外还有一个无效的等价类(任意一个不允许的输入值);
    (4)如果规定了输入数据必须遵循的规则,可以划分出一个有效的等价类(符合规则)和若干个无效的等价类(从不同角度违反规则);
    理论上来说,如果等价类里面的一个数值能够发现缺陷,那么该等价类里面的其他数值也能够发现该缺陷。但是在实际测试过程中,由于测试人员的能力和经验所限,导致等价类的划分就是错误的,因而也得不到正确的结果。

Open Toolbar