51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 2928|回复: 1
打印 上一主题 下一主题

求助,如何编写测试计划

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2008-10-31 22:51:23 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
小弟正在学习软件测试, 现在老师有一道题目,对一个简单的java类做测试,要求写测试计划和测试用例数据,由于从来没有做过,我现在感觉无从下手,请各位前辈能够教教我。
如何编写测试计划。
谢谢
java类的代码如下:

public class Rect {
       public int x1, y1, x2, y2;
    public Rect(int x1, int y1, int x2, int y2) {
        this.x1 = x1;
        this.y1 = y1;
        this.x2 = x2;
        this.y2 = y2;
    }
    public Rect(int width, int height) { this(0, 0, width, height); }
    public Rect() { this(0, 0, 0, 0); }
    public void move(int deltax, int deltay) {
        x1 += deltax; x2 += deltax;
        y1 += deltay; y2 += deltay;
    }
    public boolean isInside(int x, int y) {
        return ((x >= x1)&& (x <= x2)&& (y >= y1)&& (y <= y2));
    }
    public Rect union(Rect r) {
        return new Rect((this.x1 < r.x1) ? this.x1 : r.x1,
                        (this.y1 < r.y1) ? this.y1 : r.y1,
                        (this.x2 > r.x2) ? this.x2 : r.x2,
                        (this.y2 > r.y2) ? this.y2 : r.y2);
    }
    public Rect intersection(Rect r) {
        Rect result =  new Rect((this.x1 > r.x1) ? this.x1 : r.x1,
                                (this.y1 > r.y1) ? this.y1 : r.y1,
                                (this.x2 < r.x2) ? this.x2 : r.x2,
                                (this.y2 < r.y2) ? this.y2 : r.y2);
        if (result.x1 > result.x2) { result.x1 = result.x2 = 0; }
        if (result.y1 > result.y2) { result.y1 = result.y2 = 0; }
        return result;
    }
    public String toString() {
        return "[" + x1 + "," + y1 + "; " + x2 + "," + y2 + "]";
    }
}



小弟在此先谢谢各位前辈了
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
发表于 2008-11-18 11:43:11 | 只看该作者
按照程序中的步骤,逐步调用,并验证判断条件的结果!
例如:
调用 Rect(3,2) ;
查询程序运行结果

初值可以考虑int类型边界值,特殊值(0)或部分负数值等进行
回复 支持 反对

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-9-27 07:20 , Processed in 0.071474 second(s), 28 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表