Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥

Compiler Based Testing

Compiler Based Testing

Xavier Gouchet

April 03, 2019
Tweet

More Decks by Xavier Gouchet

Other Decks in Programming

Transcript

  1. @xgouchet About me… Xavier F. Gouchet Android developer since the

    Cupcake years Lead Android Engineer at WorkWell @xgouchet on every social network you can think of… 2
  2. @xgouchet Basic use case — JSON { "id" : 481516,

    "title" : "Lorem ipsum dolor sit amet…", "picture" : "https://cloudhost.com/5162342", "created": 1553631328 } 5
  3. @xgouchet Basic use case — App Model data class Event(

    val id: Int, val title: String, val picture: String, val created: Int } 6
  4. @xgouchet Use existing types ▧ Integrated in framework and libraries

    ▧ Zero additional work data class Event( … val created: Date } 8
  5. @xgouchet Type Alias ▧ Give context ▧ Prevent invalid assignements

    ▧ Ease Maintenance typealias Id = Int data class Event( val id: Id, … } 9
  6. @xgouchet Type Checking ▧ Limit Primitive Scope ▧ Validate data

    data class Url(val value: String) { init { val parsedUrl = URL(value) } } data class Event( … val picture: Url } 10