AirLuggageFeeService program refer to China International Airlines's baggage billing standard. According to the user’s cabin level, it provides users with functions such as inquiries about baggage billing, the number of pieces of luggage that can be carried, and the maximum weight of each piece of luggage. Each function serves as a sevice interface, the experiment of the interface feecalculation functionality provided by the test.
- Input specifications
parameter | parameter's type | restriction | description |
airClass | int | only the number 0-3 | 0, 1, 2, 3, respectively, on behalf of the passenger's cabin level: first class, business class and economy class tickets and baby |
area | int | 0 or 1 | 1 respectively on behalf of the domestic and international flightsWhether |
isstudent | boolean | Is it a student ticket | |
luggage | double | Total weight of luggage carried by the user | |
economicfee | double | airfare |
-
Output specifications
The output parameter that can be obtained by calling feeCalculation function interface is “luggagefee”, which is of double type. The charging formula is as follows:
luggagefee = (luggage-benchmark)*economicfee*0.015,
In the above formula, “luggagefee” is the luggage fee that should be paid by the passenger. If the passenger’s luggage is within the over-limit range, “luggagefee”=0; the benchmark is the standard amount of excess luggage, and the system will determine the specific amount according to the passenger’s cabin class and identity benchmark. Specific as shown in the table.Note: There is another special case that is not listed in the table. when the passenger is an international passenger and a student, benchmark value is equal to 30. Assume that all students hold economy class tickets.
airClass | Benchmark |
0 | 40 |
1 | 30 |
2 | 20 |
3 | 0 |
-
Description of MRs
According to the function of the program, 18 MRs are designed for the program. Because the value of economicfee in the program does not affect the program executed by the metamorphic relations, the value of economicfee is fixed to 1000 in the description of the MRs.
No. | R | Rf |
1. airClass=0, isStudent=F,area=0~1, | ||
MR1 | luggage_=luggage+1,(40<=luggage<200) | luggagefee_>luggagefee |
MR2 | luggage_=2*luggage,(40<=luggage<100) | luggagefee_>=2*luggagefee |
2. airClass=1, isStudent=F,area=0~1, | ||
MR3 | luggage_=luggage+1(30<=luggage<200) | luggagefee_>luggagefee |
MR4 | luggage_=2*luggage, (30<=luggage<100) | luggagefee_>=2*luggagefee |
3. airClass=2, isStudent=F,area=0~1, | ||
MR5 | luggage_=luggage+1, (20<=luggage<200) | luggagefee_>luggagefee |
MR6 | luggage_=2*luggage, (20<=luggage<100) | luggagefee_>=2*luggagefee |
4. airClass=3, isStudent=F,area=0~1, | ||
MR7 | luggage_=luggage+1, (0<=luggage<200) | luggagefee_>luggagefee |
MR8 | luggage_=2*luggage, (0<=luggage<100) | luggagefee_>=2*luggagefee |
5. airClass=0, isStudent=T,area=0, | ||
MR9 | luggage_=luggage+1, (40<=luggage<200) | luggagefee_>luggagefee |
MR10 | luggage_=2*luggage, (40<=luggage<100) | luggagefee_>=2*luggagefee |
6. airClass=1, isStudent=T,area=0, | ||
MR11 | luggage_=luggage+1, (30<=luggage<200) | luggagefee_>luggagefee |
MR12 | luggage_=2*luggage, (30<=luggage<100) | luggagefee_>=2*luggagefee |
7. airClass=2, isStudent=T,area=0, | ||
MR13 | luggage_=luggage+1, (20<=luggage<200) | luggagefee_>luggagefee |
MR14 | luggage_=2*luggage, (20<=luggage<100) | luggagefee_>=2*luggagefee |
8. airClass=3, isStudent=T,area=0, | ||
MR15 | luggage_=luggage+1, (0<=luggage<200) | luggagefee_>luggagefee |
MR16 | luggage_=2*luggage, (0<=luggage<100) | luggagefee_>=2*luggagefee |
9. airClass=0~3, isStudent=T,area=1, | ||
MR17 | luggage_=luggage+1, (30<=luggage<200) | luggagefee_>luggagefee |
MR18 | luggage_=0.5*luggage, (60<=luggage<200) | luggagefee<=0.5*luggagefee |