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
97
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
Dylib Hijacking on macOS: Dead or Alive?
patrickwardle
0
260
AIツールでどこまでデザインを忠実に実装できるのか
oikon48
6
3.5k
ガバメントクラウド(AWS)へのデータ移行戦略の立て方【虎の巻】 / 20251011 Mitsutosi Matsuo
shift_evolve
PRO
2
200
初めてのDatabricks Apps開発
taka_aki
1
130
All About Sansan – for New Global Engineers
sansan33
PRO
1
1.2k
WEBサービスを成り立たせるAWSサービス
takano0131
1
180
カンファレンスに託児サポートがあるということ / Having Childcare Support at Conferences
nobu09
1
600
能登半島地震で見えた災害対応の課題と組織変革の重要性
ditccsugii
0
1k
Data Hubグループ 紹介資料
sansan33
PRO
0
2.2k
これがLambdaレス時代のChatOpsだ!実例で学ぶAmazon Q Developerカスタムアクション活用法
iwamot
PRO
8
1.1k
ソースを読むプロセスの例
sat
PRO
15
9.2k
技育祭2025【秋】 企業ピッチ/登壇資料(高橋 悟生)
hacobu
PRO
0
110
Featured
See All Featured
A Modern Web Designer's Workflow
chriscoyier
697
190k
Stop Working from a Prison Cell
hatefulcrawdad
271
21k
GitHub's CSS Performance
jonrohan
1032
470k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
Agile that works and the tools we love
rasmusluckow
331
21k
The Straight Up "How To Draw Better" Workshop
denniskardys
238
140k
Why You Should Never Use an ORM
jnunemaker
PRO
59
9.6k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Writing Fast Ruby
sferik
629
62k
For a Future-Friendly Web
brad_frost
180
10k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.2k
Facilitating Awesome Meetings
lara
56
6.6k
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