ILM – Law and Ordinance Unit Test Cases

FileName Inputs.h
Test ID ILM_L&O_IL0101-01
Function loadLawOrdinance(string&)
Class LawOrdinanceMap
Tester Yudong Tao
Date 03/30/19
Purpose Gets the law and ordinance factors
Preconditions 1.Loads the path to law-ordinance.csv
2.Prepare law-ordinance.csv
Test Data law-ordinance.csv
county_subregion_era_frame_1_weak,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,
0.99955274,0.99400157,0.98135657,0.96368725,0.94214278,0.92121969,0.90180233,0.88461085,
0.86724938,0.85391869,0.84532176,0.84117584,0.84492617,0.84908398,0.85794869,0.86929047,
0.88104590,0.89357152,0.90303375,0.91322420,0.92078590,0.92840196,0.93482589,0.93927550,
0.94371747,0.94715403,0.95019351,0.95306456,0.95498686,0.95730704,0.95946900,0.96114856,
0.96261642,0.96425080,0.96630148county_subregion_era_frame_1_medium,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,
1.00000000,1.00000000,0.99891486,0.99489337,0.98053991,0.95283801,0.92663168,0.88769938,
0.86137701,0.83117552,0.81138101,0.79290842,0.78506343,0.78485098,0.78807330,0.79946400,
0.81514675,0.83206921,0.84782770,0.86623626,0.88228633,0.89552679,0.90743164,0.91760505,
0.92609238,0.93283169,0.93821779,0.94363390,0.94701462,0.95013475,0.95274065,0.95457858,
0.95670903,0.95857148,0.96032984
Expected results NO EXCEPTION
Actual results NO EXCEPTION
Test results (Pass/Fail) Pass
Comments

 

FileName Inputs.h
Test ID ILM_L&O_IL0101-02
Function loadLawOrdinance(string&)
Class LawOrdinanceMap
Tester Yudong Tao
Date 03/30/19
Purpose Gets the law and ordinance factors
Preconditions 1.Loads the path to law-ordinance.csv
2.Do not prepare law-ordinance.csv
Test Data No law-ordinance.csv exists
Expected results Throw no file exception
Actual results Throw no file exception
Test results (Pass/Fail) Pass
Comments

 

FileName Inputs.h
Test ID ILM_L&O_IL0101-03
Function loadLawOrdinance(string&)
Class LawOrdinanceMap
Tester Yudong Tao
Date 03/30/19
Purpose Gets the law and ordinance factors
Preconditions 1.Loads the path to law-ordinance.csv
2.Prepare law-ordinance.csv
Test Data law-ordinance.csv (missing one factors in the first item)
county_subregion_era_frame_1_weak,1.00000000,1.00000000,1.00000000,1.00000000,
0.99955274,0.99400157,0.98135657,0.96368725,0.94214278,0.92121969,0.90180233,0.88461085,
0.86724938,0.85391869,0.84532176,0.84117584,0.84492617,0.84908398,0.85794869,0.86929047,
0.88104590,0.89357152,0.90303375,0.91322420,0.92078590,0.92840196,0.93482589,0.93927550,
0.94371747,0.94715403,0.95019351,0.95306456,0.95498686,0.95730704,0.95946900,0.96114856,
0.96261642,0.96425080,0.96630148county_subregion_era_frame_1_medium,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,
1.00000000,1.00000000,0.99891486,0.99489337,0.98053991,0.95283801,0.92663168,0.88769938,
0.86137701,0.83117552,0.81138101,0.79290842,0.78506343,0.78485098,0.78807330,0.79946400,
0.81514675,0.83206921,0.84782770,0.86623626,0.88228633,0.89552679,0.90743164,0.91760505,
0.92609238,0.93283169,0.93821779,0.94363390,0.94701462,0.95013475,0.95274065,0.95457858,
0.95670903,0.95857148,0.96032984
Expected results Throw malformed factors line exception
Actual results Throw malformed factors line exception
Test results (Pass/Fail) Pass
Comments

 

FileName Inputs.h
Test ID ILM_L&O_IL0101-04
Function loadLawOrdinance(string&)
Class LawOrdinanceMap
Tester Yudong Tao
Date 03/30/19
Purpose Gets the law and ordinance factors
Preconditions 1.Loads the path to law-ordinance.csv
2.Prepare law-ordinance.csv
Test Data law-ordinance.csv (one more factors in the first item)
county_subregion_era_frame_1_weak,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,
0.99955274,0.99400157,0.98135657,0.96368725,0.94214278,0.92121969,0.90180233,0.88461085,
0.86724938,0.85391869,0.84532176,0.84117584,0.84492617,0.84908398,0.85794869,0.86929047,
0.88104590,0.89357152,0.90303375,0.91322420,0.92078590,0.92840196,0.93482589,0.93927550,
0.94371747,0.94715403,0.95019351,0.95306456,0.95498686,0.95730704,0.95946900,0.96114856,
0.96261642,0.96425080,0.96630148,1.00000000county_subregion_era_frame_1_medium,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,
1.00000000,1.00000000,0.99891486,0.99489337,0.98053991,0.95283801,0.92663168,0.88769938,
0.86137701,0.83117552,0.81138101,0.79290842,0.78506343,0.78485098,0.78807330,0.79946400,
0.81514675,0.83206921,0.84782770,0.86623626,0.88228633,0.89552679,0.90743164,0.91760505,
0.92609238,0.93283169,0.93821779,0.94363390,0.94701462,0.95013475,0.95274065,0.95457858,
0.95670903,0.95857148,0.96032984
Expected results Throw malformed factors line exception
Actual results Throw malformed factors line exception
Test results (Pass/Fail) Pass
Comments

 

