Jython for Embedded Software Validation
Upcoming SlideShare
Loading in...5

Like this? Share it with your network


Jython for Embedded Software Validation



Presented at Pycon italy 2010

Presented at Pycon italy 2010



Total Views
Views on SlideShare
Embed Views



4 Embeds 13

http://www.linkedin.com 8
http://www.slideshare.net 3
http://www.lmodules.com 1
https://www.linkedin.com 1



Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

Jython for Embedded Software Validation Presentation Transcript

  • 1. Jython for Embedded Software Validation
    Raniero Virgilio
    Pycon Quattro, 8/5/2010
  • 2. Raniero Virgilio
    My Job
    Software Engineer in Intel Shannon, Ireland
    Responsible for Test Automation infrastructure
    My Team
    PPD (Performance Product Division)
    Embedded Software
    Complete SOCs for security, communications, storage and embedded designs
  • 3. Agenda
    Validation in embedded systems
    Runtime Plug-in model
    Runtime Plug-in model with Jython
    Jython and Eclipse
  • 4. Validation in embedded systems
    A challenging environment
    Typical scenario
    Requirements and solutions
  • 5. A challenging environment
    Multiple hw/sw deployments
    Configuration set up needs to be fast and reliable
    Support for different OS types and versions
    Consistent cooperation
    Several teams working on the same infrastructure
    Synchronization with overseas groups
  • 6. Test Automation scenario
    XML-RPC session
    Server1 (Windows)
    Traffic Generator 1
    XML-RPC session
    Traffic Generator 2
    Server2 (Windows)
    Telnet session
    Test Execution
    Telnet session
    Telnet session
  • 7. Test Automation requirements
    Programming language
    Libraries for connectivity and string manipulation
    Test Framework design
    OOP to maximize reusability of test code
    Platform runtime extendibility
    Sustainable implementation
    An effective interface between test execution (local to DUT) and test reporting (distributed)
    Customizable open source solution
  • 8. Proposed solution
    Programming language
    telnetlib, xmlrpclib, SimpleXMLRPCServer
    Test Framework design
    Runtime plug-in model
    Sustainable implementation
    Jython embedded in Eclipse
    Jython is a Python interpreter written in 100% pure Java
  • 9. Runtime plug-in model
    Design Pattern
  • 10. Runtime Plug-in Model
    The term plug-in refers to a type of program that contributes code to the system and adds a special capability to it.
    The plug-in is unknown at compile-time of the application for which the plug-in is designed.
    Plug-ins are dynamically plugged into the application they are designed for at runtime
    The key for this model is Dynamic Code Loading
  • 11. Design Pattern
    • Extendibility
    • 12. Application capabilities are defined by the supported Plug-in
    • 13. Plug-in can be loaded and unloaded at runtime
    • 14. Plug-in development
    • 15. Each Plug-in shall implement a specified interface
    • 16. The plug-in delegates the Application for high-level services
    • 17. Parallel life-cycle
    • 18. Application and Plug-ins can be developed independently
  • Runtime Plug-in Model with Jython
    Dynamic code loading in Java and Jython
  • 19. Dynamic code loading in Java
    • Runtime source compilation
    • 20. StandardJavaFileManager handles the source code
    • 21. JavaCompiler executes the compilation and creates a class file
    • 22. DiagnosticCollector gathers compilation information
    • 23. Class file deployment
    • 24. A new Classloader has to be defined
    • 25. It need to extend the previous one with the new class file
  • 26. Dynamic code loading in Jython
    • One step task
    • 27. The PluginHandler instantiates one PythonInterpreter
    • 28. The Plug-in path is added in the PythonInterpretersys.path
    • 29. The Plug-in is imported in the embedded Python environment
    • 30. Lower complexity
    • 31. Implementation is much easier
    • 32. Code can be modified “on-the-fly” and reloaded
    • 33. First time Plug-in loading is usually quicker on Jython
  • 34. Multithreaded environment
    • Parallel PluginHandlers
    • 35. Independent Jython environments’ setups
    • 36. Each PluginHandler defines an autonomous environment
    Java Thread
    • Multiple task execution
    • 37. When PluginHandler invokes a run() the execution is encapsulated in a Java Thread
    • 38. Plug-ins expand the application concurrently
  • 39. Jython and Eclipse
    XTP architecture
    The Execution Engines
    The JythonExchanger
  • 40. The eXtendible Test Platform (XTP)
  • 41. The Execution Engine in XTP
    • XTP
    • 42. provides high-level test services (logging, reporting, multithreading) and an interface with frontend
    • 43. Execution Engine
    • 44. a self-contained software package, written in Python, that implements the actual test logic and expands XTP enabling communication of the test platform with DUTs, servers and test equipments
  • Plugging an Execution Engine
    XML-based Manifest
    • A PythonInterpreteris created by XTP
    • 45. The activation sequences contained in the EE Manifest are executed in the PythonInterpreter
    • 46. An instance of the (Java) JythonInterpreter class is created by XTP and deployed into the relevant PythonInterpreter
  • The jythonExchanger
    • The jythonExchanger is the interface between the EE and the XTP environment
    • 47. Each EE uses it to access XTP high-level features
    • 48. XTP infrastructure uses it to retrieve test results from EEs and show them in graphs and reports
    • 49. The overall consistency of the system is assured by the Jython characteristic to be a 100% pure Java implementation.
  • Results
    Main benefits
    Common risks
  • 50. Sustainable architecture
    • Example: load/unload 5 plug-ins at runtime
    • 51. Memory request increases without “exploding”
    • 52. Memory is freed when plug-ins are deactivated
  • Major benefits
    “Calibrate your technology”
    Choose the solution that best fits your needs
    Python threads or Java threads (or Eclipse Jobs)?
    Transparent Python layer on DUTs
    XML-RPC Server + os.popen() have small CPU overhead
    Plug-in lifecycle
    Runtime plug-ins promote validation through cooperation
    Short rump-up time
    Perl users start using Python very intuitively
  • 53. Common risks
    “Design your architecture”
    Test planning
    To make the most of the Plug-in design pattern, point out common test domains in advance
    Long-term investment
    Platform stability requires a significant effort
    Keep code under control
    Review carefully test code before integrating it
    Right-Size your hardware
    Concurrent executions may require performing machines
  • 54. Q&A