Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A code generator problem

Ricky Wang
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If is there any code generator for the following purpose:

1. Generate a function with specified parameters such as foo(int a, char b, double c,...)

2. Within this function, a series of nested "if/else-if" is generated. The condition expression within if can also be auto-generated with provided rules.
For example,
if (c - a < 0) {
if ( b == 'y' || b == 'n') {


Simply put, I need a tool to help me to randomly generate a host of test functions.

Any suggestion is welcome .
[ April 20, 2007: Message edited by: Ricky ]
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic