python-inputgenTool for automated input generation, useful for automated testing and generation of complex data struct... | |
Download |
python-inputgen Ranking & Summary
Advertisement
python-inputgen Tags
python-inputgen Description
Tool for automated input generation, useful for automated testing and generation of complex data structures python-inputgen is a Python package that allows for easy input generation, useful for automated testing and generation of complex data structures.This tool is based on Korat, an input generation tool for Java programs.RequirementsCurrently, inputgen requires Python 2.7 because it makes use of the OrderedDict class that was added in Python 2.7.Simple exampleBelow is a simple example. For more examples, see the inputgen/examples/ directory.Given the following code:import inputgenclass SquareTest(inputgen.TestCase): @staticmethod def repOK(factory): return True @staticmethod def fin(min=0, max=10): f = inputgen.Factory(enable_backtracking=False, enable_iso_breaking=False) f.set('number', range(min, max)) return f def run_method(self, factory): num = factory.number self.assertEqual(num * num, num ** 2)if __name__ == "__main__": import unittest unittest.main()Save the code to a file name square.py and then run the unit test:python square.pyWhen run, inputgen will generate all possible combinations of the finitized fields. In the example above this will produce ten combinations, with a single field (number) ranging from 0 to 9. Requirements: · Python
python-inputgen Related Software