Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Delivering next billion apps through behaviours

30 views

Published on

Delivering next billion apps through behaviours

Published in: Software
  • Be the first to comment

  • Be the first to like this

Delivering next billion apps through behaviours

  1. 1. Delivering next billion apps through Behavior's Somashekar Tatavarthi 15 Nov 2018
  2. 2. Contents • Insight • Problems with current life cycle • Mindset Shift in R&D teams • Intro to TDD (Test driven development) • Intro to BDD (Behavior driven development) • Common domain language • Mobile frameworks • Comparison study on frameworks • Short Demo with multiple frameworks • Q&A
  3. 3. Insight Business Team: “Are we building the right product.” Development Team: “Are we building the product right.” Verification: Unit Tests confirm that you built it right (INSIDE OUT) Validation: Acceptance Tests confirm that you build the right thing (OUTSIDE IN)
  4. 4. Problems with current life cycle • “do your part” and throw it “over the wall” to those coming next. • Testing comes at the end • Less time for Testing
  5. 5. Shift in Mindset Test Driven development: • “We produce well-designed, well-tested, and well-factored code in small, verifiable steps.” (The Art of Agile Development, p. 289) • Write your tests before your code - Implementation (“does it work?”) - Design (“is it well structured?”) • You need - Unit Testing frameworks - Mocking frameworks
  6. 6. Shift in Mindset Benefits of TDD: • Benefits of writing tests: • Clarify acceptance criteria for implementation (“when is this implementation good enough?”) • Encouragement to write loosely coupled components • Adds executable description of what code does • It adds up to regression suite
  7. 7. Shift in Mindset Drawbacks of TDD: • TDD feels tedious / mechanical in the beginning • TDD takes time to master in team (a few months) • TDD is difficult to apply to legacy code without unit tests, because: • In order to add to / refactor legacy code, unit tests are required • In order to write unit tests, the legacy code needs to be refactored
  8. 8. Shift in Mindset Behavioral Driven Development • Behavior Driven Development is about implementing an application by describing its behavior from the perspective of its stakeholders/end users. • Behavior Driven Development is a disciplined technique for building software in which the product owner, a programmer and a tester collaborate on system behavior, also known as acceptance criteria.
  9. 9. BDD • Behavior-Driven Development is the process of: • Capturing acceptance criteria in a human-readable language • Using tools and manual coding to make that language executable • Using the executable specification to guide implementation • Frequently running the executable specification to prevent regression • Difficulties with writing/maintaining tests • Difficulties understanding the place of BDD in the development process
  10. 10. Common domain languages Gherkin and Cucumber: Gherkin is plain-text English with a little extra structure. Gherkin is designed to be easy to learn by non-programmers. Gherkin is Business Readable, Domain specific language created especially for behavior descriptions. Gherkin is language cucumber understands Gherkin’s scenario structure: <user story>.feature Feature: <user story title> <Description of user story> Scenario: <user scenario> Given <some initial context> When <an event occurs> Then <ensure some outcomes>
  11. 11. Android/IOS BDD Frameworks • Cucumber • designed for scenario implementation • Describe behavior in plain text • Cucumber works with Ruby, Java, .NET, Flex or web applications written in any language Code snippet for JAVA: @CucumberOptions(features = "features") public class <userstory> extends InstrumentationTest<MainActivity> { // Setup methods .... @Given("^initial context of app$") // pre condition methods @When("^user actions$") // user actions can be used any tool which supports Cucumber @Then("^Expected behaviors$") // Expected behavior or assertions }
  12. 12. BDD Framework Frameworks and tools: • Espresso • Calabash • Appium • Robotium • UIAutomator
  13. 13. Benefits: • Requirements becomes easy to understand and communicate • Gives detailed executable specifications • Implementing changes more efficiently • Quick and concrete feedback • Will help in preventing bugs rather than finding. • Higher product quality • Less rework • Better work alignment to priority • Defects after deployment are rare and non critical Collaboration is every thing Evolutionary Design Generate ROI Right Focus
  14. 14. Challenges • BDD is mindset, not set of tools • Need support from stakeholders • “Shifting from Thinking in ‘Test’ to thinking in ‘Behavior’” • Tools are immature • May not be suitable for all project types • Make sure all features are broken down into sufficiently small chunks
  15. 15. DEMO

×