cooking eclipse plugins with bdd, cucumber, swtbot and tycho

Post on 16-Apr-2017

110 Views

Category:

Software

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Cooking Eclipse Plugins

© 2014 Migeran Ltd. All rights reserved.

Gergely Kis

CEO

Migeran Ltd

Tycho

Agenda

● Introduction

– Why are we building an Eclipse plugin?

– A Success Story

● The Ingredients

– Cucumber

– SWTBot

– Tycho

– Served by Jenkins

● Tasting it (Demo Time!)

© 2014 Migeran Ltd. All rights reserved. 3

Introduction● Worked in Mobile for 10 years

– Platform development (Siemens, Android)

– App development● Android, iOS, BB 10, BB Classic, J2ME, Symbian

● Started MattaKis Consulting in 2007

– Cross-platform Mobile Apps since 2008

– Migeran spin-off created in 2013

● Other Technologies

– Embedded Linux (C / C++ / ARM / MIPS)

– Java EE (Spring, Play)Eclipse user since 2002

© 2014 Migeran Ltd. All rights reserved. 4

Why are we building an Eclipse Plugin?

● Developers can create iOS Apps in Java or Scala

● IDE based on Eclipse, integrated with Xcode

+ =MacBook Pro

AndroidDeveloper

iOSApps

© 2014 Migeran Ltd. All rights reserved. 5

Success Story – Not a Fairy Tale

Continuous Improvement

© 2014 Migeran Ltd. All rights reserved. 6

Our Journey – The Beginning

Releases withManual testing

Prototype

Quality is notthe main focus

Long QA Cycles,Stress

● We have:

– Unit tests

– Automated by the CIServer

● We need:

– Automated acceptancetests

– Created by thedevelopment team

© 2014 Migeran Ltd. All rights reserved. 7

Automate UI Tests with SWTBot

● SWTBot: @Eclipse

– Write UI Tests with a beautiful Java API

– Integrates with JUnit, Tycho (Maven)

– Eclipse integrated Test Recorder for bootstrapping

UI TestsAutomated

© 2014 Migeran Ltd. All rights reserved. 8

Our Journey – Strong Coupling

Releases withManual testing

Automated testsWith SWTBot

and JUnit

Prototype

Quality is not the main focus

Long QA Cycles,Stress

Tests are onlyreadable forDevelopers

● We have:

– Strong coupling ofspecification andimplementation oftests

● We need:

– Loose coupling

– Human readable testspecifications

– Still maintained bydevelopers

© 2014 Migeran Ltd. All rights reserved. 9

Define Features with Cucumber

● Cucumber: cukes.info

– BDD framework

– Feature specifications written in textual form

– Specification steps implemented in a programminglanguage

– Ports available for many languages: Ruby, Java,Javascript … etc.

© 2014 Migeran Ltd. All rights reserved. 10

Define Features with Cucumber (2)● Gherkin language:

– Easy to understand fornon-developers

– Separatesimplementation details

Step defnitions in plain Java

© 2014 Migeran Ltd. All rights reserved. 11

Editing Cucumber Feature Files

● Xgherkin: @Github

● Gherkin file editorbased on Xtext

● Created by:

Sebastian Benz

of Jnario fame

© 2014 Migeran Ltd. All rights reserved. 12

Sidebar: Jnario

● Jnario is an alternative to Cucumber

● Create executable specifications for

– Unit and integration tests

– Acceptance tests

● Built on Xtend

● Great tooling Check it out at: jnario.org

© 2014 Migeran Ltd. All rights reserved. 13

Mixing SWTBot with Cucumber

● Created an SWTBot runner for Cucumber

● Can be executed from Eclipse with the standardJUnit launcher

● Also works with Maven and Tycho

Acceptance Tests

Decoupled

© 2014 Migeran Ltd. All rights reserved. 14

Caveat: Hands Off while Running Tests

● Running SWTBot tests is sensitiveto external input events by theuser

– e.g. tests can fail if the testedwindow loses focus

Workaround: Run tests in a VM without

automatic input capture

© 2014 Migeran Ltd. All rights reserved. 15

Caveat: Test Execution Time

● We are simulating a real usageenvironment

– Executing test suites can takea long time

Workaround: Developers only run affected features

Full test suite executed by the CI server

© 2014 Migeran Ltd. All rights reserved. 16

Spicing the build with Tycho

● Project currently in Eclipse Incubation

● Build and test Eclipse Plugins on the commandline with Maven

● The glue between the PDE and CI servers

Our Pluginis ready

© 2014 Migeran Ltd. All rights reserved. 17

Mr. Jenkins will serve the results

● Use Jenkins CI

– Launch builds with Maven (and Tycho)

– Inspect the results of tests

Actual results from the Migeran 0.12

Release cycle

© 2014 Migeran Ltd. All rights reserved. 18

Tasting Time!

Tycho

© 2014 Migeran Ltd. All rights reserved. 19

Our Journey – So Far

Releases withManual testing

Automated testsWith SWTBot

and JUnit

Prototype

Automated testswith SWTBot

and Cucumber

BDD: New Features defined with Cucumber

Quality is notthe main focus

Long QA Cycles,Stress

Tests are onlyreadable forDevelopers

Tests createdafter the fact

We are here

© 2014 Migeran Ltd. All rights reserved. 20

Questions & Answers

● Migeran: migeran.com

– Create iOS Apps in Java

– Eclipse based IDE with Xcode integration

– Acceptance Tests created with SWTBot, Cucumber

– Jenkins & Tycho used for build automation

● Gergely Kis

– Email: gergely.kis@migeran.com

21

Thank you!

http://www.migeran.com© 2014 Migeran Ltd. All rights reserved.

top related