[Introduction to Soft Engineering ③] Experimental Report Three (Requirement Analysis and Modeling, Overall Structure Design, Detailed Design, Testing) of Air Ticket Reservation System

[Introduction to Soft Engineering ③] Experimental Report II (requirements analysis and modeling, overall structure design, detailed design, and testing of the subsystems of the educational administration management system)

Experiment 1 Requirements Analysis of Air Ticket Reservation System

1. Purpose and tasks

Purpose: To determine what the project will do and its practicability, and on this basis to complete the establishment of the logical function model of the system.

Task: Different requirements analysis techniques can be used to complete the requirements analysis process of the project, and the logical function model, data dictionary and specifications of the system are given.

2. Content and requirements

1. Experiment content and requirements:

Familiar with the business process of the system project, draw the system data flow diagram, function analysis diagram, write the data dictionary, data processing description and software system flow diagram (new system model) according to the existing information, and complete the system requirement specification.

2. Prepare reference materials and read relevant national standard documents on software development.

3. Main instruments and equipment

laptop

4. Experimental records

1. Data flow diagram:

A data flow diagram is a tool for representing a logical model of a system. It clearly describes the flow and processing of system data with intuitive graphics.

 

 

 

                                                              

                         

2. Function analysis diagram:

3. System flow chart:

Figure 1

Figure II

Requirements Specification

1 Introduction:

.Writing purpose: To establish a clear and easy-to-understand analysis diagram for users, to facilitate users to participate in the discussion of the exact requirements of the required system, and to lay the foundation for the maintenance of the later software after delivery.

Project background: a: Develop a flight ticket reservation system.

b: It is convenient for airlines to adjust flights, and for passengers and travel agencies to book tickets by themselves.

c: Passengers submit personal information to travel agencies, and travel agencies provide passenger information to airlines to book tickets.

Reference materials: "Software Engineering" written by Cui Donghua, Li Aiping, and Li Dongsheng and related reference materials on the Internet.

2. Task overview:

Objective: To improve the current air ticket reservation system so that it can keep up with the development of the times. At the same time improve their hands-on ability.

3. Data description:

Data elements in the system:

traveler

Air tickets

-Name

-gender

-employer

- ID number (passport number)

-travel time

- Origin of travel

-travel destination

-Flight Class Requirements

-price

-time

-passenger

-Navigation class

-origin

-destination

-flight information

travel agency

airline

- Travel agency name

-Submit Information

-Contact information

-Submit the deposit amount

- Airline name

-flight information

-Contact information

-accept

 Data Dictionary:

数据字典是用来规范描述数据具体内容的工具,也是对数据汇总分析的一个总结。一般来说,可为每个数据建立一张二维表。在本系统中,分别为旅客信息、旅客订票信息、候补旅客信息、航班机票信息、取票通知和售出机票信息建立了数据字典,具体如下表所示。

  旅客信息的数据字典

数据名称

旅客信息

作用

记录旅客的个人信息,用于对旅客的确认

来源

客户

去向

旅行社管理

排列方式

按照客户的姓名升序排序

包含信息

姓名、性别、工作单位、身份证号码、旅行时间、旅行目的地

 旅客订票信息的数据字典

数据名称

旅客订票信息

作用

记录旅客的旅行时间和目的地,用于确定旅客的航班

来源

客户

去向

航班机票管理

排列方式

按照客户的(姓名+起飞时间)升序排序

包含信息

客户姓名、身份证号、航班号、起飞时间、预订票数、舱位等级、机票是否打印

 候补旅客信息的数据字典

数据名称

候补旅客信息

作用

记录旅客的旅行时间和目的地,便于及时调整航班

来源

航班机票管理

去向

信息存储/航班机票管理

排列方式

按照(姓名+起飞时间)升序排序

包含信息

客户姓名、身份证号、航班号、起飞时间、预订票数、舱位等级

航班机票信息的数据字典

数据名称

航班机票信息

作用

记录旅客的航班信息,根据旅客的旅行时间和目的地确定

来源

航空公司安排航班

去向

信息存储/航班机票管理

排列方式

按(飞行日期+航班号)升序排列

包含信息

航班号、终点站名、起飞地点、飞行日期、周几、成员定额、余票量、已订票的客户名单(包括姓名、订票量、舱位等级1,2或3)、等候替补的客户名单(包括姓名、所需票量)

取票通知的数据字典

数据名称

取票通知

作用

旅客领取机票的凭证

来源

航班机票管理系统

去向

客户

排列方式

按(姓名+飞行日期+航班号)升序排列

包含信息

旅客姓名、领票时间

售出机票信息的数据字典

数据名称

售出机票信息

作用

记录旅客的航班机票的信息

来源

航班机票管理系统

