Separating the boys from the MEN

A Introduction to TDD in Android

TDD defined

  • Decide what the code will do
  • Write a test that will pass if the code does that thing
  • Run the test, see it fail
  • Write the code
  • Run the test, see it pass

TDD provides?

  • Design and plan before we code
  • Document the design before building it
  • Proof that the code implements the design
  • Encourages the design of testable code

Testable code is?

  • modular (in modules) - breaks things down so that we can test them
  • Decoupled design - if our objects or methods are too tightly interwoven, we cannot test them independently
  • methods of limited scope - not doing too much in one place

Pillars of Software Engineering

  • architecture

  • convention and standards

  • version control

  • coordination (agile, etc)

  • Test Driven development

WHY?

This is what seperates developers, programmers from software engineers.

Types of Testing

  • Unit Tests
  • Integration Tests
  • End-to-end Testing

Testing Tools in Android

  • Espresso : UI testing
  • Robotium : UI Testing
  • Roboelectric : Unit Testing
  • Mockito : Unit testing
  • JUnit4 : Unit Testing
  • Android Testing Support Library

 

Testing works well with modularized code!!

  • Model View Presenter 
  • Feature-Based Approach
Made with Slides.com