Combinational Test - 2. PICT and CIT-BACH

Dahun Yoo·2021년 4월 21일
0

QA or Test

목록 보기
11/38
post-thumbnail

조합 테스트를 할 때, 가장 효율적인 조합을 찾아주는 도구, 프로그램들은 많이 있습니다만, 그 중에 널리 알려진 PICT과, 널리 알려지진 않은 CIT-BACH라는 것을 기재해보고자 합니다.


이 글은 전 편 에서 이어집니다.

PICT, Pairwise Independent Combinatorial Testing tool

PICT generates test cases and test configurations. With PICT, you can generate tests that are more effective than manually generated tests and in a fraction of the time required by hands-on test case design.

PICT runs as a command line tool. Prepare a model file detailing the parameters of the interface (or set of configurations, or data) you want to test. PICT generates a compact set of parameter value choices that represent the test cases you should use to get comprehensive combinatorial coverage of your parameters.

https://github.com/microsoft/pict

Command Line tool인 PICT는 Pair-wise를 구현한 것으로, microsoft의 테스트 엔지니어 Jacek Czerwonka 가 만든 것으로 알려져 있습니다. 업계에서 유명한 툴이기도 한데요, (일단 프로젝트의 repository도 Microsoft github계정에서 관리중...)
일단 무료로 사용할 수 있는게 가장 좋습니다.
기본적으로는 exe파일로 제공하고 있지만, 직접 github에서 소스코드 전체를 다운받은다음, macOS에서 컴파일을 해주면 mac에서도 사용할 수 있는 것으로 알고 있습니다. (X-code 및 X-code 설치 후 C언어 설치 필요)
macOS에서의 컴파일 방법은 아래 블로그에 소개되어 있으니 참고해주시면 감사하겠습니다.

사용방법

일단 exe파일로 제공되니, 임의의 폴더에 다운받은 후 커맨드 프롬프트를 실행 시키신 후 해당 exe파일이 위치한 폴더로 이동하여 아래와 같이 실행하시면 됩니다.

pict 조건입력파일.txt > 출력파일.txt

혹은 아래와 같이 그냥 한다면, 프롬프트에 바로 결과가 출력되게 됩니다.

pict 조건입력파일.txt

조건을 입력할 때는 기본적으로 다음과 같이 입력합니다.

parameter 1 : level1, level2, level3
parameter 2 : level1, level2, ...
.
.
.

# Example
OS: Windows XP, Windows 7, Windows 10, maxOS
Browser: Chrome, Safari, Edge,
Program version: 1.0, 1.1, 1.2

위와 같이 입력해주면 됩니다.

조건 입력파일 내에 제약조건 등을 추가로 기재할 수도 있습니다. 제약조건 등을 서술하는 방법은, Github의 md file에도 기재되어있고, 좋은 블로그가 있어서 대신 소개하고자 합니다.

PICT 툴 - Pair-Wise 케이스 생성 프로그램

사용하면 좋은점

당연히 시간을 아껴줍니다. 그리고 테스트케이스를 작성하면서 놓칠 수 있는 경우의 수를 프로그램이 알아서 고려해줍니다. 모든 임의의 2개의 조합을 최소 한 번, 가장 효율적으로 확인할 수 있는 패턴을 자동으로 생성해줍니다. 따라서 모든 경우의 수를 확인하지 않게 됩니다. 모든 경우의 수를 확인하지 않는 다는 것은, 그만큼의 risk가 발생한다는 것이므로 맹신해선 안됩니다만, 어찌되었던 효율적으로 조합의 패턴을 생성해줍니다.

Jacek Czerwonka가 작성한 연구내용에 따르면, 7개 이상의 parameter 및 많은 값의 level값이 있다면, 테스트케이스의 수는 기하급수적으로 늘어나게 됩니다. pair-wise방법을 구현하는 PICT를 사용함으로 인해 이것을 크게 줄일 수 있습니다.

