Compiler Based Testing

Compiler Based Testing

Cf95f93e78f6d6dd0630049396f723c6?s=128

Xavier Gouchet

April 03, 2019
Tweet

Transcript

  1. 2.

    @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. 5.

    @xgouchet Basic use case — JSON { "id" : 481516,

    "title" : "Lorem ipsum dolor sit amet…", "picture" : "https://cloudhost.com/5162342", "created": 1553631328 } 5
  3. 6.

    @xgouchet Basic use case — App Model data class Event(

    val id: Int, val title: String, val picture: String, val created: Int } 6
  4. 8.

    @xgouchet Use existing types ▧ Integrated in framework and libraries

    ▧ Zero additional work data class Event( … val created: Date } 8
  5. 9.

    @xgouchet Type Alias ▧ Give context ▧ Prevent invalid assignements

    ▧ Ease Maintenance typealias Id = Int data class Event( val id: Id, … } 9
  6. 10.

    @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