2

I am trying to help my friend by creating a part of his on-going project.

What I'm going to do is create a Java parser to break up the Java code into operators, parameters etc to build XML representation.

Next I want to create a code generator to convert the parsed java code to XML conforming to the schema I've created.

Finally I want to use an XML style-sheet to transform the XML into another programming language type.

Basically I just wanted some advice on which methodology/model I should use for planning and developing this project. Is there some benefit to using Agile etc for instance?

10
  • 4
    You're talking about some fairly advanced topics, on a project of two people, and asking us whether or not you should use agile? Just write the thing. Commented Oct 30, 2012 at 15:42
  • Hi I have to specify the methodology for the project and also document, plan and develop it according to a set methodology, but not sure which one to use, any advice would be great thanks :).
    – user 123
    Commented Oct 30, 2012 at 15:53
  • 2
    As Robert Harvey said, some very advanced topics. If you're asking questions on here about these things how confident are you that you have the necessary grasp on compiler theory to really do this correctly? I don't want to discourage you; you could learn a veritable treasure trove trying something like this, but I would suggest a little further study if you are unsure about how to approach the project. Commented Oct 30, 2012 at 16:11
  • 3
    @user123 if you haven't looked "into the programming side of things" yet, I would hold up on all the other documentation you're writing and start looking into compiler theory. It sounds like you don't understand the size of the project you're trying to bite off. Here, there be dragons. amazon.com/Compilers-Principles-Techniques-Alfred-Aho/dp/… Commented Oct 30, 2012 at 20:23
  • 1
    The first methodological point should be to look into the risks. I strongly suggest considering the risk that this project is much harder than you think at first, especially if you have never done language translation before. So you should look into the programming side first. These investigations might cause the project to be cancelled or substantially rethought. Worry about planning methodologies later (if ever).
    – MarkJ
    Commented Oct 31, 2012 at 11:48

3 Answers 3

4

Since you asked for methodology, I can give you one tip on this kind of programming project. Use unit tests. A LOT of unit tests. You should be spending several man-months writing unit tests.

What I'm going to do is create a Java parser to break up the Java code into operators, parameters etc to build XML representation.

On its own, this represents at least one question on programmers.SE.

Next I want to create a code generator to convert the parsed java code to XML conforming to the schema I've created.

On its own, this represents at least one question on programmers.SE.

Finally I want to use an XML style-sheet to transform the XML into another programming language type.

This is a book, not a programmers.SE question.

4
  • Hi, thanks for your help I will look into these unit tasks, do you know which would be the best model to follow to create/document/plan this software though, such as agile etc? Thanks.
    – user 123
    Commented Oct 30, 2012 at 18:41
  • 1
    I don't really know. Maybe try Test-Driven Development? This is the kind of application that needs to run perfectly, consistently, and with results that are largely deterministic. That makes it relatively easy to write unit tests for it. Bonus: Most bugs are probably going to be easy to convert into unit tests.
    – Brian
    Commented Oct 30, 2012 at 19:28
  • 1
    +1 I wouldn't even know how to start answering this question, but TDD sounds like a great approach to compilers, I understand ruby's entire spec is in this form. Commented Oct 30, 2012 at 20:26
  • +1... This is not one question, this is one heck of a project.
    – vainolo
    Commented Oct 31, 2012 at 8:29
0

Rather than use XML here why not reverse engineer the language translation from the byte code. That is a much more flexible intermediate format.

Be warned, what you are attempting to do here is extremely hard.

Usually it is cheaper to hire an expert in the target language to rewrite the code. And for that you will need tests. Lots of tests.

0

As all other answers said, your problem is really hard. But since you asked for a methodology, that questions is easier to answer.

First of all, the methodology you use depends a lot on the organization you are in. Some organizations simply follow waterfall development methodologies (i.e Military) and there is nothing you can do. On the other end there are organizations that only develop projects using agile methodologies. You must take this into account before taking any decision.

Second, agile methodologies are being used more and more these days because they produce better products (although there is no clear scientific evidence of this, most project that have moved to agile are very happy after the change). I would also recommend agile development (short iterations, working product, automatic tests, etc...). You can mix this with TDD to get more robustness, but it is not a must.

Last, but not least, even if you are doing agile, you still need to define your requirements in an exact way. Agile is NOT a synonym to not having defined requirements! it means that you implements the requirements step by step. With the complexity of what you are trying to achieve, you MUST define your requirements very well. If you don't have good requirements not event testing will help you (sorry for repeating myself, but I find this is a very important point).

And good luck.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.