去向

信息存储/航班机票管理

排列方式

按(姓名+飞行日期+航班号)升序排列

包含信息

旅客的航班机票

/4.功能需求:(1).旅客信息的输入和统计,旅行社把旅客要求订票的信息有专人输入.

            (2).旅客信息的存储.

            (3).机票信息的传递与接收

            (4).取票通知及账单的生成与打印

5.性能需求:

数据精确度:

旅客:

         姓名 String

          性别 String

                工作单位  String

                身份证号(护照号码) String

                旅行时间  Date

                旅行始发地  String

                旅行目的地  String

                班舱位要求  String                                                  

机票:

                价格  int

                时间  Date

                乘机人  String

                舱位等级  int

                始发地  String

                目的地  String

                航班信息  String

   旅行社:

                旅行社名称  String

                提交信息  String

                联系方式  String

                提交定金数 int

    航空公司:

                航空公司名称  String

                航班信息  String

                联系方式  String

                接受定金数  int

时间特性:要求动作响应,更新处理,数据转换,数据传输以及运行能在有限时间内完成。

适应性:要求该软件系统在操作方式,运行环境,软件接口以及开发计划等在发生变化时具有一定的适应能力。

6.运行需求:

该软件系统用于人工操作实现机票的计算和管理,所以要求拥有良好的人机交互界面和友好的指示性和帮助性。能在一定程度上由机器自行解决机器或软件故障或进行指引性的解决。

7.其他需求:要求该软件拥有良好的使用性,安全性,可维护性和可移植性。

五、讨论、心得

需求分析通常使用功能分解法,结构化分析方法,信息建模方法,面向对象方法等实现对用户需求的分析。在结构化分析方法中,大多使用数据流图,数据字典和结构化语言,判定表,判定树等加工逻辑的结构化语言进行描述。

一个好的需求分析必须明白使用者所需要的是什么,这个就需要运用清晰的逻辑设计数据流图,数据字典以及加工逻辑的描述。

实验二  机票预订系统的总体设计

  • 目的与任务

目的:在实验三基础上完成系统的体系结构的建立和系统详细设计,并给出相应的系统设计说明书。

任务:认真分析实验三的结果,给出系统合理的体系结构,描绘系统结构图,并合理划分系统的各组成模块,最后给出系统的各部分设计说明书。

二、内容和要求

(1)用面向数据流的设计方法(教材P48-P52)从需求分析的数据流图导出系统结构图,并进行优化,画出系统的软件结构图。

(2)选择一个模块进行输入输出界面设计,输出设计主要指打印输出,输入设计主要指数据录入界面的表单设计。

(3)可以选择ACCESS,SQL SERVER等任何一种数据库进行存储文件格式设计(数据库结构设计)。三、主要仪器设备

笔记本电脑

四、实验记录

总体设计说明书

1引言:

编写目的:软件结构的设计是以模块为基础,以需求分析阶段得到的数据流图为依据来设计软件结构的。分析人员从供选方案中选择最优方案进行设计。对于复杂的大型系统,则先进行功能分解。对于需要使用数据库的应用领域,要进行数据库的设计。

项目背景:由软件设计公司的需求分析人员向软件设计人员提供用户需求分析报告,并由设计人员根据此逻辑系统得出相应的软件结构图。

参考资料:由崔冬华,李爱萍,李东生编写的《软件工程》及网上相关参考资料。

2.任务概述:

目标:实现飞机票查询及订票功能。

需求概述:用户可通过网上查询信息并订票。

条件及限制:若由于天气等原因使得航班推迟或延误,可进行重选或继续乘坐。

3.总体设计:

处理流程图:

软件系统结构图:

4.接口设计:

外部接口:主要具备友好的人机交互,安全的软、硬件接口。

内部接口:要求具有相对的独立性的数据传送的清晰性。

5.数据结构设计

6.运行设计:要求对初步设计后的软件模块进行优化,并保证每一个模块可以在有限条指令和有限时间内准确完成相应的功能。

7.出错处理设计:当软件系统或软件所依赖的硬件系统以及运行环境出现故障时,系统能及时报错,并做出相应的处理。

8.安全保密设计

9.维护设计:该软件系统除了需要完成功能模块的设计外,还需要设计维护模块,方便日后维护工作的实施。

五、讨论、心得

总体设计阶段的目标是概括的回答系统应该如何实现。在确定系统中的每个程序有哪些模块构成的同时,还需要了解每个模块和接口之间的关系,各个模块的功能以及调用关系等。在这个过程中必须严格遵循软件模块设计准则。

实验三 机票预订系统的详细设计

一、目的与任务

在总体设计的基础上得出系统详细设计,并给出相应的系统设计说明书。

