Giter Site home page Giter Site logo

testing-notes's Introduction

Testing-Notes

Contains notes on software testing.

There are various types of testing, like Unit, Integration and Functional(E2E) testing.

In a gist

  • Unit Testing -> For testing any small piece of code
  • Integration Testing -> For testing any small component of the application
  • Functional Testing -> For testing the complete flow of the application(Basically automating the manual testing/ replicating the user actions)

Unit Testing

  • Generally for testing small piece of code, isolated and alone.
  • If writing unit test is hard then it means your code is poorly designed. So it also helps in writing better code.
  • They are also great for preventing regressions - bugs that occur repeatedly.
  • Unit testing is used in TDD. Its like a backbone.
  • If an app needs to make a successful database connection then it can't be tested with unit testing.
  • In procedural code, the units are often functions, in object oriented code, the units are classes.
  • They are fast + cheap.

Integration Testing

  • Its to test how parts of the system work together - the integration of the parts.
  • It's similar to unit test with one difference: while unit tests are isolated from other components, integration tests are not.
  • They are complex and slower compared to unit test.
  • You should have fewer integration test compared to unit test.
  • If an app needs to make a successful database connection then it can be tested in integration testing.
  • They are slow + expensive

Functional Testing

  • Testing the complete functionality of the application by using some tool to automated a browser/mobile.
  • Do not make them fine-grained, as they can become a nightmare to maintain.
  • They are used when you want to test a complete flow like registering a user, making a payment and redirecting to proper pages, etc
  • They are slow + expensive
  • They require less maintenance and cover a bigger part of your application with saving you a lot of time.

Testing on Android

There are three types on android

  1. Unit(test) - JUnit5/ Mockito
  2. Intrumentation(androidTest) - JUnit/ Mockito
  3. UI(androidTest) - Expresso(Internal)/ Appium(External)

1. Unit

  • Runs on Local Computer
  • It runs on JVM
  • Very fast because emulator is not needed.
  • It's for testing java code

2. Intrumentation

  • Similar to local unit tests
  • Used for testing android specific stuff like activity, fragments, context, serviecs, etc
  • Need to run on real device or emulator(Roboelectric is used if you don't want to run it on emulator)

3. UI

  • Simulates the user flow
  • Tests the complete user journey from high level

Mockito

  • Mocks the RestAPI/Database part in the methods/functions

Espresso vs Appium

Criteria Espresso Appium
Language Java Many(Java, Python, Javascript, any that can make HTTP request)
Supports Android Only Web, Android and iOS
Testing Philosopy Grey Box Black Box
Speed Fast Slow compared to Espresso
Ease Of Setup Easy Hard
Dependencies On Code Yes No
Ease Of Writing Tests Easy for devs Easy for testers
Backers Goolge Open Source
Suitable For Android devs Testers/ QA testing Android & iOS apps

Resources

Official Docs

Misc

Videos

Podcasts

Books

testing-notes's People

Contributors

bhavyakaria avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.