CIT-BACH, Combinatorial Interaction Testing tool with a BDD-Assisted Constraint Handler

뭔가 이름이 거창합니다... 만 오사카대학의 Tsuchiya 교수가 개발한 툴입니다. 이 툴은 테스트케이스 생성 프로그램인 Qumias의 back-end engine으로 사용되었습니다. Java로 작성되어서, JVM을 실행할 수 있는 환경이라면 어떤 OS라도 사용할 수 있습니다.

CIT-BACH (pronounced as "sit back" or "sea eye tea back") is a test case generation tool for combinatorial interaction testing. CIT-BACH is written completely in Java and requires JRE 1.6.0 or higher to run.

CIT-BACH uses a one-row-at-a-time greedy algorithm, which is similar to PICT. The tool supports constraints. To handle constraints, the tool first builds a binary decision diagram (BDD) that represents all the constraints. The way of doing this is novel in that once the BDD has been created, there is no need to manipulate it: Whether a test case or tuple satisfies the constraints or not can be checked by simply traversing the BDD from the root to the leaf, which only requires time linear in the number of parameters.

https://osdn.net/users/t-tutiya/pf/cit_bach/wiki/FrontPage

PICT와 거의 차이점은 없기때문에, PICT사용하는 편이 좋을지도 모르겠습니다만... PICT의 경우, 많은 level값인 경우 및 복잡한 제약조건을 걸었을 때의 처리속도가 많이 떨어지게됩니다. CIT-BACH는 그러한 점을 개선한 툴이라 생각하시면 되겠습니다.

일본어이긴 하지만...

  • 조건1 : 7개 파라미터, 20 level 시, 예시와 같은 제약조건
  • 조건2 : 10개 파라미터, 8 level 시, 예시와 같은 제약조건
  • 조건3 : 8개 파라미터, 4 level 시, 예시와 같은 제약조건

에서 위와 같은 성능을 보여주었다네요.

사용방법

# parameters and values
Display (16MC 8MC BW)
Viewer (Graphical Text None)
Camera (2MP 1MP None)
VideoCamera (Yes No)
VideoRingtone  (Yes No)

# group: ensures all value combinations are covered 
{Display Viewer Camera}

# constraints
#1
(if (== [Viewer] Graphical) (or (== [Display] 16MC) (== [Display] 8MC)))

#2
(if (== [Camera] 2MP) (or (== [Display] 16MC) (== [Display] 8MC)))

#3
(if (== [Viewer] Graphical) (not (== [Camera] 2MP)))

#4
(if (== [Display] 8MC) (<> [Camera] 2MP))

#5
(if (== [VideoCamera] Yes) 
   (and (or (== [Camera] 2MP) (== [Camera] 1MP))  
        (or (== [Display] 16MC) (== [Display] 8MC))
   )
)

#6
(if (== [VideoRingtone] Yes) (== [VideoCamera] Yes))

#7
(not (and (== [Display] 16MC) (== [Viewer] Text) (== [Camera] 2MP)))

java -jar cit-bach.jar -i inputfile -lang en

# Options
-c [2 | 3 | 4 | 5 | all] : Strength (default: 2)
-s file: Seeding file
-i file: Model file
-o file: Output file
-random N: Random seed
-repeat N: N times repetition
-lang [JP | EN] : Language
-policy: License notice

파라미터와 level값들을, 띄어쓰기와 괄호로 구분한다는 것이 특징입니다.


사실 CIT-BACH 은, 제가 일하고 있는 일본에서도 많이 사용하진 않는 것 같긴한데요, PICT에 대해 조사하면서 알게 되어서, 같이 소개한 감이 없지 않아 있습니다.
다음 포스트에서는 PICT 를 사용하는 무료 소프트 중 하나인, PictMaster 에 대해 기재해보겠습니다...

Ref

profile
QA Engineer

0개의 댓글