软件测试参数化实验报告,软件测试技术实验报告.doc

《软件测试技术》

实验报告

河北工业大学计算机科学与软件学院

2017年9月

软件说明

电话号码问题

某城市电话号码由三部分组成。它们的名称和内容分别是:

地区码:空白或三位数字;

前 缀:非'0'或'1'的三位数字;

后 缀:4位数字。

流程图

源代码 import java.awt.*; import java.awt.event.*;

public class PhoneNumber extends Frame implements ActionListener{

/** *

*/ private static final long serialVersionUID = 1L;

private final String[] st = {Name,Local,Prefix,Suffix};

static int c_person=0;

TextField t_name,t_local,t_prefix,t_suffix;

RecordDialog d_record;

MessageDialog d_message;

person a[]=new person[100];

public PhoneNumber()

{

畳数?电话号码 );

this.setSize(250,250);

this.setLocation(300,240);

Panel panel1 = new Panel(new GridLayout(4, 1));

for (int i = 0; i < st.length; i++)

panel1.add(new Label(st[i],0));

Panel panel2 = new Panel(new GridLayout(4, 1));

t_name =new TextField(\,20);

t_local =new TextField(\);

t_prefix=new TextField(\);

t_suffix=new TextField(\);

panel2.add(t_name);

panel2.add(t_local);

panel2.add(t_prefix);

panel2.add(t_suffix);

Panel panel3 = new Panel(new FlowLayout());

Button b_save = new Button(Save);

Button b_record= new Button(Record);

panel3.add(b_save);

panel3.add(b_record);

this.setLayout(new BorderLayout());

this.add(West, panel1);

this.add(East, panel2);

this.add(South, panel3);

addWindowListener(new WindowCloser());

b_save.addActionListener(this);

b_record.addActionListener(this);

d_record=new RecordDialog(this);

d_message=new MessageDialog(this);

this.setVisible(true);

}

private class RecordDialog extends Dialog{

private static final long serialVersionUID = 1L;

Frame frame; //对话框所依赖的框架窗口

TextArea t_show;

RecordDialog(Frame frame){

畳数?牦浡?记录,true);

this.frame=frame;

this.setSize(300, 80);

t_show=new TextArea(20,20);

this.add(t_s

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值