レッツ!google apps scriptでtdd(仮)

23
レッツ!Google Apps Scriptで TDD(仮)

Upload: kei-sawada

Post on 21-Jan-2015

3.871 views

Category:

Technology


0 download

DESCRIPTION

#llplanet(Lightweight Language Planets) でのLT資料

TRANSCRIPT

Page 1: レッツ!Google Apps ScriptでTDD(仮)

レッツ!Google Apps ScriptでTDD(仮)

Page 2: レッツ!Google Apps ScriptでTDD(仮)

このLTを、全てのVBAチルドレンに捧げる

Page 3: レッツ!Google Apps ScriptでTDD(仮)

Option Explicit

Private Type Hogehogename as Stringid as Stringvba_children as Boolean

End TypePrivate me as Hogehoge

Private Sub Class_Initialize()me.name = “Kei Sawada”me.id = “remore”me.vba_children = true

End Sub

Private Property Get name() as Stringname = me.name

End Property

Private Property Let name( ByVal entry as String)me.name = entry

End Property

圧倒的な不思議感

※注 2001年当時の知識で書いています。今はどうなんだろう。。

Page 4: レッツ!Google Apps ScriptでTDD(仮)

MS OfficeにはそんなVBAがあった。

Page 5: レッツ!Google Apps ScriptでTDD(仮)

GoogleDocsはどうか

Page 6: レッツ!Google Apps ScriptでTDD(仮)

サーバサイドjavascript

Page 7: レッツ!Google Apps ScriptでTDD(仮)

ブラウザベースのIDE

Page 8: レッツ!Google Apps ScriptでTDD(仮)

期待しちゃっていいの

Page 9: レッツ!Google Apps ScriptでTDD(仮)

@t_wadaが唱えるソフトウェア開発の3本柱

バージョン管理 △内蔵機能で簡単なバージョ

ン管理が可能

テスティング ▲選択肢は少ないがテスティングフレームワークがある

自動化 ▲ 頑張れば少しだけできる

Page 10: レッツ!Google Apps ScriptでTDD(仮)

実証実験

Page 11: レッツ!Google Apps ScriptでTDD(仮)

前提条件

Limitations1. Currently Google Apps Script does not allow connection to internal (behind-the-

firewall) corporate databases, which is key to building business apps. Similarly, lack of other connectivity, such as LDAP connectivity, limits the level to which GAS can be used in the enterprise.⇒ファイアウォール越しの通信ができない。例えばLDAPとの接続とかも無理

2. There is no way to share scripts i.e. a new instance has be created for each use.[5] This creates overhead when it is time to update a script, since each instance has to be update manually.⇒スクリプトの共有ができない(※訳注 といいつつ、やりようは結構ある)

3. UI Widgets in Google Apps Script lack support for displaying HTML formatted content.[6] This severely limits the formatting of text displayed in a Google Apps Script app.⇒UI WidgetsあるけどHTML形式のコンテンツ表示とかできない(※訳注 といいつつ、Google Sitesを動的に編集すれば表示できなくもないか)

http://en.wikipedia.org/wiki/Google_Apps_Script

Page 12: レッツ!Google Apps ScriptでTDD(仮)

1、バージョン管理:

△(何とかできる、というかやる)

Page 13: レッツ!Google Apps ScriptでTDD(仮)

内蔵機能でバージョン管理

Page 14: レッツ!Google Apps ScriptでTDD(仮)

それか、UrlFetchAppとeval()で外部管理

Page 15: レッツ!Google Apps ScriptでTDD(仮)

2、テスティング:

▲(使い易くはないが無理矢理やる)

Page 16: レッツ!Google Apps ScriptでTDD(仮)

既存のjavascript用テスティングフレームワークの多くはそのまま使いづらい

Page 17: レッツ!Google Apps ScriptでTDD(仮)

1,870件

Page 18: レッツ!Google Apps ScriptでTDD(仮)

案1:gas-unit

http://code.google.com/p/gas-unit/

Page 19: レッツ!Google Apps ScriptでTDD(仮)

案2:テスティングフレームワークもどきを作る

https://github.com/remore/framework_experiment

Page 20: レッツ!Google Apps ScriptでTDD(仮)

3、自動化:▲(できないことをやろうとする)

Page 21: レッツ!Google Apps ScriptでTDD(仮)

実演

Page 22: レッツ!Google Apps ScriptでTDD(仮)

いい夢見ました

http://dic.yahoo.co.jp/dsearch?p=%E3%82%86%E3%82%81&stype=0&dtype=0

Page 23: レッツ!Google Apps ScriptでTDD(仮)

おわり