Skip to contentSkip to conversation

How to test my patch before I post it to public?

DISCUSSION wang zhihao 2 participants 7 messages Apr 29, 2012 – Apr 30, 2012

lore
Share & tools
lore
#0 lore raw

Hi , All

I 'm a green hand and interested in open source development. I have a general question “How to test my patch before I post it to public?” Hope you guys give me some suggestions. : )

Firstly, I can re-compile the code, to assure no syntax error. However,I don't know how to test my patch's function is right or not. Some software requires unit test for each function. Is there anything similar in xen project?

Thank you very much!

Best Regards
Wang Zhihao
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#1 lore raw
Quoted 5 lines · wang zhihao

Hi , All

I 'm a green hand and interested in open source development. I have a general question “How to test my patch before I post it to public?” Hope you guys give me some suggestions. : )

Firstly, I can re-compile the code, to assure no syntax error. However,I don't know how to test my patch's function is right or not. Some software requires unit test for each function. Is there anything similar in xen project?

There is no unit testing for Xen. What you need to test really depends on what your patch is doing. The main goal is to exercise the code you've just added or changed: try to put it in different combinations to make sure that it works as you expect. Try to break it, really. :-)

If you're just tweaking a simple option in the xl config file, then you need to test a few different combinations to make sure that all the reasonable combinations work. If you're changing the locks in the memory management code in the hypervisor, then you need to run a bunch of benchmarks that exercise that code, probably for several hours.

If you post your patch to the list (with an appropriate description) we may be able to give you some suggestions.

-George

#2 lore raw

Hi George:

Thanks for your guides, But I don't know what "combination" means. Could you tell me more about it?

Best Regards
Wang Zhihao

Quoted 19 lines · 在 2012-4-30,下午5:16, George Dunlap 写道:
Quoted 5 lines · wang zhihao

Hi , All

I 'm a green hand and interested in open source development. I have a general question “How to test my patch before I post it to public?” Hope you guys give me some suggestions. : )

Firstly, I can re-compile the code, to assure no syntax error. However,I don't know how to test my patch's function is right or not. Some software requires unit test for each function. Is there anything similar in xen project?

There is no unit testing for Xen. What you need to test really depends on what your patch is doing. The main goal is to exercise the code you've just added or changed: try to put it in different combinations to make sure that it works as you expect. Try to break it, really. :-)

If you're just tweaking a simple option in the xl config file, then you need to test a few different combinations to make sure that all the reasonable combinations work. If you're changing the locks in the memory management code in the hypervisor, then you need to run a bunch of benchmarks that exercise that code, probably for several hours.

Quoted 4 lines

If you post your patch to the list (with an appropriate description) we may be able to give you some suggestions.

-George

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#3 lore raw
Quoted 4 lines · wang zhihao

Hi George:

Thanks for your guides, But I don't know what "combination" means. Could
you tell me more about it?

I can't really give you an example without an example to work with. :-) What does your patch do?

-George

Quoted 37 lines

Best Regards
Wang Zhihao

在 2012-4-30,下午5:16, George Dunlap 写道:

On Sun, Apr 29, 2012 at 4:21 PM, wang zhihao <[email protected]> wrote:

Hi , All

I 'm a green hand and interested in open source development. I have a general question "How to test my patch before I post it to public?" Hope you guys give me some suggestions. : )

Firstly, I can re-compile the code, to assure no syntax error. However,I don't know how to test my patch's function is right or not. Some software requires unit test for each function. Is there anything similar in xen project?

There is no unit testing for Xen. What you need to test really depends on what your patch is doing. The main goal is to exercise the code you've just added or changed: try to put it in different combinations to make sure that it works as you expect. Try to break it, really. :-)

If you're just tweaking a simple option in the xl config file, then you need to test a few different combinations to make sure that all the reasonable combinations work. If you're changing the locks in the memory management code in the hypervisor, then you need to run a bunch of benchmarks that exercise that code, probably for several hours.

If you post your patch to the list (with an appropriate description) we may be able to give you some suggestions.

Quoted 9 lines

-George

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#4 lore raw

Hi George:

I don't have a patch now, but may have one in future. : P

Ok, I will try to make a patch and then ask this question : )

Regards
Wang zhihao

Quoted 57 lines · 在 2012-4-30,下午10:19, George Dunlap 写道:
Quoted 4 lines · wang zhihao

Hi George:

Thanks for your guides, But I don't know what "combination" means. Could
you tell me more about it?

I can't really give you an example without an example to work with. :-) What does your patch do?

-George

Quoted 46 lines

Best Regards
Wang Zhihao

在 2012-4-30,下午5:16, George Dunlap 写道:

On Sun, Apr 29, 2012 at 4:21 PM, wang zhihao <[email protected]> wrote:

Hi , All

I 'm a green hand and interested in open source development. I have a general question "How to test my patch before I post it to public?" Hope you guys give me some suggestions. : )