FileName ILM
Test ID ILM_L&O_IL0201-01
Function policyProcess(IPolicy &, IMatrices, double, LawOrdinance*)
Class SILM
Tester Yudong Tao
Date 03/30/19
Purpose Processes the parameter policy (pol) using SILM
Preconditions 1.Loads standard information to object ParaInfo
2.Prepare pare_file.txt
3.Prepare county-surge.csv
4.Prepare valid_data.csv
1,32003,1955,Frame,8213497.15,8213497.15,682441.33,4846492.43,1604857.86,0,0.00,0.00,C,Clay,
North,1,9,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,
rect,1,-81.715057,30.095860,HO-2,NA,33
5.Prepare wsc.1.dat
6.Prepare DamageRatio.txt
7.Prepare county2region.txt
8.Prepare law-ordinance.csv
Test Data para_file.txt
1,0,1,1,1,Winds,Policies/valid_data.csv,v6.3_pr_matrices,SubRegions,Results,1
wsc.1.dat
Storm001 7/31/1915
240
2,40,46,50,53,54,56,57,58,59,60,61,61,62,62,63
Expected results The loss has been multiplied by corresponding L&O factor; if success return 0, otherwise throw exceptions
Actual results The loss has been multiplied by corresponding L&O factor; return 0
Test results Pass
Comments

 

FileName ILM
Test ID ILM_L&O_IL0201-02
Function policyProcess(IPolicy &, IMatrices, double, LawOrdinance*)
Class SILM
Tester Yudong Tao
Date 03/30/19
Purpose Processes the parameter policy (pol) using SILM
Preconditions 1.Loads standard information to object ParaInfo
2.Prepare pare_file.txt
3.Prepare county-surge.csv
4.Prepare valid_data.csv
1,32003,1955,Frame,8213497.15,8213497.15,682441.33,4846492.43,1604857.86,1,0.00,0.00,C,Clay,
North,1,9,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,
rect,1,-81.715057,30.095860,HO-2,NA,33
5.Prepare wsc.1.dat
6.Prepare DamageRatio.txt
7.Prepare county2region.txt
8.Prepare law-ordinance.csv
Test Data para_file.txt
1,0,1,1,1,Winds,Policies/valid_data.csv,v6.3_pr_matrices,SubRegions,Results,1
wsc.1.dat
Storm001 7/31/1915
240
2,40,46,50,53,54,56,57,58,59,60,61,61,62,62,63
Expected results The loss is not multiplied by corresponding L&O factor; if success return 0, otherwise throw exceptions
Actual results The loss is not multiplied by corresponding L&O factor; return 0
Test results Pass
Comments

 

FileName ILM
Test ID ILM_L&O_IL0202-01
Function companyProcess(ICompany *, IMatrices *, LawOrdinanceMap *)
Class SILM
Tester Yudong Tao
Date 03/30/19
Purpose Processes the parameter exposure (companyHolder) using SILM
Preconditions 1.Loads standard information to object ParaInfo
2.Prepare pare_file.txt
3.Prepare county-surge.csv
4.Prepare valid_data.csv
1,32003,1955,Frame,8213497.15,8213497.15,682441.33,4846492.43,1604857.86,1,0.00,0.00,C,Clay,
North,1,9,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,
rect,1,-81.715057,30.095860,HO-2,NA,33
5.Prepare wsc.1.dat
6.Prepare DamageRatio.txt
7.Prepare county2region.txt
8.Prepare law-ordinance.csv
9.Prepare v6.3_pr_matrices
VM1_res_bldg_Msry_central_101_none_half-medium00-half-strong_94-01.csv
Test Data para_file.txt
1,0,1,1,1,Winds,Policies/valid_data.csv,v6.3_pr_matrices,SubRegions,Results,1
Expected results initialize fields; if success return 0
Actual results return 0
Test results Pass
Comments

 

FileName ILM
Test ID ILM_L&O_IL0301-01
Function setLawAndOrdinanceId(IPolicy &, int, string, string, int, string)
Class PreProcessChecker
Tester Yudong Tao
Date 03/30/19
Purpose Sets the Id/Key of the L&O factors corresponding to this policy
Preconditions 1.Loads standard information to object ParaInfo
2.Prepare pare_file.txt
3.Prepare law-ordinance.csv
4.Prepare valid_data.csv
1,32003,1955,Frame,8213497.15,8213497.15,682441.33,4846492.43,1604857.86,1,0.00,0.00,C,Clay,
North,1,9,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,
rect,1,-81.715057,30.095860,HO-2,NA,33
Test Data para_file.txt
1,0,1,1,1,Winds,Policies/valid_data.csv,v6.3_pr_matrices,SubRegions,Results,1
Expected results initialize pol.loId as 19_none_Pre60_frame_stories_strength; return true;
Actual results pol.loId = 19_none_Pre60_frame_stories_strength; return true;
Test results Pass
Comments

 

Download PDF