Ticket #118 (closed refactoring: fixed)

Opened 5 months ago

Last modified 4 months ago

Switch unit tests from SimpleTest to PHPUnit

Reported by: mikey Assigned to: mikey
Priority: major Milestone: 0.5.0
Component: core Version: SVN-trunk
Keywords: Cc: schst, rist

Description

Given the current state of SimpleTest development it does not seem realistically that it will catch up with PHPUnit's features of measuring code quality or even to get code coverage measurement any time soon. However we have a need for these features to improve the overall code quality of Stubbles, but we can not afford to spend time for porting any of these features to SimpleTest and maintain them afterwards as this would bind a lot of our tight development time.

Therefore I propose to change our test engine from SimpleTest to PHPUnit, and to port all existing TestCase classes.

Change History

01/02/08 13:51:58 changed by mikey

  • cc changed from schst to schst, rist.

01/11/08 10:11:24 changed by mikey

  • status changed from new to assigned.
  • milestone changed from 0.5.0 to 0.6.0.

01/13/08 13:26:09 changed by mikey

  • milestone changed from 0.6.0 to 0.5.0.

01/27/08 21:32:06 changed by mikey

All unit tests were migrated now. The integration tests will follow.

01/31/08 00:56:18 changed by mikey

All integration tests were migrated.

The test suites were reorganized:

  • phing test now runs default unit tests
  • phing test-integration runs integration tests
  • phing test-all runs both
  • phing test-report runs both and creates reports about code coverage, code metrics and pmd (requires xdebug)

All left to do is to migrate one star unit test and to remove all SimpleTest-related code after this.

01/31/08 01:10:41 changed by mikey

Some notes about current code coverage: I excluded the packages net::stubbles::util::ext from counting because it will be removed in a namespaced version and it is more a proof of concept then really used and part of Stubbles. Additionally the package net::stubbles::util::xjconf can not be taken into account due to segmentation faults and weird behaviour of PHP in combination with loading classes from lib/xjconf.star.

Therefore our current code coverage statistics look like this: we have 280 classes of which 248 were used in tests, which gives a coverage of 88.57% for our classes. In all those classes exist 1688 method, of which 1339 where used in tests, so the figure for methods is 79.32%. Finally, coming to lines of code, we have 7566 executable lines of code of which 5794 are tested, accounting to 76.58%.

All main packages except one have a line code coverage of at least two third, the only package below is net::stubbles::service with only 32.75% line code coverage, so this needs to be adressed in the near future.

01/31/08 09:04:45 changed by mikey

  • status changed from assigned to closed.
  • resolution set to fixed.

Star tests converted, SimpleTest removed. Mission accomplished.