In this talk you will learn about some of the approaches that you can take to effectively design and build native frameworks that behave consistently across platforms while leveraging each platform's native strengths and APIs. We'll go over the process all the way from designing a feature, to writing a feature specification, to a passing test suite for every platform.
15. A good spec:
• Captures what a feature is and how it should work (the "what" and "how")
16. A good spec:
• Captures what a feature is and how it should work (the "what" and "how")
• Describes a public interface
17. A good spec:
• Captures what a feature is and how it should work (the "what" and "how")
• Describes a public interface
• Provides context (the "why")
18. A good spec:
• Captures what a feature is and how it should work (the "what" and "how")
• Describes a public interface
• Provides context (the "why")
• Defines UML for the public API
20. # User login flow
Users should be able to login through the `UserApi` defined
in the framework. An instance of the `UserApi` is obtained
through `MyFramework.userApi`. Framework users can call
`UserApi.login(username, password)` to trigger a login. The
`login` method returns a `Promise` that's fulfilled when the
`login` call completes sucessfully or with a failure. In
case of `success` the caller receives an `AccessToken`. In
case of `failure` the caller receives a `LoginError`.
In case the user provides invalid credentials, the server
returns a `LoginError.invalidCredentials` error. This is
also true if `login` is called with empty credentials.
...
21. # User login flow
Users should be able to login through the `UserApi` defined
in the framework. An instance of the `UserApi` is obtained
through `MyFramework.userApi`. Framework users can call
`UserApi.login(username, password)` to trigger a login. The
`login` method returns a `Promise` that's fulfilled when the
`login` call completes sucessfully or with a failure. In
case of `success` the caller receives an `AccessToken`. In
case of `failure` the caller receives a `LoginError`.
In case the user provides invalid credentials, the server
returns a `LoginError.invalidCredentials` error. This is
also true if `login` is called with empty credentials.
...
The Happy Path
22. # User login flow
Users should be able to login through the `UserApi` defined
in the framework. An instance of the `UserApi` is obtained
through `MyFramework.userApi`. Framework users can call
`UserApi.login(username, password)` to trigger a login. The
`login` method returns a `Promise` that's fulfilled when the
`login` call completes sucessfully or with a failure. In
case of `success` the caller receives an `AccessToken`. In
case of `failure` the caller receives a `LoginError`.
In case the user provides invalid credentials, the server
returns a `LoginError.invalidCredentials` error. This is
also true if `login` is called with empty credentials.
...
The Happy Path
Failures and
exceptions
45. Given a valid username and password
When using these credentials to call the login service
46. Given a valid username and password
When using these credentials to call the login service
Then a valid token should be stored
47. Given a valid username and password
When using these credentials to call the login service
Then a valid token should be stored
Then the valid token should be surfaced to the caller of the login method.
50. Given a valid username and an invalid password
When using these credentials to call the login service
51. Given a valid username and an invalid password
When using these credentials to call the login service
Then the credentials error returned by the service should be surfaced to the
caller of the login method
54. Given a valid username and an empty password
When using these credentials to call the login service
55. Given a valid username and an empty password
When using these credentials to call the login service
Then the credentials error returned by the service should be surfaced to the
caller of the login method
58. Given a empty username and an empty password
When using these credentials to call the login service
Then the credentials error returned by the service should be surfaced to the
caller of the login method
61. Given a empty username and an non-empty password
When using these credentials to call the login service
Then the credentials error returned by the service should be surfaced to the
caller of the login method
65. Focus during the review phase
• Ensure that the spec is clear
• Test links to the documentation and compare them to the written spec
66. Focus during the review phase
• Ensure that the spec is clear
• Test links to the documentation and compare them to the written spec
• Review the UML for correctness
67. Focus during the review phase
• Ensure that the spec is clear
• Test links to the documentation and compare them to the written spec
• Review the UML for correctness
• Check that the feature is possible within your platform
68. Focus during the review phase
• Ensure that the spec is clear
• Test links to the documentation and compare them to the written spec
• Review the UML for correctness
• Check that the feature is possible within your platform
• Validate the tests and make sure they're complete
69. Focus during the review phase
• Ensure that the spec is clear
• Test links to the documentation and compare them to the written spec
• Review the UML for correctness
• Check that the feature is possible within your platform
• Validate the tests and make sure they're complete
• Make sure that at least one member from every platform reviews and
approves
72. During the implementation phase
• Every team will work on the features at roughly a different time
• Versioning does not have to be identical within teams
73. During the implementation phase
• Every team will work on the features at roughly a different time
• Versioning does not have to be identical within teams
• Make sure that every team can work at their own pace
74. During the implementation phase
• Every team will work on the features at roughly a different time
• Versioning does not have to be identical within teams
• Make sure that every team can work at their own pace
• Just make sure that big deadlines are delivered in time
77. Summary
• Make sure you write feature specs that cover public APIs.
• A feature spec should cover the what, how and why without dictating
implementation details that aren't relevant to all platforms.
78. Summary
• Make sure you write feature specs that cover public APIs.
• A feature spec should cover the what, how and why without dictating
implementation details that aren't relevant to all platforms.
• Add Gherkin tests as a means of testing. This allows you to capture a minimum set
of tests that can be used while implementing a feature and aids a TDD approach
towards development.
79. Summary
• Make sure you write feature specs that cover public APIs.
• A feature spec should cover the what, how and why without dictating
implementation details that aren't relevant to all platforms.
• Add Gherkin tests as a means of testing. This allows you to capture a minimum set
of tests that can be used while implementing a feature and aids a TDD approach
towards development.
• Make sure to cross your t-s and dot your i-s during the review phase. You want at
least one review from a team member of each platform.
80. Summary
• Make sure you write feature specs that cover public APIs.
• A feature spec should cover the what, how and why without dictating
implementation details that aren't relevant to all platforms.
• Add Gherkin tests as a means of testing. This allows you to capture a minimum set
of tests that can be used while implementing a feature and aids a TDD approach
towards development.
• Make sure to cross your t-s and dot your i-s during the review phase. You want at
least one review from a team member of each platform.
• Allow platforms to diverge and work at their own pace. It's okay if feature sets
temporarily differ as long as deadlines are met.