Fqhuy gsoc project

From OLPC
Revision as of 04:49, 28 March 2008 by Fqhuy (talk | contribs)
Jump to navigation Jump to search

OLPC – GsoC 2008 Project: XO Development Environment Abstract The most important factor that make the success of software projects is human factor. additionally , tools which were used in that projects are also important. A good development environment help increase productivity of software development processes. Depend on the idea “Eclipse based development environment for Activities” in the ideas list of OLPC-GSoC 2008 and an email in gsoc@laptop.org mailing list of Michael Stone that suggest students to implement Titus Brown's idea about Automated Testing System for OLPC projects, I decided to develop a dedicated development environment for OLPC projects with full support for developing XO software involve a IDE for coding with Python language and a Sever Program run locally with Xephyr or remotely inside VMware, VirtualBox, XO-laptop which manages many XO Activities development tools like Figleaf, Xmacro, WinPdb, PyUnit, PyFTP server... About me My name is Phan Quoc Huy, I'm being a third year student of University of Natural Sciences, faculty information technology. I began using Linux, making friend with Open Source for two years. All my projects at University were developed in Linux, using Eclipse, Netbeans and also Vi, Nano... I have solid experiences in Java and a haft of year playing with Python. therefore, I believe that I could finish this project in two and a half month with the helps from mentor. Benefits from this Project Full-featured IDE for developing Python applications. Automated Testing System to ensure that entire system work well when hardwares, or softwares were changed. Separation of IDE and Runtime Environment allow developers to develop applications on their favorite environments but still run it on the required platform. Code templates and Help System make new XO developers quickly make acquaintance with developing software for OLPC projects. Deliverables XODev eclipse plug-in in zip file, update site Server program in one-click installer package, RPM files, Deb Files, source codes Working plan If I was accepted by OLPC to work on this project, my working plan will be : First week for studying all open source projects used in my project. reading licenses to confirm that I will not do any thing ill-legal. Contacting author to ask for missed documents. trying to run each related project in environment similar to XO-Laptop (Fedora 7) to ensure it work well on this linux distro, write patch to fix error if I can, ask for help from author, replace with another software...asking mentor if these projects are appropriated for my project. gooling around to find out if there are projects have similar idea with me and “borrow” something if necessary . Setting up working environment with all necessary tools and documents (Eclipse, SVN server, PyDev plug-in, related source codes...) Next two weeks: collaborate with mentor to design OO architecture for Server program, so that it can reach several goals such as extensibility, re-usability, portability, compatibility...in this time, I will also study source code of debug plug-in of PyDev to borrow some good ideas from them, and finish my design for XODev plug-in, Next week: begin coding main classes, interfaces on both two sides, Server Program and XODev plug-in, continue thinking about the architecture design, and answer the question “is it good enough ?”, making small changes to architecture if it help improve something and doesn't make bad effect on entire system. Next two weeks: coding all “remote procedures” to control Xmacro, figleaf, Winpdb, runner, PyUnit, Python FTP server. write a small Java class that run in the “client side” to talk with Server through XML-RPC and test if Server work or not, fix errors, ask mentor, IRC channels... Test source code synchronization by using SFTP plug-in and Python FTP server. Next two weeks: writing XODev debug plug-in, test if it can communicate well with server. The final two weeks: Testing all features together. write Templates, Wizards, Help Documents. pakaging to deliver first alpha version. Continue working on this projects outside GSoC to maintain and release next versions. Solutions A picture: [[1]] IDE for developing Python applications one of the best IDE which has been used to develop Python Application was Eclipse with PyDev plug-in. PyDev has many powerful features like Python keywords highlighting, refactoring, code completion, code folding, package explorer, but the free version of it was stripped out one feature that very important for my project is remote debugging. Moreover, I found Winpdb, another debugger for Python which run 20 times faster than pdb currently used in PyDev. So, I decided to replace current debug plug-in of PyDev with my own debug plug-in, which is also depend on others plug-in of PyDev. The mechanism used inside my debug plug-in, however, is quite deferent from the old one. it doesn't perform all tasks like debugging, unit testing, running applications by itself. instead, it uses XML-RPC calls to Server program to do those tasks, then receives the result and display it using SWT/JFace widgets. I also add SFTP plug-in to eclipse for synchronizing source code between host and target machine. thereto, I will make some templates,Wizards and Help System for my eclipse feature, to help developers develop new activities easily. Server program The Server program will be written entirely in Python language to make it easy to install, and portable through various platforms. The “core”, actually is a XML-RPC server which listen for XML-RPC calls from my eclipse plug-in and perform the relevant actions like running debugger and return results, starting FTP server, running test cases... Follow the suggestion of Titus Brown, I also integrate Xmacro, figleaf to Server program for automated GUI testing and code coverage. Xmacro: The XMacro package contains two simple programs (xmacrorec and xmacroplay) for recording and replaying keyboard and mouse events on an X server figleaf: figleaf is a Python code coverage analysis tool, built somewhat on the model of Ned Batchelder's fantastic coverage module. The goals of figleaf are to be a minimal replacement of 'coverage.py' that supports more configurable coverage gathering and reporting. Pyftpdlib: Python FTP server library provides a high-level portable interface to easily write asynchronous FTP servers with Python. Based on asyncore framework pyftpdlib is currently the most complete RFC-959 FTP server implementation available for Python programming language. Winpdb: Winpdb is a platform independent GPL Python debugger with support for multiple threads, namespace modification, embedded debugging, encrypted communication and is up to 20 times faster than pdb. SFTP plug-in: SFTP Team provider allows you to synchronize files and directories between the workspace and a remote location as WebDAV and FTP support for Eclipse does, but by using ssh2 sftp protocol. Conclusions The GSoC yearly program is a helpful program in many aspects for both students and open source organizations. It help students gain knowledge about real software projects, open source world and help make million lines of code for open source projects. I hope that with my solutions, XO developers, contributors or anyone who were interested in developing software for OLPC project could easily make acquaintance with new software development platform and help OLPC make many useful software for children. http://pydev.sourceforge.net/ http://www.jcraft.com/eclipse-sftp/index.html http://xmacro.sourceforge.net/ http://darcs.idyll.org/~t/projects/figleaf/doc/ http://code.google.com/p/pyftpdlib/ http://www.winpdb.org/?page_id=5 http://pyunit.sourceforge.net/