Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Code generator testing strategies
Code generator testing strategies [message #1778807] Thu, 21 December 2017 16:28 Go to next message
Axel Guckelsberger is currently offline Axel GuckelsbergerFriend
Messages: 354
Registered: July 2009
Senior Member
Hi all,

which approaches do you recommend for testing a quite complex and matured code generator?

Since generator templates are quite often subject to changes I thought about primarily checking only whether certain target files exist or not depending on specific settings.

Target file content tests could probably be limited to the most elemental files. Or maybe it would make sense to search for some strings, for example to verify whether a function/method is included or not (testIfClassHasMethod)?

Thanks for sharing your experience,

Axel
Re: Code generator testing strategies [message #1778809 is a reply to message #1778807] Thu, 21 December 2017 16:38 Go to previous message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 762
Registered: July 2009
Location: Dortmund, Germany
Senior Member

I'm usually going fine to compare against reference files. Therefore try to reduce an existing project to a minimal reference, which produces much less code than the real world project, but covers all aspects of the generator. This can be challenging, but beneficial.

For generator utilities like name computations and the like cover them with unit tests.
Previous Topic:Content Assist problem
Next Topic:Xtext strange parsing error
Goto Forum:
  


Current Time: Fri Mar 29 08:05:18 GMT 2024

Powered by FUDForum. Page generated in 0.02013 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top