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
90
Splat
FYP research
evandrix
June 29, 2012
Tweet
Share
More Decks by evandrix
See All by evandrix
Finding a Way Out
evandrix
0
46
Floating Point Consistency
evandrix
1
41
Other Decks in Technology
See All in Technology
これまでの計測・開発・デプロイ方法全部見せます! / Findy ISUCON 2024-11-14
tohutohu
3
370
iOSチームとAndroidチームでブランチ運用が違ったので整理してます
sansantech
PRO
0
150
飲食店データの分析事例とそれを支えるデータ基盤
kimujun
0
160
Adopting Jetpack Compose in Your Existing Project - GDG DevFest Bangkok 2024
akexorcist
0
110
Flutterによる 効率的なAndroid・iOS・Webアプリケーション開発の事例
recruitengineers
PRO
0
120
強いチームと開発生産性
onk
PRO
35
11k
The Role of Developer Relations in AI Product Success.
giftojabu1
0
130
AWS Lambdaと歩んだ“サーバーレス”と今後 #lambda_10years
yoshidashingo
1
180
Taming you application's environments
salaboy
0
190
【令和最新版】AWS Direct Connectと愉快なGWたちのおさらい
minorun365
PRO
5
760
初心者向けAWS Securityの勉強会mini Security-JAWSを9ヶ月ぐらい実施してきての近況
cmusudakeisuke
0
130
OCI Network Firewall 概要
oracle4engineer
PRO
0
4.2k
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.7k
Imperfection Machines: The Place of Print at Facebook
scottboms
265
13k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
0
100
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
420
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
329
21k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
Side Projects
sachag
452
42k
Docker and Python
trallard
40
3.1k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
44
2.2k
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