Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Splat
Search
evandrix
June 29, 2012
Technology
1
96
Splat
FYP research
evandrix
June 29, 2012
Tweet
Share
More Decks by evandrix
See All by evandrix
Finding a Way Out
evandrix
0
47
Floating Point Consistency
evandrix
1
44
Other Decks in Technology
See All in Technology
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
9
73k
品質視点から考える組織デザイン/Organizational Design from Quality
mii3king
0
200
スマートファクトリーの第一歩 〜AWSマネージドサービスで 実現する予知保全と生成AI活用まで
ganota
2
220
AI時代を生き抜くエンジニアキャリアの築き方 (AI-Native 時代、エンジニアという道は 「最大の挑戦の場」となる) / Building an Engineering Career to Thrive in the Age of AI (In the AI-Native Era, the Path of Engineering Becomes the Ultimate Arena of Challenge)
jeongjaesoon
0
160
COVESA VSSによる車両データモデルの標準化とAWS IoT FleetWiseの活用
osawa
1
290
大「個人開発サービス」時代に僕たちはどう生きるか
sotarok
20
10k
Platform開発が先行する Platform Engineeringの違和感
kintotechdev
4
570
複数サービスを支えるマルチテナント型Batch MLプラットフォーム
lycorptech_jp
PRO
1
380
開発者を支える Internal Developer Portal のイマとコレカラ / To-day and To-morrow of Internal Developer Portals: Supporting Developers
aoto
PRO
1
460
なぜスクラムはこうなったのか?歴史が教えてくれたこと/Shall we explore the roots of Scrum
sanogemaru
5
1.6k
Codeful Serverless / 一人運用でもやり抜く力
_kensh
7
430
JTCにおける内製×スクラム開発への挑戦〜内製化率95%達成の舞台裏/JTC's challenge of in-house development with Scrum
aeonpeople
0
230
Featured
See All Featured
4 Signs Your Business is Dying
shpigford
184
22k
Six Lessons from altMBA
skipperchong
28
4k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
50k
Agile that works and the tools we love
rasmusluckow
330
21k
Faster Mobile Websites
deanohume
309
31k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
The Power of CSS Pseudo Elements
geoffreycrofte
77
6k
GraphQLとの向き合い方2022年版
quramy
49
14k
For a Future-Friendly Web
brad_frost
180
9.9k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
188
55k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
jQuery: Nuts, Bolts and Bling
dougneiner
64
7.9k
Transcript
Splat: Simple Python Lazy Automated Tester Lee Wei Yeong
[email protected]
tiny.cc/lwy08 1 Saturday, 3 November, 12
Introduction 2 2 Saturday, 3 November, 12
Motivation • writing unit tests ‣ crucial ‣ costly but
invisible ‣ can be automated 3 3 Saturday, 3 November, 12
• dynamically typed • clean, concise & elegant syntax •
builtin introspection & reflection facility 4 4 Saturday, 3 November, 12
Why bytecode? • “Growing numbers of... closed source applications... using...Python...”
(Smith, 2010) • simple • fast 5 5 Saturday, 3 November, 12
Background 6 6 Saturday, 3 November, 12
Existing tools • Pythoscope • Pytestsgenerator • ...but neither works!
7 7 Saturday, 3 November, 12
Existing tools • Ruby Test case Generator (RuTeG) ‣ structural
testing ‣ evolutionary search ‣ tests object-oriented programs 8 8 Saturday, 3 November, 12
Software testing 9 9 Saturday, 3 November, 12
Sample test target 10 10 Saturday, 3 November, 12
Sample unit test 11 11 Saturday, 3 November, 12
SPLAT 12 12 Saturday, 3 November, 12
Lazy instantiation • technique inspired by IRULAN • initially: None
proxy metaclass wrapper • test data only generated for active variables 13 13 Saturday, 3 November, 12
Lazy instantiation 14 14 Saturday, 3 November, 12
Lazy instantiation 15 LOAD_GLOBAL (A) CALL_FUNCTION 0 STORE_FAST (arg1) LOAD_CONST
(‘arg1’) LOAD_FAST (arg1) STORE_ATTR (attr1) LOAD_FAST (arg1) RETURN_VALUE 15 Saturday, 3 November, 12
Lazy instantiation 16 LOAD_GLOBAL (A) CALL_FUNCTION 0 STORE_FAST (arg1) LOAD_CONST
(‘arg1’) LOAD_FAST (arg1) STORE_ATTR (attr1) LOAD_FAST (arg1) RETURN_VALUE function1 ( Param1(None), Param2(None), Param3(None) ) 16 Saturday, 3 November, 12
Lazy instantiation 17 LOAD_GLOBAL (A) CALL_FUNCTION 0 STORE_FAST (arg1) LOAD_CONST
(‘arg1’) LOAD_FAST (arg1) STORE_ATTR (attr1) LOAD_FAST (arg1) RETURN_VALUE function1 ( Param1(None), Param2(None), ‘default’ ) 17 Saturday, 3 November, 12
Lazy instantiation 18 LOAD_GLOBAL (A) CALL_FUNCTION 0 STORE_FAST (arg1) LOAD_CONST
(‘arg1’) LOAD_FAST (arg1) STORE_ATTR (attr1) LOAD_FAST (arg1) RETURN_VALUE function1 ( Param1(None), Param2(None), ‘default’ ) 18 Saturday, 3 November, 12
Lazy instantiation 19 LOAD_GLOBAL (A) CALL_FUNCTION 0 STORE_FAST (arg1) LOAD_CONST
(‘arg1’) LOAD_FAST (arg1) STORE_ATTR (attr1) LOAD_FAST (arg1) RETURN_VALUE TypeError! 19 Saturday, 3 November, 12
Lazy instantiation 20 LOAD_GLOBAL (A) CALL_FUNCTION 0 STORE_FAST (arg1) LOAD_CONST
(‘arg1’) LOAD_FAST (arg1) STORE_ATTR (attr1) LOAD_FAST (arg1) RETURN_VALUE function1 ( { ‘attr1’: Param1_attr1(None) }, Param2(None), ‘default’ ) 20 Saturday, 3 November, 12
Lazy instantiation 21 LOAD_GLOBAL (A) CALL_FUNCTION 0 STORE_FAST (arg1) LOAD_CONST
(‘arg1’) LOAD_FAST (arg1) STORE_ATTR (attr1) LOAD_FAST (arg1) RETURN_VALUE function1 ( { ‘attr1’: Param1_attr1(None) }, None, ‘default’ ) 21 Saturday, 3 November, 12
Demonstration 22 22 Saturday, 3 November, 12
Architecture 23 23 Saturday, 3 November, 12
Challenges • Vague error messages • Lack of existing tool
support • Test program contains imports 24 24 Saturday, 3 November, 12
Challenges • Relationship between input arguments • Various programming constructs
• Range of test data values 25 25 Saturday, 3 November, 12
Limitations • Custom Exceptions, e.g. InvalidGraphType • Random functions •
Generators 26 26 Saturday, 3 November, 12
Evaluation 27 27 Saturday, 3 November, 12
Criteria • Quality • Performance • Generality 28 28 Saturday,
3 November, 12
Results 29 Python package # 29 Saturday, 3 November, 12
Results 30 Mean number of iterations to achieve 100% coverage
= 497 30 Saturday, 3 November, 12
Conclusion 31 31 Saturday, 3 November, 12
Future work • improve tool sophistication • optimise using PyPy
• more comprehensive benchmarks 32 32 Saturday, 3 November, 12
evandrix.github.com/Splat 33 Saturday, 3 November, 12