MySQL Lists are EOL. Please join:

List:Internals« Previous MessageNext Message »
From:Tor Didriksen Date:October 20 2009 8:44am
Subject:Unit testing
View as plain text  

Why don't we start writing unit tests for MySQL code?

I have been experimenting with the google unit testing framework lately.
I started out with something simple, some of the list classes.
Then I went on to write tests for the 'metadata locking' classes.
This was all presented at the runtime team meeting a couple of weeks ago.
My results have been pushed to

For information about googletest, see here:

-- didrik

PS: here's a snippet from the high-level description of worklog 5077:

>> MySQL has a fairly extensive set of system tests, for testing
>> features, functionality, failure handling etc. of the overall
>> system. There are however very few unit tests, and the ones we *do*
>> have are not executed as part of pushbuild. The goal of this worklog
>> is to illustrate that given the right tools, it is easy to write unit
>> tests for parts of the MySQL codebase.
>>There are several benefits of unit testing which are not covered by
>> system/integration testing:
>>- earlier testing: new code/classes/features can be tested *during
>>   development* rather after integration
>>- it simplifies integration with the rest of the system, since
>>   designing code for testing tends to lead to cleaner interfaces.
>>- certain features, e.g. failure handling, are much easier to
>>   verify in a unit test, than in a system test.
>>Note that we do *not* want to replace the existing system test
>> framework.

Unit testingTor Didriksen20 Oct
  • Re: Unit testingKristian Nielsen20 Oct
    • Re: Unit testingTor Didriksen20 Oct
      • Re: Unit testingJay Pipes20 Oct
        • Re: Unit testingKristian Nielsen20 Oct
          • Re: Unit testingSergei Golubchik20 Oct
      • Re: Unit testingKristian Nielsen20 Oct
        • Re: Unit testingTor Didriksen21 Oct
  • RE: Unit testingVladislav Vaintroub21 Oct
    • Re: Unit testingTor Didriksen22 Oct