Proposal by Gisela Decuzzi for Better rewriting rule tool

Proposed by Gisela Decuzzi (profile, biography)

How will I do that project

I will spend 4 hours every day (and maybe more on weekends), at least 20 hours per week. 
I will do shorts iterations about one or two weeks and sending shorts summaries to my mentors with the activities done, in progress and planned to do, we can maintain sync and discuss about the furthers steps (this steps will be shorts, easy to read and easy to write).
I will publish the big improvements in the community (surely using the mailing list), providing information about the new features, how to use and (if needed) showing some screen cast from the tool. I will sent a complete description with each important checkpoint.
For the implementation first I will start reading and collecting information about the actual state of the art, play with SmallLint, write some rules and understand the current implementation. Search others tools similar (in Smalltalk and NonSmalltalk technologies), and then decide if the best to do it's to improve SmallLint or start another approach.
Also I will take a look in visualization tools for helping to show the impact from a transformation and try to present at least 3 alternatives to visualize the information.

What methodologies will I use

I will organize the work in small iterations (1 week), in sync with my mentors trying to plan in the begging of the week the work for the next one and having all the week to see if it's ok or it would be better to change the objective.
For every week I want to define a concrete advance from the project (eg. a screen cast filmed, a set of features implemented, a post entry written ...).
For guiding the development I will try to use TDD (first, if with the mentors decide to choose the path of improve the existing implementation I will check the tests written for SmallLint), and follow the strategy of small commits. In this way I will provide visibility with my mentors and will be easy to stay sync and take a decision.
For every checkpoint I will perform a demo showing the advance.

Suggested timeline and milestones

1) Understand SmallLint implementation
- Check tests written
- Improve tests if it's needed
- Implement transformations rules using pattern matching and transforming the AST
- Recognize the AST from the selected expression (using OPAL for that)
- Define a desired API for manipulate and browse the AST
2) Define new screens for visualize the impact from the changes
- Check currents tools (not only smalltalk based)
- Make prototype
- Select protoype
- Implement it 
- Ask for feedback
- Review prototype/improve
3) Implement the API defined
- Easy patterns (specially non string based!)
- Check if it's necessary to define a DSL for pattern matching
- Make possible to obtain the AST representation from a selected code (not necessary a full method)
- Make it possible to know the results from an evaluations. Eg. if its a search show the pattern matched in an example expression and preview from the results, if imply a change have a preview (with no effect) and then impact it.
4) Build a visual tool to experiment with patterns in the code
- See in a expression the matches and understand the why
- Preview the results for running the query for a class / category / group of classes / all the image
- Add the possibility to run a transformation
- Obtain the code needed to reproduce the effects without the visual tool
5) Evaluate the complexity/possibility to revert the transformations
6) Write documentation for the tool usage
- Include examples in the tool
- Include screen shots
- Include screen casts
During the development I will ask to the community for feedback about the development, and adding all interesting suggestions received.

Where I see the risks

At least
- hard to understand/use API from current's tools
- lack of feedback (specially in visualizations tools)
- hard to define API
For the first risk, I surely will be asking to my mentors a lot for the begging and spend more time working to understand the implementations, also finding related work and looking examples.
For the last two risks, with the help of my mentors, I will try to push the tool in the community  specially in Pharo and Moose.

How the results will look like

It will have and easy to install tool integrated with the Pharo UI that allows selecting part of a text and open the new transformation browser and generate expression to match and transformation to apply.
Also a very expressive API if the browser it's not needed.

Updated: 23.4.2013