根据合理划分系统后的的各组成模块,给出系统的各部分设计说明书。

二、内容和要求

(1)选择两至三个模块进行详细设计。

(2)了解N-S图、PAD图、判定表和判定树的使用和特点。

(3)学会使用流程图和pdl语言对详细设计进行描述。

(4)在设计过程中,尽可能保证设计的完整性,一致性,无二义性

三、主要仪器设备

笔记本电脑

四、实验记录

详细设计说明书

1.引言:

编写目的:详细设计的根本目的就是怎样具体的实现用户所要求的系统。具体的就是为软件结构图中的每一个模块确定采用的算法和块内数据结构,并用某种选定的详细设计工具清晰的描述,从而在编码阶段可以方便软件设计人员把这些描述直接翻译成某种程序设计语言书写的源程序。

项目背景:由软件设计部门的总体设计人员提供软件结构图,并交由详细设计人员对每一个模块的功能进行详细设计。

参考资料:由崔东华,李爱萍,李东生编写的《软件工程》及网上相关参考资料。

2.程序描述:

功能:能够实现飞机票查询、订票以及查询其他相关的(例如乘客的信息、航空公司等)功能。

性能:乘客能够在系统上实现购买机票的事情。例如可以通过关键字始发地、目的地来选择相应的机票信息,在有可以选择多个公司的情况之下,可以在比较之后再选择,若没有航班,需提供相关航班信息,例如可以选择转机。若由于天气等原因导致航班推迟或取消,可以重新进行选票或选择继续乘坐。

输入和输出项目:输入始发地、目的地、时间查询飞机航班,飞行时间,票价,相关个人信息。

算法:顺序,分支,循环。

程序逻辑:

 

 

 

五、讨论、心得

    详细设计阶段的任务是确定如何实现所要求的目标系统,将总体设计阶段得到的模块算法用详细设计工具描述出来。从而在下一编码阶段直接翻译成某种程序设计语言书写的源程序。结构化程序设计技术是软件详细设计的基础,任何一个程序都可以用顺序,选择,循环3种设计结构来实现。

  在详细设计过程中,要注重人际界面设计的质量,认为它直接影响用户对软件系统的接收程度。与此同时,也要处理好系统响应时间,用户帮助措施,出错信息处理以及命令交互这4个设计问题。

实验四 机票预订系统的测试

  • 目的与任务

目的:在实验三基础上选择一个模块进行编码,完成相关的测试。

1、了解软件测试方法分类,其中包括:

     1)白盒测试

     2)黑盒测试   

     3)静态测试

     4)动态测试

2、了解测试类型

    1)单元测试

    2)集成测试

    3)确认测试

    4)黑盒测试

    5)白盒测试

    6)功能测试

    7)α测试

    8)β测试

任务:正确运用软件测试技术和方法,完成系统的单元测试、综合测试、确认测试、系统测试的方法,掌握测试用例的设计方法,并给出测试报告。

二、内容和要求

1、完善系统所设计的程序框图,选择一种程序设计语言,选择合适的模块,完成源程序的编写和单元测试,模拟运行数据,完成测试报告等。

2、能够正确运用软件测试的过程与方法,结合选定项目,复习、巩固软件工程中测试相关的知识,提高软件测试的实践能力。熟悉单元测试、综合测试、确认测试、系统测试的方法,掌握测试用例的设计和实施方法。树立正确的软件测试思想,培养分析问题、解决问题的能力,提高查询资料和撰写书面文件的能力。

三、主要仪器设备

笔记本电脑

四、实验记录

源程序:

*系统管理*/

void xiugai()   

{

       cout<<"输入航班号:"<<endl;

    int num;cin>>num;

       for(int i=0;i<len;i++)

              if(fl[i].a1==num){num=i;    cout<<"起飞时间:";cin>>fl[num].a2;cout<<"达到时间:";cin>>fl[num].a3;cout<<endl;break;   }

          if(i==len)cout<<"航班号错误!"<<endl;

}

void tuichu()  

{

              ofstream nfile2("cus.dat",ios_base::binary);     

              nfile2.close();  //关闭文件

       ofstream infile2("cus.dat",ios_base::binary|ios_base::app);   

       for(int i=0;i<A;i++)      

       {infile2.write((reinterpret_cast<char *>(&cu[i])),sizeof(customer));cout<<"写入成功!"<<endl;}//将乘客信息写入文件

       infile2.close();  //关闭文件

              ofstream nfile1("airline.dat",ios_base::binary); 

              nfile1.close(); //关闭文件

   ofstream infile1("airline.dat",ios_base::binary|ios_base::app);

       for( i=0;i<len;i++)        

          infile1.write((reinterpret_cast<char *>(&fl[i])),sizeof(flight));

       infile1.close();

}

