Your SlideShare is downloading. ×
0
Specs2 - Scala-Syd presentation
Specs2 - Scala-Syd presentation
Specs2 - Scala-Syd presentation
Specs2 - Scala-Syd presentation
Specs2 - Scala-Syd presentation
Specs2 - Scala-Syd presentation
Specs2 - Scala-Syd presentation
Specs2 - Scala-Syd presentation
Specs2 - Scala-Syd presentation
Specs2 - Scala-Syd presentation
Specs2 - Scala-Syd presentation
Specs2 - Scala-Syd presentation
Specs2 - Scala-Syd presentation
Specs2 - Scala-Syd presentation
Specs2 - Scala-Syd presentation
Specs2 - Scala-Syd presentation
Specs2 - Scala-Syd presentation
Specs2 - Scala-Syd presentation
Specs2 - Scala-Syd presentation
Specs2 - Scala-Syd presentation
Specs2 - Scala-Syd presentation
Specs2 - Scala-Syd presentation
Specs2 - Scala-Syd presentation
Specs2 - Scala-Syd presentation
Specs2 - Scala-Syd presentation
Specs2 - Scala-Syd presentation
Specs2 - Scala-Syd presentation
Specs2 - Scala-Syd presentation
Specs2 - Scala-Syd presentation
Specs2 - Scala-Syd presentation
Specs2 - Scala-Syd presentation
Specs2 - Scala-Syd presentation
Specs2 - Scala-Syd presentation
Specs2 - Scala-Syd presentation
Specs2 - Scala-Syd presentation
Specs2 - Scala-Syd presentation
Specs2 - Scala-Syd presentation
Specs2 - Scala-Syd presentation
Specs2 - Scala-Syd presentation
Specs2 - Scala-Syd presentation
Specs2 - Scala-Syd presentation
Specs2 - Scala-Syd presentation
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Specs2 - Scala-Syd presentation

949

Published on

This presentation was given to the Scala Sydney user group on Sep. 14th, 2011.

This presentation was given to the Scala Sydney user group on Sep. 14th, 2011.

Published in: Technology, Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
949
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
11
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. 2<br />specs<br />Go functional!<br />
  • 2. 2<br />specs<br />
  • 3. tour<br />importIncredibleStringReverser._<br />classReverserSpecextends Specification {<br />"a reversed empty string must be empty" in {<br /> reverse("") must_== ""<br /> }<br />"a reversed empty string must really *be empty*" in {<br /> reverse("") must be empty<br /> }<br />"a reversed string must be reversed abc -> cba" in {<br /> reverse("abc") must be_==("cba")<br /> }<br />"a longer string must also be reversed. Whoops!" in {<br /> reverse("abcdef") must be_==("xxxxx")<br /> }<br />}<br />
  • 4. tour<br />"a reversed empty string must be empty" in {<br /> reverse("") must be empty<br />}<br />
  • 5. tour<br />
  • 6. tour<br />
  • 7. Shame<br />
  • 8. Mutability<br />
  • 9. Concurrency<br />
  • 10. Acceptance<br />
  • 11. Why<br />The idea<br />User<br />Program<br />Design<br />
  • 12. Go Functional!<br />But what is it?!<br />
  • 13. Referential transparency<br /> Immutability<br />
  • 14. Processing data structures<br />FP<br />OO<br />pipelined<br />emergent<br />behavior<br />behavior<br />
  • 15. Why<br />The idea<br />User<br />Program<br />Design<br />
  • 16. Starting point<br />instructions != expressions<br />
  • 17. Nesting<br />Precedence:<br />+<br />!<br />^<br />
  • 18. Formatting<br />Text<br />Example<br />Text<br />Example<br />Example<br />
  • 19. Formatting<br />p<br />br<br />end<br />t, t(i)<br />bt, bt(i)<br />acceptance<br />
  • 20. Context<br />
  • 21. doBefore<br />withDb.apply(e2)<br />
  • 22. Why<br />The idea<br />User<br />Program<br />Design<br />
  • 23. Run<br />sequence<br />to text<br />levels<br />to html<br />arguments<br />select<br />statistics<br />execute<br />
  • 24. Laziness vs evaluation<br />
  • 25. Iterating<br />
  • 26. Traverse<br />the mapping<br />A data<br />structure to traverse<br />the accumulation<br />
  • 27. Applicative magic?<br />simple<br />Lots of instances:<br /><ul><li> State
  • 28. List
  • 29. Monad
  • 30. Monoid</li></ul>Type inference <br />is hard,<br />Let’s go shopping!<br />composable<br />
  • 31. Reducer<br />aggregation<br />mapping<br />specs2 reducers:<br /><ul><li> Levels
  • 32. Statistics
  • 33. Arguments
  • 34. Text
  • 35. Html</li></ul>“parallel” composition<br />
  • 36. Why<br />The idea<br />User<br />Program<br />Design<br />
  • 37. Trees<br />Suite<br />Description<br />Text<br />Test <br />Description 1<br />Test <br />Description 2<br />Example 1<br />Example 2<br />Suite<br />Description<br />fChildren = TD1, TD2<br />
  • 38. TreeLoc<br />
  • 39. TreeLoc<br /><body><br /><h1>Title 1</h1><br /><h2>part 1</h2><br /><h2>part 2</h2><br /><h1/><br /></body><br /><h2/><br /><h2/><br />Anti-XML<br />The non-violent solution<br />
  • 40. Concurrency<br />=> Promise[Seq[ExecutedFragment]]<br />a concurrent<br /> task<br />2.9.0<br />inside!<br />
  • 41. Exceptions<br />
  • 42. Exceptions<br />
  • 43. Exceptions<br />
  • 44. Mocks<br /><h1/><br />
  • 45. Mutability<br />Back for good<br />Nothing here!<br />Throws exception<br />
  • 46. Configuration<br />Part of the flow<br />nested ‘record’<br />named parameters + defaults<br />
  • 47. Configuration<br />Implicits<br />default <br />value<br />implicit <br />arguments<br />
  • 48. Watch out!<br />val in traits<br />recursivity<br />SOE<br />NPE<br />lost expressions<br />val (a,b) = c<br />Bug<br />Match Error<br />
  • 49. Conclusion<br /><ul><li> Reliability
  • 50. Concurrency
  • 51. Composition
  • 52. Less mocks
  • 53. val/vars
  • 54. DSL
  • 55. Type inference
  • 56. Learning curve
  • 57. Gotchas</li>

×