MozillaQualityAssurance:Home Page:Firefox 3.0 TestPlan:Leaks:LeakTesting-How-To: Difference between revisions

no edit summary
No edit summary
Line 6: Line 6:


Mozilla QA uses Trace Malloc Debug Build to test Firefox Components and Extensions for leaks. One part of this testing is manual testing. You can find the QA Firefox 3 Leak Testing Testplan [http://wiki.mozilla.org/MozillaQualityAssurance:Home_Page:Firefox_3.0_TestPlan:Leaks here].  
Mozilla QA uses Trace Malloc Debug Build to test Firefox Components and Extensions for leaks. One part of this testing is manual testing. You can find the QA Firefox 3 Leak Testing Testplan [http://wiki.mozilla.org/MozillaQualityAssurance:Home_Page:Firefox_3.0_TestPlan:Leaks here].  
Many thanks to David Baron, Jonas Sicking, Jesse Ruderman and Peter Van der Beken for the help on this Project.


== Leak Gauge ==
== Leak Gauge ==
Line 17: Line 19:
=== Using Leak Gauge ===
=== Using Leak Gauge ===


As mentioned before, you don't need to install addional software to run Leak Gauge, however some simple tests are needed to run Leak Gauge and to get the Leak Log.
As mentioned before, you don't need to install additional software to run Leak Gauge, however some simple steps are needed to run Leak Gauge and to get the Leak Log.


1. Setting up the Environment Variable:
1. Setting up the Environment Variable:
Line 58: Line 60:
to exit; otherwise it will look like everything leaked
to exit; otherwise it will look like everything leaked


* Every time you start Firefox after you have defined the environment variables, your existing leak log will be overwritten. So if you want to reproduce a leak, or when you want to save a leak log, you need to change the filename (like from leak1.log to leak2.log) next time before you run Firefox.
* Every time you start Firefox after you have defined the environment variables, your existing leak log will be overwritten. So if you want to reproduce a leak, or when you want to save a leak log, you need to change the file name (like from leak1.log to leak2.log) next time before you run Firefox.


See also the steps for testing for more Information.  
See also the steps for testing for more Information.  
Line 95: Line 97:
You can also use debug builds for leak testing. Building and Running a Debug Build is more complex then using Leak Gauge. If you interested in running Leak Test Debug Builds you can find [http://wiki.mozilla.org/MozillaQualityAssurance:Home_Page:Firefox_3.0_TestPlan:Leaks:LeakTesting-How-To:Debug_Builds here] more information.
You can also use debug builds for leak testing. Building and Running a Debug Build is more complex then using Leak Gauge. If you interested in running Leak Test Debug Builds you can find [http://wiki.mozilla.org/MozillaQualityAssurance:Home_Page:Firefox_3.0_TestPlan:Leaks:LeakTesting-How-To:Debug_Builds here] more information.


= Leak Testing  - Example of testing steps for Extension Testing =
= Leak Testing  - Testing steps for Firefox / Firefox Extension Testing =


When you found a leak, its important to have some steps to reproduce, so developers can reproduce this leak and also for verifying a fixed leak bug.
First of all, its important to have some steps to reproduce, so developers can reproduce this leak and also for verifying a fixed leak bug. So if you can reproduce a memory leak 2 or more times, it should be filed as bug, see ...


As example here are the steps to reproduce from [https://bugzilla.mozilla.org/show_bug.cgi?id=411576 Bug 411576].
Some general Tips for testing Firefox Extensions for Memory Leaks:


* First create a new Firefox Profile to ensure nothing else from a used profile cause a leak. Start your Leak Debug as described.
* First create a new Firefox Profile to ensure nothing else from a used profile cause a leak. Start your Leak Debug as described.
* Install a Extension and Restart Firefox
* Install the Extension and Restart Firefox
* After the Restart - Quit Firefox to make sure the Extension does not leak after installation
* After the Restart - Quit Firefox to make sure the Extension does not leak after installation in general
* When no memory leak was detected play a little with the extension to make sure the extension does not leak on specific steps to reproduce.  
* Even when no Memory Leak was detected on start, use the features of this the Extension (in example with the QA Extension, use the Chat now button, the Login into Litmus etc)
* Close Firefox and upload the Leak Log [http://mxr.mozilla.org/mozilla/source/tools/footprint/leak-gauge.html here]
 
* When a memory leak was detected save the leak.log/set the Leak Log environment variable to a different file name and start Firefox again to verify your steps to reproduce.
 
'''Note:''': '''If the browser crashes during the run, the log is pretty much useless, since many objects will have been allocated but not freed at the time the crash occurs.'''
 
== How to file a Memory Leak Bug ? ==
 
* When you have found a Memory Leak Bug in Firefox and you have solid steps to reproduce or a testcase, please file a Bug in Bugzilla.  


Some examples for in-detail testing of extensions:
''Note: If you are unsure if you have found a memory leak, or you are not familiar with Bugzilla, you can also ping Tomcat or send a mail to [mailto:tomcat@mozilla.com tomcat@mozilla.com] and we can recheck this leak and file the leak bug''
* Try out features of the Extension (like Buttons, Options, etc). After you have done this, quit firefox to check the leak.log


* Go into the Extension Manager and check if the Firefox Extension Manager leaks when the Extension is installed
* When you are unsure if its your extension that leak or Firefox itself, the best component in Bugzilla is Core:General
* Please add '''mlk''' as keyword when you file the bug.
* Please include the steps to reproduce/the testcase to the bug. This help developers to reproduce and fix the bug.
* Please add the leak log / output from the Leak Gauge Script to the Bug.
* It would great if you cc Tomcat to the Bug. You can do this via entering just ''':tomcat''' in the cc field in bugzilla or the full email address '''cbook@mozilla.com'''


* Use the Extension Options Button in the Extension Manager (see Bug [https://bugzilla.mozilla.org/show_bug.cgi?id=412136 412136].
== Questions / Feedback ==  


* When a memory leak was detected save the leak.log and start Firefox again to check if the extension leaks only the first time after installation, or if the extension leak in general when installed
In Case you need help or when you have questions regarding the leak testing of your extension, feel me to ping me on irc.mozilla.org, my nickname is "Tomcat" or send me an [mailto:tomcat@mozilla.com e-mail].
Confirmed users
2,317

edits