SlideShare ist ein Scribd-Unternehmen logo
1 von 82
Downloaden Sie, um offline zu lesen
Cucumber-JVM
yunsang.choi@sk.com
13년 6월 11일 화요일
What is Cucumber?
13년 6월 11일 화요일
13년 6월 11일 화요일
13년 6월 11일 화요일
피부에 좋은
오이
Cucumber는
13년 6월 11일 화요일
피부에 좋은
오이
BDD를 위한
Cucumber는
13년 6월 11일 화요일
13년 6월 11일 화요일
13년 6월 11일 화요일
13년 6월 11일 화요일
write features in plain text
13년 6월 11일 화요일
write features in plain text
business readable DSL
13년 6월 11일 화요일
write features in plain text
business readable DSL
documentation+automated tests
13년 6월 11일 화요일
Business facing Technology facing
features
scenarios
steps
step definitions
support code
13년 6월 11일 화요일
Business facing Technology facing
features
scenarios
steps
step definitions
support code
13년 6월 11일 화요일
Business facing Technology facing
features
scenarios
steps
step definitions
support code
13년 6월 11일 화요일
Business facing Technology facing
features
scenarios
steps
step definitions
support code
13년 6월 11일 화요일
documentation
automation tests
13년 6월 11일 화요일
Gherkin Basic
13년 6월 11일 화요일
13년 6월 11일 화요일
13년 6월 11일 화요일
피부에 좋은
오이
Gherkin은
13년 6월 11일 화요일
피부에 좋은
오이
feature 를
기술하기 위한
Gherkin은
13년 6월 11일 화요일
Gherkin is
13년 6월 11일 화요일
Gherkin is
the language
that Cucumber understands
13년 6월 11일 화요일
Gherkin is
Business-readable
Domain Specific Language
the language
that Cucumber understands
13년 6월 11일 화요일
Gherkin example :
13년 6월 11일 화요일
Gherkin example :
feature 제목 및 설명
테스트 실행과는 무관한 문서요소
13년 6월 11일 화요일
Gherkin example :
feature를 설명할 다수의 scenario로 구성
scenario는 구체적이고 테스트 가능한 예제.
각 scenario는 automated testing으로 실행됨
13년 6월 11일 화요일
Gherkin example :
scenario는 여러 step으로 구성.
각 step은 정규식으로 매칭되는 step definition의
code를 실행하게 됨
step definitions
13년 6월 11일 화요일
Gherkin : more examples
13년 6월 11일 화요일
모든 시나리오가 동일한 Given(조건)을
가질 경우 Background 절로 구성함
scenario background
13년 6월 11일 화요일
scenario outline
동일한 시나리오로 여러 값들을 테스트할 때 사용
내부적으로는 다수의 시나리오처럼 실행함
Fit/FitNesse와 유사한 expression
13년 6월 11일 화요일
data table
doc string
13년 6월 11일 화요일
Cucumber 는
문서화기능이 강화된 UnitTest?
UnitTest을 대체할 Testing F/W?
13년 6월 11일 화요일
with UnitTest
test for
13년 6월 11일 화요일
What to do
with UnitTest
test for
13년 6월 11일 화요일
What to do How to do
with UnitTest
test for
13년 6월 11일 화요일
System Behavior
What to do How to do
with UnitTest
test for
13년 6월 11일 화요일
System Behavior Module / Design
What to do How to do
with UnitTest
test for
13년 6월 11일 화요일
System Behavior Module / Design
What to do How to do
with
Specification
UnitTest
test for
13년 6월 11일 화요일
System Behavior Module / Design
What to do How to do
with
Specification Implementation
UnitTest
test for
13년 6월 11일 화요일
System Behavior Module / Design
“상수시간 내에 응답해야한다”
What to do How to do
with
Specification Implementation
UnitTest
test for
13년 6월 11일 화요일
System Behavior Module / Design
“상수시간 내에 응답해야한다” “Cache는 LRU정책을 따른다”
What to do How to do
with
Specification Implementation
UnitTest
test for
13년 6월 11일 화요일
“The Rspec book”,
David Chelimsky
with Dave Astels,
Zach Dennis,
Aslak Hellesoy,
Bryan Helmkamp,
and Dan North
13년 6월 11일 화요일
“The Rspec book”,
David Chelimsky
with Dave Astels,
Zach Dennis,
Aslak Hellesoy,
Bryan Helmkamp,
and Dan North
cucumber는 명세레벨 테스팅
unit test는 모듈레벨 테스팅
13년 6월 11일 화요일
Cucumber is the best tool
for ATDD/BDD
13년 6월 11일 화요일
Cucumber is the best tool
for ATDD/BDD
BUT...
13년 6월 11일 화요일
Cucumber is for
original
13년 6월 11일 화요일
Cucumber is for
original
java 개발자는...
써글 ruby 개발자들
cucumber+rspec
쵝오!
13년 6월 11일 화요일
+
Cucumber for Java
13년 6월 11일 화요일
13년 6월 11일 화요일
Aslak Hellesøy & Dan North
13년 6월 11일 화요일
Aslak Hellesøy & Dan North
Cucumber의 전신
13년 6월 11일 화요일
Aslak Hellesøy & Dan North
Cucumber의 전신
더이상 개발되지 않음
13년 6월 11일 화요일
Cuke4Duke
13년 6월 11일 화요일
Cuke4Duke
on
13년 6월 11일 화요일
Cuke4Duke
on
Aslak Hellesøy
13년 6월 11일 화요일
Cuke4Duke
on
Aslak Hellesøy
2년 전 개발 중단
13년 6월 11일 화요일
Cucumber-JVM
13년 6월 11일 화요일
Cucumber-JVM
Aslak Hellesøy
13년 6월 11일 화요일
Cucumber-JVM
Aslak Hellesøy
Cucumber를 Java로 다시 구현
13년 6월 11일 화요일
Cucumber-JVM
Aslak Hellesøy
Cucumber를 Java로 다시 구현
JVM 상의 주요언어들을 모두 지원
13년 6월 11일 화요일
이제 cucumber ruby를 버리는 중?
Cucumber-JVM은
Cucumber의 SubProject
13년 6월 11일 화요일
Cucumber-JVM 설정
13년 6월 11일 화요일
pom.xml 에 dependency 추가
junit과 연동
java를 쓸 경우 필수
spring F/W과 연동
주의) junit은 4.11 이상을 쓸것 (junit 4.8에서 오류 있음)
주의) cucumber-jvm 최신은 1.1.3이지만, pretty formatter 이슈가 있어서 1.1.2를
사용
13년 6월 11일 화요일
src/test/java/features/CucumberTests.java
@RunWith(Cucumber.class)
JUnit Runner로 Cucumber test가 실행될 수 있도록 함
@Cucumber.Options(...)
Cucumber의 실행옵션
feature 파일 위치와 출력형식을 지정
13년 6월 11일 화요일
src/test/resources/cucumber.xml
cucumber-­‐spring 을 사용할 경우 반드시 있어야 함
cucumber test를 실행할 때 필요한 spring configuration을 설정한다.
13년 6월 11일 화요일
src/test/resources/features/*.feature
feature 파일은 일반 plain text 이므로 test/resources 밑에 놓는다.
다른 junit test와 분리될 수 있도록 features 라는 package를 사용.
13년 6월 11일 화요일
src/test/java/features/step_definitions/*.java
step definitions는 java 클래스이므로 test/java/ 밑에 구성
다른 테스트 클래스와 구별되도록 features.step_definitions 패키지
밑에 step definition 클래스를 구성한다.
13년 6월 11일 화요일
Cucumber-JVM
step definitions
13년 6월 11일 화요일
scenario
step definition
step  텍스트에  대한  정규식을  
Annotation(@Given,  @When,  @Then)으로  기술
정규식의  matching  group을  parameter로  받음
13년 6월 11일 화요일
scenario
step definition
기본  type에  대해서는  arguments의  type  변환을  지원함
13년 6월 11일 화요일
http://cukes.info/step-­‐definitions.html
Step Definitions :
13년 6월 11일 화요일
Demo
https://github.com/odd-poet/cucumber-sample
13년 6월 11일 화요일
Cucumber Tips
13년 6월 11일 화요일
http://blog.codeship.io/2013/05/21/Testing-Tuesday-6-Top-5-Cucumber-best-practices.html
Top 5 Cucumber best practices
13년 6월 11일 화요일
http://blog.codeship.io/2013/05/21/Testing-Tuesday-6-Top-5-Cucumber-best-practices.html
Top 5 Cucumber best practices
13년 6월 11일 화요일
http://blog.codeship.io/2013/05/21/Testing-Tuesday-6-Top-5-Cucumber-best-practices.html
Top 5 Cucumber best practices
13년 6월 11일 화요일
http://blog.codeship.io/2013/05/21/Testing-Tuesday-6-Top-5-Cucumber-best-practices.html
Top 5 Cucumber best practices
13년 6월 11일 화요일
http://blog.codeship.io/2013/05/21/Testing-Tuesday-6-Top-5-Cucumber-best-practices.html
Top 5 Cucumber best practices
13년 6월 11일 화요일
Refining specification
• Examples should be precise and testable
• Scripts are not specifications
• Don’t create flow-like descriptions
• Specifications should be about business functionality, not software
design
• Avoid writing specifications that are tightly coupled with code
• Don’t get trapped in user interface details
• Specifications should be self-explanatory
• Specifications should be focused
• Specifications should be in domain language
“Specification by Example”, Gojko Adjic
13년 6월 11일 화요일
끝ND
13년 6월 11일 화요일

Weitere ähnliche Inhalte

Andere mochten auch

2013 PoApper Introduction
2013 PoApper Introduction2013 PoApper Introduction
2013 PoApper IntroductionByungjin Park
 
Test Automation With Cucumber JVM, Selenium, and Mocha
Test Automation With Cucumber JVM, Selenium, and MochaTest Automation With Cucumber JVM, Selenium, and Mocha
Test Automation With Cucumber JVM, Selenium, and MochaSalesforce Developers
 
Protractor로 web ui test 자동화 하기
Protractor로 web ui test 자동화 하기Protractor로 web ui test 자동화 하기
Protractor로 web ui test 자동화 하기GyeongSeok Seo
 
SOSCON2015 Robot Framework
SOSCON2015 Robot FrameworkSOSCON2015 Robot Framework
SOSCON2015 Robot FrameworkSung Hoon Moon
 
[오픈소스컨설팅]Jira 한글패치가이드 1
[오픈소스컨설팅]Jira 한글패치가이드 1[오픈소스컨설팅]Jira 한글패치가이드 1
[오픈소스컨설팅]Jira 한글패치가이드 1정명훈 Jerry Jeong
 
BDD presentation
BDD presentationBDD presentation
BDD presentationtemebele
 
Behavior Driven Development (BDD) and Agile Testing
Behavior Driven Development (BDD) and Agile TestingBehavior Driven Development (BDD) and Agile Testing
Behavior Driven Development (BDD) and Agile Testingdversaci
 
Behavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using CucumberBehavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using CucumberKMS Technology
 
DEVOPS 에 대한 전반적인 소개 및 자동화툴 소개
DEVOPS 에 대한 전반적인 소개 및 자동화툴 소개DEVOPS 에 대한 전반적인 소개 및 자동화툴 소개
DEVOPS 에 대한 전반적인 소개 및 자동화툴 소개태준 문
 
Behavior Driven Development
Behavior Driven DevelopmentBehavior Driven Development
Behavior Driven DevelopmentLiz Keogh
 
Behavior Driven Development with Cucumber
Behavior Driven Development with CucumberBehavior Driven Development with Cucumber
Behavior Driven Development with CucumberBrandon Keepers
 
Writing Software not Code with Cucumber
Writing Software not Code with CucumberWriting Software not Code with Cucumber
Writing Software not Code with CucumberBen Mabey
 

Andere mochten auch (12)

2013 PoApper Introduction
2013 PoApper Introduction2013 PoApper Introduction
2013 PoApper Introduction
 
Test Automation With Cucumber JVM, Selenium, and Mocha
Test Automation With Cucumber JVM, Selenium, and MochaTest Automation With Cucumber JVM, Selenium, and Mocha
Test Automation With Cucumber JVM, Selenium, and Mocha
 
Protractor로 web ui test 자동화 하기
Protractor로 web ui test 자동화 하기Protractor로 web ui test 자동화 하기
Protractor로 web ui test 자동화 하기
 
SOSCON2015 Robot Framework
SOSCON2015 Robot FrameworkSOSCON2015 Robot Framework
SOSCON2015 Robot Framework
 
[오픈소스컨설팅]Jira 한글패치가이드 1
[오픈소스컨설팅]Jira 한글패치가이드 1[오픈소스컨설팅]Jira 한글패치가이드 1
[오픈소스컨설팅]Jira 한글패치가이드 1
 
BDD presentation
BDD presentationBDD presentation
BDD presentation
 
Behavior Driven Development (BDD) and Agile Testing
Behavior Driven Development (BDD) and Agile TestingBehavior Driven Development (BDD) and Agile Testing
Behavior Driven Development (BDD) and Agile Testing
 
Behavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using CucumberBehavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using Cucumber
 
DEVOPS 에 대한 전반적인 소개 및 자동화툴 소개
DEVOPS 에 대한 전반적인 소개 및 자동화툴 소개DEVOPS 에 대한 전반적인 소개 및 자동화툴 소개
DEVOPS 에 대한 전반적인 소개 및 자동화툴 소개
 
Behavior Driven Development
Behavior Driven DevelopmentBehavior Driven Development
Behavior Driven Development
 
Behavior Driven Development with Cucumber
Behavior Driven Development with CucumberBehavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
 
Writing Software not Code with Cucumber
Writing Software not Code with CucumberWriting Software not Code with Cucumber
Writing Software not Code with Cucumber
 

Cucumber jvm