Pairwise Tool & Pairwise Test NuSRS 200511305 김성규 200511306 김성훈 200614164 김효석 200611124 유성배 200518036 곡진화
2 PICT Pairwise Tool - PICT Microsoft 의 Command-line 기반의 Free Software www.pairwise.org 에서다운로드후설치
3 PICT Parameter, Constraint 정의 example1.txt Constraints 정의가능 IF, Condition 조건 IF [File system] = "FAT" THEN [Size] <= 4096; IF [Cluster size] in {512, 1024, 2048} THEN [Compression] = "Off ;
4 PICT Pairwise 수행설치폴더에서수행또는환경변수추가 pict [ 정의파일 ] > [ 결과파일 ] pict example1.txt > ex.xls ex.xls
5 PICT pict 명령어옵션 /o:[ 숫자 ] Combination 수지정 (default : 2) 파라미터수만큼지정시모듞경우출력 /r:[ 숫자 ] Pairwise 추출을랜덤 (default : 0) 옵션없이반복수행시동일한결과획득 /s Combination, 생성된 test 수, 생성시간
6 Functional specifications Expression is parsed to Logic structure Used symbol :, &, +, -, =,!, <, >, <=, >=, :=, (, ) Expression Divide with operator and definition of variable (A=true) Identify Boolean value of expression If (, ) is occurred in expression, identify value Expression must be identified that value is false or true
7 Functional specifications 예 ) (f_sg1_lo_flow_val_out_t1 -f_sg1_lo_flow_val_out <=k_sg1_lo_flow_100ms_rate) & (f_sg1_lo_flow_val_out -k_sg1_lo_flow_trip_step >=k_sg1_lo_flow_sp_lo_lim) & (f_sg1_lo_flow_val_out -k_sg1_lo_flow_trip_step <=k_sg1_lo_flow_sp_hi_lim) 문자열변환과정 ( 지난발표분석참조 ) Step 1. 복합문을쪼갠다 : &,!, (, ), 로나누기 - makemember Step 2.! 가미치는구문을찾아내어상쇄시켜중복! 연산을최소화 - settruth Step 3. Step2 에서! 영향을변수로저장했기때문에구문에서! 제거 - removenot Step 4. 괄호, 개행문자제거 - removebracket, removeenter Step 5. 연산자에대해! 을수행 - converttruth Step 6. 나누어진구문들을비교연산자를기준으로나눔 - setsubelement Step 7. +, - 연산자를기준으로나눔 - dividesub f_sg1_lo_flow_val_out_t1 / - / f_sg1_lo_flow_val_out / <= k_sg1_lo_flow_100ms_rate / & /f_sg1_lo_flow_val_out / - k_sg1_lo_flow_trip_step / >= /k_sg1_lo_flow_sp_lo_lim) / & f_sg1_lo_flow_val_out / - /k_sg1_lo_flow_trip_step / <= k_sg1_lo_flow_sp_hi_lim)
8 Testable Units Step 1. Identify Independently Testable Units 정해진 Symbol 사용 [Symbol] 올바른변수이름사용 [Name] 올바른 Expression 형태 (A = true/false, A < B) [Exp] 요구사항에서추출! 연산자사용 [Not] 개행문자사용 [Enter] removenot, removeenter 함수에서추출 괄호사용 [Level] 요구사항, 함수에서추출
Representative Values Step 2. Identify Representative Values Symbol Name Exp Not Enter Level Value Valid, Invalid Valid, Invalid Valid, Invalid Odd, Even Exist, Not Exist 0, 1, Many 9
10 Representative Values Step 2. Identify Representative Values Pairwise 결과 pict test.txt > ex.xls /o:3
11 Testcase Specifications Step 3. Generate Testcase Specifications Error Constraints Symbol, Name, Exp 의 Invalid 시 Error Symbol Name Exp Level Not Enter 1 Invalid Valid Valid Many Odd Exist 2 Valid Valid Invalid 1 Even Not Exist 3 Valid Invalid Valid Many Even Not Exist 4 Invalid Invalid Invalid Many Odd Not Exist 5 Invalid Valid Invalid Many Even Not Exist 6 Valid Invalid Invalid Many Odd Exist 7 Valid Valid Valid 0 Odd Not Exist 8 Valid Invalid Valid 0 Even Exist 9 Invalid Invalid Valid 1 Even Not Exist 10 Invalid Valid Invalid 1 Odd Exist 11 Invalid Invalid Invalid 0 Even Not Exist 12 Valid Invalid Valid 1 Odd Not Exist 13 Valid Valid Valid 1 Even Exist 14 Invalid Valid Invalid 0 Even Exist 15 Invalid Invalid Invalid Many Even Exist 16 Valid Invalid Invalid 0 Odd Exist 17 Valid Invalid Invalid 1 Odd Exist 18 Invalid Valid Valid 0 Odd Exist 19 Valid Valid Valid Many Odd Not Exist
12 Testcase Specifications Step 3. Generate Testcase Specifications TestString 1 f_input1=false&!f_input2!=true 2 (f=_input1=true!f_input2=true)&f_input3=true 3 (f_input1=true&&!f_=input2==true) 4!(!(!f_input1=true&!f_input2=false)\n&&!f_input3=false) 5 (f_input1=false&(f_input2=true) 6 (f_input1<>false&f_input2=true) input3=3 7!(f_input1=true&f_input2=true) 8!(f=_input1=false) f_input2=true 9 (f_input1==true&!f_input2=true) input3=false 10 (f_input=true (f_input2>=false)&input3=true) 11 ((f_input1=false input2=true)&\n(f_input3=true&f_input4=true))\n 12 (f=_input1>=true!f_input2<=true)&f_input3!=true 13!(!f_input1=true\n&f_input2=true)&!f_input3=true 14 f_input1=true\n&f_input2 15 (f_input!1=true\n&f_input2)?(f_input3=true&f_input4=true) 16!f_input!1=true\n&f_input2 17 (!f_input1=true\n&f_input2)&!f_input>3=true 18 f_input1*true&\n!f_input2=true 19 ((!f_input1=true&f_input2=true)&f_input3=true)
Testcase Code Step 4. Generate Testcase Code Symbol Name Exp Level Not Enter 13 Valid Valid Valid 1 Even Exist public void teststringtologic13() { String fullstring = "!(!f_input1=true\n&f_input2=true)&!f_input3=true"; stringtologic s = new stringtologic(fullstring); Iterator<logicMember> it = s.lm.iterator(); assertequals(((logicmember)it.next()).element,"f_input1=true"); assertequals(((logicmember)it.next()).element," "); assertequals(((logicmember)it.next()).element,"f_input2 = false"); assertequals(((logicmember)it.next()).element,"&"); assertequals(((logicmember)it.next()).element,"f_input3 = false"); it=s.lm.iterator(); 13
14 Testcase Code Step 4. Generate Testcase Code assertequals(((logicmember)it.next()).level,1); assertequals(((logicmember)it.next()).level,1); assertequals(((logicmember)it.next()).level,1); assertequals(((logicmember)it.next()).level,0); assertequals(((logicmember)it.next()).level,0); it=s.lm.iterator(); } assertequals(((logicmember)it.next()).numnot,2); assertequals(((logicmember)it.next()).numnot,1); assertequals(((logicmember)it.next()).numnot,1); assertequals(((logicmember)it.next()).numnot,0); assertequals(((logicmember)it.next()).numnot,1);
Coverage Report 15
Coverage Report 16
END