Vladimir Itsykson

Denis Timofeev

Source code modification is one of the most frequent operations which developers perform in software life cycle. Such operation can be performed in order to add new functionality, fix bugs or bad code style, optimize performance, increase readability, etc. During the modification of existing source code developer needs to find parts of code, which meet to some conditions, and change it according to some rules. Usually developers perform such operations repeatedly by hand using primitive search/replace mechanisms and “copy and paste programming”, and that is why manual modification of large-scale software systems is a very error-prone and time-consuming process. Automating source code modifications is one of the possible ways of coping with this problem because it can considerably decrease both the amount of errors and the time needed in the modification process.

Automated source code modification technique based on parameterized source code patterns is considered in this article. Intuitive modification description that does not require any knowledge of complex transformation description languages is the main advantage of our technique. We achieve this feature by using a special source code pattern description language which is closely tied with the programming language we’re modifying. This allows developers to express the modification at hand as simple “before”/”after” source code patterns very similar to source code. Regexp-like elements are added to the language to increase its expressional power.

The source code modification is carried out using difference abstract syntax trees. We build a set of transformation operations based on “before”/”after” patterns (using algorithm for change detection in hierarchically structured information) and apply them to those parts of source code that match with the search “before” pattern. After abstract syntax tree transformation is completed we pretty-print them back to source code.

A prototype of source code modification system based on this technique has been implemented for the Java programming language. Experimental results show that this technique in some cases can increase the speed of source code modifications by several orders of magnitude, at the same time completely avoiding “copy-and-paste” errors. In future we are planning to integrate prototype with existing development environments such as Eclipse and NetBeans.


Vladimir Itsykson graduated cum laude from Saint-Petersburg State Polytechnical University in 1996. He received his Ph.D in Computer Science in 2000. Currently (as of late 2010) he is an associate professor of Computer Systems and Software Engineering department in SPbSPU and leads hardware/software R&D lab there.
Since 2005 he’s been a director of several R&D projects on software static analysis that were done by government orders or in collaboration with the world’s leading IT companies including (but not limited to) Panasonic, General Motors and Intel.
His fields of interest include:

  • Software engineering
  • Formal methods of software analysis and synthesis
  • Source code defect detection
  • Automation of software testing
  • Software reengineering and reverse-engineering

He’s an author and co-author of over 100 publications in various areas of computer science and software engineering.

Denis Timofeyev is a researcher in the field of computer science and software engineering. He began his scientific work during senior undergraduate years. He participated in several R&D projects, including:

  • a collaboration project with Spectraseis company on low-frequency seismic data visualization
  • a collaboration project with General Motors on development of the program tool for fault-tolerant automotive electronic control system design
      In 2010 he graduated from Saint-Petersburg State Polytechnical University with Master’s Degree in Computer Science.
      His fields of interest include modern software development technologies.