void duqu()   //读取文件信息

       ifstream infile1("airline.dat",ios_base::binary);

       while(infile1.peek()!=EOF)         

       {    

              infile1.read((reinterpret_cast<char *>(&fl[len])),sizeof(flight));

       cout<<"***航班信息****"<<endl<<"航班号:"<<fl[len].a1<<'\t'<<"起飞时间:"<<fl[len].a2<<'\t'<<"降落时间:"<<fl[len].a3<<'\t'<<"起飞城市:"<<fl[len].a4<<'\t'<<"降落城市:"<<fl[len].a5<<'\t'<<"票价:"<<fl[len].a6<<'\t'<<"折扣:"<<fl[len].a7<<'\t'<<"剩余票量:"<<fl[len].a8<<endl;

       len++;

       }

     infile1.close();//关闭文件

       ifstream infile2("cus.dat",ios_base::binary);

       while(infile2.peek()!=EOF)         

       {infile2.read((reinterpret_cast<char *>(&cu[A++])),sizeof(customer));}

       infile2.close();     //关闭文件

       getchar();system("cls");

}

软件测试(条件组合覆盖):

  1. 正常情况下(判断条件的是否用字母代替)

2)处:a有直达、b无直达

3)处:c换座、d不换座

6)处:e有航班、f无航班

8)处:g乘坐、h不乘坐

9)处:i有票、j无票

11)处:k订票、l不订票

利用条件组合的测试方法,利用C语言代码可以如下64种组合:

a  c  e  g  i  k      a  c  e  g  i  l

a  c  e  g  j  k      a  c  e  g  j  l

a  c  e  h  i  k      a  c  e  h  i  l

a  c  e  h  j  k      a  c  e  h  j  l

a  c  f  g  i  k      a  c  f  g  i  l

a  c  f  g  j  k      a  c  f  g  j  l

a  c  f  h  i  k      a  c  f  h  i  l

a  c  f  h  j  k      a  c  f  h  j  l

a  d  e  g  i  k      a  d  e  g  i  l

a  d  e  g  j  k      a  d  e  g  j  l

a  d  e  h  i  k      a  d  e  h  i  l

a  d  e  h  j  k      a  d  e  h  j  l

a  d  f  g  i  k      a  d  f  g  i  l

a  d  f  g  j  k      a  d  f  g  j  l

a  d  f  h  i  k      a  d  f  h  i  l

a  d  f  h  j  k      a  d  f  h  j  l

b  c  e  g  i  k      b  c  e  g  i  l

b  c  e  g  j  k      b  c  e  g  j  l

b  c  e  h  i  k      b  c  e  h  i  l

b  c  e  h  j  k      b  c  e  h  j  l

b  c  f  g  i  k      b  c  f  g  i  l

b  c  f  g  j  k      b  c  f  g  j  l

b  c  f  h  i  k      b  c  f  h  i  l

b  c  f  h  j  k      b  c  f  h  j  l

b  d  e  g  i  k      b  d  e  g  i  l

b  d  e  g  j  k      b  d  e  g  j  l

b  d  e  h  i  k      b  d  e  h  i  l

b  d  e  h  j  k      b  d  e  h  j  l

b  d  f  g  i  k      b  d  f  g  i  l

b  d  f  g  j  k      b  d  f  g  j  l

b  d  f  h  i  k      b  d  f  h  i  l

b  d  f  h  j  k      b  d  f  h  j  l

说明:选取其中的一些就可以满足条件覆盖标准再配合其余的方法就可以补充漏掉的,以达到完善。

  1. 在航班推迟以及航班取消的情况:(判断条件的是否用字母代替)

13)处:a换乘、b 不换乘

15)处:c换乘、d不换乘

17)处:e有票、f无票

19)处:g乘坐、h不乘坐

利用条件组合的测试方法,可以如下16种组合:

a  c  e  g     a  c  e  h

a  c  f  g     a  c  f  h

a  d  e  g     a  d  e  h

a  d  f  g     a  d  f  h

b  c  e  g     b  c  e  h

b  c  f  g     b  c  f  h

b  d  e  g     b  d  e  h

b  d  f  g     b  d  f  h

Explanation: Select some of them to meet the conditional coverage standard, and then cooperate with the rest of the methods to supplement the missing ones to achieve perfection.

5. Discussion and experience

In the testing stage, we made a choice between white box testing and black box testing, and then chose the testing method in white box testing. Different methods have different advantages. Try to choose a testing method that can cover as many test cases as possible. The system is tested. Through the test, you will find the problems encountered in the coding process and the details that you have not considered. You can also modify the coding with more test cases during the test.

Guess you like

Origin blog.csdn.net/weixin_51538341/article/details/128505570