飞机订票系统测试与维护_飞机订票系统测试报告
飞机订票系统测试与维护由刀豆文库小编整理,希望给你工作、学习、生活带来方便,猜你可能喜欢“飞机订票系统测试报告”。
六.测试与维护.引言.1 编写目的在开发大型软件的漫长过程中,面对极其错综复杂的问题,人的主观认识不可能完全符合客观现实,与工程密切相关的各类人员之间的通信和配合也不可能完美无缺。因此,在软件生命周期的每个阶段都不可避免地会产生差错。尤其对于机票预订系统这类会影响人们生活.财产的工程软件,必须尽量减少差错,以免造成严重的损失。测试是“为了发现程序中的错误而执行程序的过程”。测试的目的就是在软件投入生产性运行之前,尽可能多的发现软件中的错误。目前软件测试仍然是保证软件质量的关键步骤,它是对软件规格说明.设计和编码的最后复审,也是必不可少的关键步骤。.任务概述.1
目标
测试是“为了发现程序中的错误而执行程序的过程”, 测试的目的就是在软件投入生产性运行之前,尽可能多的发现软件中的错误。.2
需求概述
航空公司为方便旅客,需开发一个机票预定系统。为便于旅客由旅行社代替航空公司负责为旅客定票,旅行社把预定机票的旅客信息,包括姓名、性别、工作单位、身份证号码、旅行时间、旅行目的地,输入机票预定系统的客户端程序,系统经过查询航空公司内的航班数据服务器后,为旅客安排航班,印出取票通知。旅客在飞机起飞前一天凭取票通知和帐单交款后取票,系统校对无误后即印出机票给旅客。
要求系统能有效、快速、安全、可靠和无误的完成上述操作。并要求客户机的界面要单明了,易于操作,服务器程序利于维护。2.3
条件与限制
必须在保证各硬件设备.软件系统齐备的情况下,资金充足,人员齐备,各方面互相配合,齐心协力,共同完成。.计划.1
测试方案
测试方案是测试阶段的关键技术问题。为了提高测试效率降低测试成本,本测
试方案采用黑盒法设计基本的测试方案,再用白盒法补充一些方案。在黑盒法测试
方案中,采用等价划分技术,把所有可能的输入数据(有效的和无效的)划分成几
等价类,其划分类在以下的输入中再详述。.2
测试准备
在测试前,与各模块的主要负责人共同协商讨论,以概要设计说明书.详细设
计说明书作为总的提纲,选择合适的输入输出数据,并加以意义列举说明。.程序清单
#include #include #include #include #define m 4
//3架飞机
#define n 5
//每架飞机5张票 struct node { char name[21];char id[21];int seat,plane,date;node *next,*pre;};struct wait { char name[21];char id[21];char phone[8];int seat,plane,date,count;wait *next,*pre;};struct piao { int seat[n+1];};void makenull();
void makenull_piao();void makenull_information();void list_menu();void list_piao();void makenull_wait();void list_information();void plane_information(node *head);void book();void add_information(node *head,int x,int y);void add_wait(int x,int y);void search_delete(int x);void write_to_file();void show_wait();bool comp(node *x,node*y);node *head1,*head2,*head3,*q;wait *wait_head,*wait_end;char c;piao a[m];void main(){ makenull();do { list_menu();
cout
请根据自己的需要进行选择:
cin>>c;
if(c!='6')
switch(c)
{
case '0' : show_wait();break;
case '1' : {list_piao();book();}break;
“;
case '2' : search_delete(1);break;
case '3' : list_piao();break;
case '4' : list_information();break;
case '5' : search_delete(0);break;
default : break;
} }while(c!='6');cout
cout
cout
菜
单
cout
* * * * * * * * * * * * * * * * * * * * * * * *”;cout
cout
*
0.查 看 排 队 情 况
cout
cout
*.订 票
cout
cout
*.退 票
cout
cout
*.查 看 剩 余 票
cout
cout
*.查 看 飞 机 信 息
cout
cout
*.查 看 乘 客 信 息
cout
cout
*.退 出
cout
cout
* * * * * * * * * * * * * * * * * * * * * * * *“;cout
fp=fopen(”piao.dat“,”w“);
”;“;*”;“;*”;“;*”;“;*”;“;*”;“;*”;“;*”;“;
for(i=1;i
fwrite(&a[i],sizeof(piao),1,fp);
fclose(fp);
fp=fopen(”piao.dat“,”r“);} for(i=1;i
fread(&a[i],sizeof(piao),1,fp);fclose(fp);} void makenull_information(){ node *r;FILE *fp;int i,j,sum;sum=a[1].seat[0]+a[2].seat[0]+a[3].seat[0];fp=fopen(”information.dat“,”r“);head1=new node;head2=new node;head3=new node;head1->pre=NULL;head1->next=NULL;head2->pre=NULL;head2->next=NULL;head3->pre=NULL;head3->next=NULL;q=head1;for(i=1;i
j=0;
r=new node;
fread(r,sizeof(node),1,fp);
q->next=r;
r->pre=q;
r->next=NULL;
q=q->next;
fclose(fp);
if(i==a[1].seat[0]+1){
head2->next=q;
q->pre->next=NULL;
q->pre=head2;
}
if(i==a[1].seat[0]+a[2].seat[0]+1){
head3->next=q;
q->pre->next=NULL;
q->pre=head3;
} } } void makenull_wait(){ wait *tempw;FILE *fp;tempw=new wait;int i;if((fp=fopen(”wait.txt“,”r“))==NULL){
fp=fopen(”wait.txt“,”w“);
fclose(fp);}
wait_end=new wait;wait_head=new wait;wait_end->next=NULL;wait_end->pre=NULL;wait_head=wait_end;wait_head->count=0;fp=fopen(”wait.txt“,”r“);fread(wait_head,sizeof(wait),1,fp);
for(i=1;icount;i++)
{
fread(tempw,sizeof(wait),1,fp);
wait_end->next=tempw;
tempw->pre=wait_end;
tempw->next=NULL;
wait_end=tempw;
} } void list_piao(){ int i,j;for(i=1;i
if(a[i].seat[0]!=n)
{
cout
for(j=1;j
if(a[i].seat[j]==0)cout
cout
}
else cout>x;cout=m);cout
”next!=NULL)
q=head->next;else {
q=NULL;
cout
{
cout
q->date=q->plane;
coutdate
coutseat
coutname;
coutid;
q=q->next;x++;
if(x % 3 ==0)ch=getch();} cout
1、2、3)“;do {
cin>>i;
if(i=m){
cout
}
else
{cout
cout
for(p=1;p
if(a[i].seat[p]==0)cout
cout
break;} }while(1);cout
cin>>j;
if(jn){
cout
}
else
{
q->date=i;
coutdate
break;
} }while(1);if(a[i].seat[j]==0){
a[i].seat[j]=1;
cout
a[i].seat[0]++;
if(i==1)add_information(head1,1,j);
if(i==2)add_information(head2,2,j);
if(i==3)add_information(head3,3,j);} else {
cout
add_wait(i,j);} } void add_wait(int x,int y){ wait *tempw;tempw=new wait;tempw->next=NULL;
cout
cout>tempw->name;
cout>tempw->id;cout>tempw->phone;tempw->seat=y;tempw->plane=x;wait_end->next=tempw;tempw->pre=wait_end;wait_end=wait_end->next;coutcount++;write_to_file();} void show_wait(){ wait *tempw;tempw=wait_head->next;if(tempw==NULL)coutnamenext;} } void add_information(node *head,int x,int y){ node *temp;temp=new node;temp->pre=NULL;temp->next=NULL;
cout
cout>temp->name;
cout>temp->id;temp->seat=y;temp->plane=x;temp->next=head->next;temp->pre=head;if(head->next!=NULL)head->next->pre=temp;head->next=temp;write_to_file();cout>p->name;do{
q=q->next;
if((q!=NULL)&&
(comp(q,p)))
{
cout
q->date=q->plane;
cout
cout
coutname;
coutid;
coutseat;
coutplane;
coutdate
if(x==1){
cout
cin>>ch;
if(ch=='Y' || ch=='y'){
t1=q->plane;
t2=q->seat;
a[t1].seat[t2]=0;
a[t1].seat[0]--;
r=q;q=q->pre;
r->pre->next=r->next;
if(r->next!=NULL)r->next->pre=r->pre;
delete(r);
cout
write_to_file();
tempw=wait_head;
for(i=0;icount;i++)
{
tempw=tempw->next;
if(tempw==NULL)break;
if((tempw->plane==t1)&&(tempw->seat==t2))
{
strcpy(tempw3->name,tempw->name);
strcpy(tempw3->phone,tempw->phone);
cout
coutname;
coutid
a[t1].seat[0]++;
a[t1].seat[t2]=1;
if(tempw->plane==1)add_information(head1,1,tempw->seat);
if(tempw->plane==2)add_information(head2,2,tempw->seat);
if(tempw->plane==3)add_information(head3,3,tempw->seat);
tempw2=tempw->pre;
tempw2->next=tempw->next;
if(tempw->next==NULL)wait_end=tempw2;
else tempw->next->pre=tempw2;
delete(tempw);
wait_head->count--;
write_to_file();
coutnamephone
break;
}
}
}
}continue;
}
else
{
if(q==NULL)
{
step++;
if(step==2)q=head2;
if(step==3)q=head3;
if(step==4){cout
}
} }while(1);} bool comp(node *x,node *y){ node *p,*q;int i,j,k;p=x;q=y;i=j=0;do {
while((p->name[i]!= q->name[j])&&(p->name[i]!= ' '))i++;
if(p->name[i] == ' '){return(false);break;}
else
{
k=i;
while((p->name[k] == q->name[j])&&(q->name[j]!=' ')){k++;j++;}
if(q->name[j]==' ')return(true);
else
{
j=0;
i++;
}
} }while((q->name[j]!=' ')&&(p->name[i]!= ' '));return(false);} void write_to_file(){ FILE *fp;int i,j;int x[m];node *p;wait *tempw;tempw=new wait;tempw=wait_head;fp=fopen(”piao.dat“,”w“);for(i=1;i
fwrite(&a[i],sizeof(piao),1,fp);} fclose(fp);
fp=fopen(”information.dat“,”w“);x[0]=0;x[1]=a[1].seat[0];for(i=0,j=1;jnext;for(j=1;j
if(j==x[1]+1)p=head2->next;
if(j==x[2]+1)p=head3->next;
if(p==NULL)break;
fwrite(p,sizeof(node),1,fp);
p=p->next;} fclose(fp);
fp=fopen(”wait.txt“,”w");for(j=0;jcount;j++){
if(tempw==NULL)break;
fwrite(tempw,sizeof(wait),1,fp);
tempw=tempw->next;} fclose(fp);}