3. Our first requirement as a Scala
developer
• We work for an analytics company.
• As a user I would like to see if bad or good things are being said about
Trump and where.
最初の案件 : トランプ大統領の風評分
6. After some investigation...
• Spark for stream processing.
• Stanford CoreNLP for Sentiment Analysis.
• Kafka for communication between servers.
• Avro4s for Avro serialization.
各要素の役割
17. Testing it
• Deploy to some development environment and test.
開発環境にデプロイしてテス
ト
18. Testing it
• Deploy to some development environment and test.
• Refactor the code.
リファクタリン
19. Improving our first approach
• Try to look only for your Business Logic.
• Separate from the specifics of your implementation.
ビジネスロジックを分離
20.
21. Our Business Logic
• Filter the tweets that are not written in English.
• Obtain the location from where the tweet was sent.
• Analyze the text to extract the sentiment.
• Return a new instance of type Tweet.
• Extra: Refactor the Avro serialization.
英語の tweet のみ抽出、ロケーションの取得、テキストから感情を分
析、
25. And test!
• You can now test ONLY your Business Logic without caring about your
implementation (In this case Spark).
• Use your choice of testing framework. ScalaTest, Specs2, µTest,
Puretest, minitest...
実装に依存しないビジネスロジックのテストができました。