Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Splat

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on.

 Splat

FYP research

Avatar for evandrix

evandrix

June 29, 2012
Tweet

More Decks by evandrix

Other Decks in Technology

Transcript

  1. Motivation • writing unit tests ‣ crucial ‣ costly but

    invisible ‣ can be automated 3 3 Saturday, 3 November, 12
  2. • dynamically typed • clean, concise & elegant syntax •

    builtin introspection & reflection facility 4 4 Saturday, 3 November, 12
  3. Why bytecode? • “Growing numbers of... closed source applications... using...Python...”

    (Smith, 2010) • simple • fast 5 5 Saturday, 3 November, 12
  4. Existing tools • Ruby Test case Generator (RuTeG) ‣ structural

    testing ‣ evolutionary search ‣ tests object-oriented programs 8 8 Saturday, 3 November, 12
  5. Lazy instantiation • technique inspired by IRULAN • initially: None

    proxy metaclass wrapper • test data only generated for active variables 13 13 Saturday, 3 November, 12
  6. 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
  7. 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
  8. 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
  9. 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
  10. 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
  11. 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
  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
  13. Challenges • Vague error messages • Lack of existing tool

    support • Test program contains imports 24 24 Saturday, 3 November, 12
  14. Challenges • Relationship between input arguments • Various programming constructs

    • Range of test data values 25 25 Saturday, 3 November, 12
  15. Future work • improve tool sophistication • optimise using PyPy

    • more comprehensive benchmarks 32 32 Saturday, 3 November, 12