who wrote 250k tests for webkit? who wrote 250k tests for webkit? google-chrome google-chrome

who wrote 250k tests for webkit?


The original directory contained 240K files:

 Total Files Listed:       243541 File(s)  1,062,470,729 bytes       64718 Dir(s)

Many of these are svn files. If I remove all the subdirectories named ".svn" then the number of files drops to 90K:

 Total Files Listed:       90615 File(s)    537,457,618 bytes        7190 Dir(s) 

Some directories have a subdirectory named "resources" and/or "script-tests". I think that these subdirectories contain helper files which are used by test cases in the superdirectories. If I remove these subdirectories (because they don't add to the total number of tests) then the number of files drops to 87K :

 Total Files Listed:       87672 File(s)    534,598,610 bytes        6305 Dir(s)

Condensing 'similar' filenames (e.g. "arrow-keys-on-body.html" and "arrow-keys-on-body-expected.txt" are two files which define a single test) reduces the total number from 87K to 43K.

The only subdirectories which contain more than 1500 of these test cases (counted as described above) are:

2761   LayoutTests\dom10330  LayoutTests\fast (of which 5934 are in LayoutTests\fast\js)22575  LayoutTests\platform (with various O/S-specific subdirectories).

Within the platform subdirectories there seems to have been some copy-and-pasting between platforms. For example, the css3-modsel-37-expected.txt file exists:

  • In the LayoutTests\platform\mac\css3 subdirectory
  • In the LayoutTests\platform\chromium-win\css3 subdirectory
  • In the LayoutTests\platform\qt\css3 subdirectory.

If I discard filenames which are duplicated into several platform subdirectories, then there are only 5716 (instead of 22575) unique platform tests.

In summary I think there are about 18K unique tests: which is still an impressive number of tests, but fewer than the 250K that you had estimated in your OP.


By way of comparison, I recently found CSS2.1 Test Suite: that looks like about 9000 test cases for CSS.


I just wrote 4 unit tests in 5 minutes. Not all unit tests takes long to make. Some are very simple ;)


From the webkit contribution guidelines

"For any feature that affects the layout engine, a new regression test must be constructed. If you provide a patch that fixes a bug, that patch should also include the addition of a regression test that would fail without the patch and succeed with the patch. If no regression test is provided, the reviewer will ask you to revise the patch, so you can save time by constructing the test up front and making sure it's attached to the bug. If no layout test can be (or needs to be) constructed for the fix, you must explain why a new test isn't necessary to the reviewer."

Q) Who wrote those tests? A) Pretty much everyone who contributed to webkit.