Parametrized Unit Testing

Registered by Federico Razzoli on 2013-03-06

Seems that some people can't live without PUT - and yes, it can be very convenient (while it may introduce bugs in testing development).

We need to implement these steps:

* When searching for tests, also search for Procedures which accept parameters
* If current test accepts parameters, remember its name and read comment
* Comment contains this info: parameters generator name, expected result, and how many parameters are needed. Example of syntax which should be ok: CREATE PROCEDURE my_proc ... COMMENT 'pgen: my_generator,int,string,int'
* Compose a statement which calls the generator. Example: my_generator(@p1, @p2)
* A temp table for the results is created. One column is called result, others are p1, p2...
* Generator must fill the table. Row example: result: 42, p1: 'answer', p2: 0
* By default, assert is assertEquals. Temp table has a assert column, DEFAULT 'assert_equals'. But generator can explicitly set a different assert.
* For each row in temp table, an assert must be composed. Example: CALL assert_equals(my_proc('answer', 0), 42);

All this new code must be put into a separate procedure, to avoid introducing bugs in old code.
In dbug mode, all info parsed from comment and all generated asserts must be logged.

Blueprint information

Status:
Not started
Approver:
None
Priority:
Essential
Drafter:
None
Direction:
Approved
Assignee:
Federico Razzoli
Definition:
Discussion
Series goal:
Accepted for trunk
Implementation:
Not started
Milestone target:
milestone icon 2.0.0

Related branches

Sprints

Whiteboard

(?)

Work Items

Dependency tree

* Blueprints in grey have been implemented.

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.