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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
evandrix
June 29, 2012
Technology
100
1
Share
Splat
FYP research
evandrix
June 29, 2012
More Decks by evandrix
See All by evandrix
Finding a Way Out
evandrix
0
49
Floating Point Consistency
evandrix
1
48
Other Decks in Technology
See All in Technology
20260423_執筆の工夫と裏側 技術書の企画から刊行まで / From the planning to the publication of technical book
nash_efp
2
360
20年前の「OSS革命」に学ぶ AI時代の生存戦略
samakada
0
320
基盤を育てる 外部SaaS連携の運用
gamonges_dresscode
1
110
Snowflake Intelligence導入で 分かった活用のコツ
wonohe
0
130
Revisiting [CLS] and Patch Token Interaction in Vision Transformers
yu4u
0
340
AI時代 に増える データ活用先
takahal
0
180
Introduction to Bill One Development Engineer
sansan33
PRO
0
410
目的ファーストのハーネス設計 ~ハーネスの変更容易性を高めるための優先順位~
gotalab555
8
2k
自分のハンドルは自分で握れ! ― 自分のケイパビリティを増やし、メンバーのケイパビリティ獲得を支援する ― / Take the wheel yourself
takaking22
1
850
マルチエージェント × ハーネスエンジニアリング × GitLab Duo Agent Platformで実現する「AIエージェントに仕事をさせる時代へ。」 / 20260421 GitLab Duo Agent Platform
n11sh1
0
140
Introduction to Sansan Meishi Maker Development Engineer
sansan33
PRO
0
390
[最強DB講義]推薦システム | 基礎編
recsyslab
PRO
1
160
Featured
See All Featured
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
740
Fireside Chat
paigeccino
42
3.9k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.8k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
280
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
110
Between Models and Reality
mayunak
3
260
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
250
A Tale of Four Properties
chriscoyier
163
24k
A Modern Web Designer's Workflow
chriscoyier
698
190k
Git: the NoSQL Database
bkeepers
PRO
432
67k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
Balancing Empowerment & Direction
lara
6
1.1k
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