Firstly, I can re-compile the code, to assure no syntax error. However,I don't know how to test my patch's function is right or not. Some software requires unit test for each function. Is there anything similar in xen project?

There is no unit testing for Xen. What you need to test really depends on what your patch is doing. The main goal is to exercise the code you've just added or changed: try to put it in different combinations to make sure that it works as you expect. Try to break it, really. :-)

If you're just tweaking a simple option in the xl config file, then you need to test a few different combinations to make sure that all the reasonable combinations work. If you're changing the locks in the memory management code in the hypervisor, then you need to run a bunch of benchmarks that exercise that code, probably for several hours.

If you post your patch to the list (with an appropriate description) we may be able to give you some suggestions.

-George

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#5 lore raw
Quoted 5 lines · wang zhihao

Hi George:

I don't have a patch now, but may have one in future. : P

Ok, I will try to make a patch and then ask this question : )

Well, as I said, the general idea is, "try to break it". If you add a new option, for instance, check to make sure that it works right:
* If you put in a reasonable value
* If you put in an unreasonably high value
* If you put in a negative number
* If you don't specify the option at all
* If you put a string instead of a number

Make sense?

-George

Quoted 61 lines

Regards
Wang zhihao

Quoted 55 lines · 在 2012-4-30,下午10:19, George Dunlap 写道:
Quoted 4 lines · wang zhihao

Hi George:

Thanks for your guides, But I don't know what "combination" means. Could
you tell me more about it?

I can't really give you an example without an example to work with. :-) What does your patch do?

-George

Quoted 45 lines

Best Regards
Wang Zhihao

在 2012-4-30,下午5:16, George Dunlap 写道:

On Sun, Apr 29, 2012 at 4:21 PM, wang zhihao <[email protected]> wrote:

Hi , All

I 'm a green hand and interested in open source development. I have a general question "How to test my patch before I post it to public?" Hope you guys give me some suggestions. : )

Firstly, I can re-compile the code, to assure no syntax error. However,I don't know how to test my patch's function is right or not. Some software requires unit test for each function. Is there anything similar in xen project?

There is no unit testing for Xen. What you need to test really depends on what your patch is doing. The main goal is to exercise the code you've just added or changed: try to put it in different combinations to make sure that it works as you expect. Try to break it, really. :-)

If you're just tweaking a simple option in the xl config file, then you need to test a few different combinations to make sure that all the reasonable combinations work. If you're changing the locks in the memory management code in the hypervisor, then you need to run a bunch of benchmarks that exercise that code, probably for several hours.

If you post your patch to the list (with an appropriate description) we may be able to give you some suggestions.

-George

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#6 lore raw

Hi George:

I got it. Try some extreme value or invalid input to the running code with my new feature, If the patch is a simple option or something-like which can be easy tested in this way, Right?

Regards
Wang Zhihao

Quoted 14 lines · 在 2012-4-30,下午10:46, George Dunlap 写道:
Quoted 5 lines · wang zhihao

Hi George:

I don't have a patch now, but may have one in future. : P

Ok, I will try to make a patch and then ask this question : )

Well, as I said, the general idea is, "try to break it". If you add a new option, for instance, check to make sure that it works right:
* If you put in a reasonable value
* If you put in an unreasonably high value
* If you put in a negative number
* If you don't specify the option at all
* If you put a string instead of a number

Quoted 66 lines

Make sense?

-George

Quoted 61 lines

Regards
Wang zhihao

Quoted 55 lines · 在 2012-4-30,下午10:19, George Dunlap 写道:
Quoted 4 lines · wang zhihao

Hi George:

Thanks for your guides, But I don't know what "combination" means. Could you tell me more about it?

I can't really give you an example without an example to work with. :-) What does your patch do?

-George

Quoted 45 lines

Best Regards
Wang Zhihao

在 2012-4-30,下午5:16, George Dunlap 写道:

On Sun, Apr 29, 2012 at 4:21 PM, wang zhihao <[email protected]> wrote:

Hi , All

I 'm a green hand and interested in open source development. I have a general question "How to test my patch before I post it to public?" Hope you guys give me some suggestions. : )

Firstly, I can re-compile the code, to assure no syntax error. However,I don't know how to test my patch's function is right or not. Some software requires unit test for each function. Is there anything similar in xen project?

There is no unit testing for Xen. What you need to test really depends on what your patch is doing. The main goal is to exercise the code you've just added or changed: try to put it in different combinations to make sure that it works as you expect. Try to break it, really. :-)

If you're just tweaking a simple option in the xl config file, then you need to test a few different combinations to make sure that all the reasonable combinations work. If you're changing the locks in the memory management code in the hypervisor, then you need to run a bunch of benchmarks that exercise that code, probably for several hours.

If you post your patch to the list (with an appropriate description) we may be able to give you some suggestions.

-George

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel