You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Guruprasad JG <gu...@gmail.com> on 2009/12/18 06:49:29 UTC

[users@httpd] Code coverage while running web server

I am working on a project which requires running httpd web server. I need to
ensure that all the important code paths are covered while the web server is
running.  I looked around for test scripts which can help in doing that, but
couldn't find any. Are there any test suite or bunch of functional test
scripts which the developers might use to test the web server before
official releases ?

Thanks a ton !
Guruprasad

Re: [users@httpd] Code coverage while running web server

Posted by Guruprasad Jakka <gu...@gmail.com>.
This was exactly what I was looking for.

Thanks !

On Mon, Dec 21, 2009 at 1:44 PM, William A. Rowe Jr. <wr...@rowe-clan.net>wrote:

> Krist van Besien wrote:
> > On Sat, Dec 19, 2009 at 1:30 AM, Guruprasad JG <gu...@gmail.com>
> wrote:
> >> I am referring to the Apache code written in C. I would like to see if
> all
> >> the paths are exercised for - request processing, resource management,
> >> connection pooling, and configuration directives of the apache core.
> This
> >> would be more like functional testing of apache.
> >
> > I think you'll have to explain to us what you exactly mean with
> > checking that "all the paths are exercised". I have no clue how to
> > "exercise paths" in any context, and I do consider my knowledge of the
> > English language quite substantial. Maybe you should rephrase your
> > question.
> > If you just want to know what goes on inside Apache when a request is
> > processed than you can ofcourse run it in a debugger. Will be slow,
> > though. Make sure the timeout in whatever client you use is high
> > enough.
>
> This is a common phrase in software engineering.  The only solution to
> achieve code coverage is to instrument httpd with a code coverage tool,
> and test it.
>
> See the http://httpd.apache.org/test/ page and the repository at
> http://svn.apache.org/viewvc/httpd/test/framework/trunk/ for the test
> framework of httpd.  Patches to increase code coverage would be welcome.
>
> You will not achieve 100% on a single box, due to the platform differences
> in the code paths.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

Re: [users@httpd] Code coverage while running web server

Posted by "William A. Rowe Jr." <wr...@rowe-clan.net>.
Krist van Besien wrote:
> On Sat, Dec 19, 2009 at 1:30 AM, Guruprasad JG <gu...@gmail.com> wrote:
>> I am referring to the Apache code written in C. I would like to see if all
>> the paths are exercised for - request processing, resource management,
>> connection pooling, and configuration directives of the apache core. This
>> would be more like functional testing of apache.
> 
> I think you'll have to explain to us what you exactly mean with
> checking that "all the paths are exercised". I have no clue how to
> "exercise paths" in any context, and I do consider my knowledge of the
> English language quite substantial. Maybe you should rephrase your
> question.
> If you just want to know what goes on inside Apache when a request is
> processed than you can ofcourse run it in a debugger. Will be slow,
> though. Make sure the timeout in whatever client you use is high
> enough.

This is a common phrase in software engineering.  The only solution to
achieve code coverage is to instrument httpd with a code coverage tool,
and test it.

See the http://httpd.apache.org/test/ page and the repository at
http://svn.apache.org/viewvc/httpd/test/framework/trunk/ for the test
framework of httpd.  Patches to increase code coverage would be welcome.

You will not achieve 100% on a single box, due to the platform differences
in the code paths.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Code coverage while running web server

Posted by Guruprasad Jakka <gu...@gmail.com>.
I will trying posting it in the dev list. Thanks !

On Sun, Dec 20, 2009 at 4:45 AM, Jonathan Zuckerman
<j....@gmail.com>wrote:

> On Sun, Dec 20, 2009 at 1:42 AM, Jonathan Zuckerman
> <j....@gmail.com> wrote:
> > On Sun, Dec 20, 2009 at 12:37 AM, Krist van Besien
> > <kr...@gmail.com> wrote:
> >> On Sat, Dec 19, 2009 at 1:30 AM, Guruprasad JG <gu...@gmail.com>
> wrote:
> >>> I am referring to the Apache code written in C. I would like to see if
> all
> >>> the paths are exercised for - request processing, resource management,
> >>> connection pooling, and configuration directives of the apache core.
> This
> >>> would be more like functional testing of apache.
> >>
> >> I think you'll have to explain to us what you exactly mean with
> >> checking that "all the paths are exercised". I have no clue how to
> >> "exercise paths" in any context, and I do consider my knowledge of the
> >> English language quite substantial. Maybe you should rephrase your
> >> question.
> >> If you just want to know what goes on inside Apache when a request is
> >> processed than you can ofcourse run it in a debugger. Will be slow,
> >> though. Make sure the timeout in whatever client you use is high
> >> enough.
> >>
> >> Krist
> >>
> >>
> >> --
> >> krist.vanbesien@gmail.com
> >> krist@vanbesien.org
> >> Bremgarten b. Bern, Switzerland
> >> --
> >> A: It reverses the normal flow of conversation.
> >> Q: What's wrong with top-posting?
> >> A: Top-posting.
> >> Q: What's the biggest scourge on plain text email discussions?
> >>
> >> ---------------------------------------------------------------------
> >> The official User-To-User support forum of the Apache HTTP Server
> Project.
> >> See <URL:http://httpd.apache.org/userslist.html> for more info.
> >> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> >>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> >> For additional commands, e-mail: users-help@httpd.apache.org
> >>
> >>
> >
> > I believe he is asking for a unit testing suite for Apache, to create
> > scenarios that execute every line of code in the apache webserver so
> > that they can verify that everything works properly, I think as a
> > request it's pretty ambitious...
> >
>
> I should say, as a request *to the apache users group*..  there's
> probably a mailing list for contributors to the project who actually
> write C code, where this question might make more sense.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

Re: [users@httpd] Code coverage while running web server

Posted by Jonathan Zuckerman <j....@gmail.com>.
On Sun, Dec 20, 2009 at 1:42 AM, Jonathan Zuckerman
<j....@gmail.com> wrote:
> On Sun, Dec 20, 2009 at 12:37 AM, Krist van Besien
> <kr...@gmail.com> wrote:
>> On Sat, Dec 19, 2009 at 1:30 AM, Guruprasad JG <gu...@gmail.com> wrote:
>>> I am referring to the Apache code written in C. I would like to see if all
>>> the paths are exercised for - request processing, resource management,
>>> connection pooling, and configuration directives of the apache core. This
>>> would be more like functional testing of apache.
>>
>> I think you'll have to explain to us what you exactly mean with
>> checking that "all the paths are exercised". I have no clue how to
>> "exercise paths" in any context, and I do consider my knowledge of the
>> English language quite substantial. Maybe you should rephrase your
>> question.
>> If you just want to know what goes on inside Apache when a request is
>> processed than you can ofcourse run it in a debugger. Will be slow,
>> though. Make sure the timeout in whatever client you use is high
>> enough.
>>
>> Krist
>>
>>
>> --
>> krist.vanbesien@gmail.com
>> krist@vanbesien.org
>> Bremgarten b. Bern, Switzerland
>> --
>> A: It reverses the normal flow of conversation.
>> Q: What's wrong with top-posting?
>> A: Top-posting.
>> Q: What's the biggest scourge on plain text email discussions?
>>
>> ---------------------------------------------------------------------
>> The official User-To-User support forum of the Apache HTTP Server Project.
>> See <URL:http://httpd.apache.org/userslist.html> for more info.
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
>>
>
> I believe he is asking for a unit testing suite for Apache, to create
> scenarios that execute every line of code in the apache webserver so
> that they can verify that everything works properly, I think as a
> request it's pretty ambitious...
>

I should say, as a request *to the apache users group*..  there's
probably a mailing list for contributors to the project who actually
write C code, where this question might make more sense.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Code coverage while running web server

Posted by Jonathan Zuckerman <j....@gmail.com>.
On Sun, Dec 20, 2009 at 12:37 AM, Krist van Besien
<kr...@gmail.com> wrote:
> On Sat, Dec 19, 2009 at 1:30 AM, Guruprasad JG <gu...@gmail.com> wrote:
>> I am referring to the Apache code written in C. I would like to see if all
>> the paths are exercised for - request processing, resource management,
>> connection pooling, and configuration directives of the apache core. This
>> would be more like functional testing of apache.
>
> I think you'll have to explain to us what you exactly mean with
> checking that "all the paths are exercised". I have no clue how to
> "exercise paths" in any context, and I do consider my knowledge of the
> English language quite substantial. Maybe you should rephrase your
> question.
> If you just want to know what goes on inside Apache when a request is
> processed than you can ofcourse run it in a debugger. Will be slow,
> though. Make sure the timeout in whatever client you use is high
> enough.
>
> Krist
>
>
> --
> krist.vanbesien@gmail.com
> krist@vanbesien.org
> Bremgarten b. Bern, Switzerland
> --
> A: It reverses the normal flow of conversation.
> Q: What's wrong with top-posting?
> A: Top-posting.
> Q: What's the biggest scourge on plain text email discussions?
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

I believe he is asking for a unit testing suite for Apache, to create
scenarios that execute every line of code in the apache webserver so
that they can verify that everything works properly, I think as a
request it's pretty ambitious...

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Code coverage while running web server

Posted by Guruprasad JG <gu...@gmail.com>.
Ok, here is what I am trying to do. I have modified the kernel to track some
of the system calls made by apache at run time. I want to ensure that all
possible invocations of those system calls in any place in the apache code
are invoked. This means that if I run gcov or any code coverage tool on the
apache, I would see close to 90-100% of code being covered during that run
of apache.
I assumed that since apache is open source, these would also be.



On Sun, Dec 20, 2009 at 3:37 AM, Krist van Besien <krist.vanbesien@gmail.com
> wrote:

> On Sat, Dec 19, 2009 at 1:30 AM, Guruprasad JG <gu...@gmail.com>
> wrote:
> > I am referring to the Apache code written in C. I would like to see if
> all
> > the paths are exercised for - request processing, resource management,
> > connection pooling, and configuration directives of the apache core. This
> > would be more like functional testing of apache.
>
> I think you'll have to explain to us what you exactly mean with
> checking that "all the paths are exercised". I have no clue how to
> "exercise paths" in any context, and I do consider my knowledge of the
> English language quite substantial. Maybe you should rephrase your
> question.
> If you just want to know what goes on inside Apache when a request is
> processed than you can ofcourse run it in a debugger. Will be slow,
> though. Make sure the timeout in whatever client you use is high
> enough.
>
> Krist
>
>
> --
> krist.vanbesien@gmail.com
> krist@vanbesien.org
> Bremgarten b. Bern, Switzerland
> --
> A: It reverses the normal flow of conversation.
> Q: What's wrong with top-posting?
> A: Top-posting.
> Q: What's the biggest scourge on plain text email discussions?
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

Re: [users@httpd] Code coverage while running web server

Posted by Krist van Besien <kr...@gmail.com>.
On Sat, Dec 19, 2009 at 1:30 AM, Guruprasad JG <gu...@gmail.com> wrote:
> I am referring to the Apache code written in C. I would like to see if all
> the paths are exercised for - request processing, resource management,
> connection pooling, and configuration directives of the apache core. This
> would be more like functional testing of apache.

I think you'll have to explain to us what you exactly mean with
checking that "all the paths are exercised". I have no clue how to
"exercise paths" in any context, and I do consider my knowledge of the
English language quite substantial. Maybe you should rephrase your
question.
If you just want to know what goes on inside Apache when a request is
processed than you can ofcourse run it in a debugger. Will be slow,
though. Make sure the timeout in whatever client you use is high
enough.

Krist


-- 
krist.vanbesien@gmail.com
krist@vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Code coverage while running web server

Posted by Guruprasad JG <gu...@gmail.com>.
I am referring to the Apache code written in C. I would like to see if all
the paths are exercised for - request processing, resource management,
connection pooling, and configuration directives of the apache core. This
would be more like functional testing of apache.

On Fri, Dec 18, 2009 at 3:42 AM, Jonathan Zuckerman
<j....@gmail.com>wrote:

> On Thu, Dec 17, 2009 at 9:49 PM, Guruprasad JG <gu...@gmail.com>
> wrote:
> >
> > I am working on a project which requires running httpd web server. I need
> to
> > ensure that all the important code paths are covered while the web server
> is
> > running.  I looked around for test scripts which can help in doing that,
> but
> > couldn't find any. Are there any test suite or bunch of functional test
> > scripts which the developers might use to test the web server before
> > official releases ?
> >
> > Thanks a ton !
> > Guruprasad
> >
>
> When you talk about code paths, it's meaningless without specifying
> what type of code you're using (language).  I'm familiar with Java and
> PHP and I've heard of several unit testing suites for each.
> But those would be questions for a different list...since Apache is an
> http server, you might just be talking about checking URLs.  In that
> case I doubt any such script exists, as the complex part would be
> defining the ontology of your website's valid locations.  The rest is
> pretty trivial, loop through the urls, make an http request with curl
> or wget or something for each of them, and scrub the response for the
> HTTP status code.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

Re: [users@httpd] Code coverage while running web server

Posted by Jonathan Zuckerman <j....@gmail.com>.
On Thu, Dec 17, 2009 at 9:49 PM, Guruprasad JG <gu...@gmail.com> wrote:
>
> I am working on a project which requires running httpd web server. I need to
> ensure that all the important code paths are covered while the web server is
> running.  I looked around for test scripts which can help in doing that, but
> couldn't find any. Are there any test suite or bunch of functional test
> scripts which the developers might use to test the web server before
> official releases ?
>
> Thanks a ton !
> Guruprasad
>

When you talk about code paths, it's meaningless without specifying
what type of code you're using (language).  I'm familiar with Java and
PHP and I've heard of several unit testing suites for each.
But those would be questions for a different list...since Apache is an
http server, you might just be talking about checking URLs.  In that
case I doubt any such script exists, as the complex part would be
defining the ontology of your website's valid locations.  The rest is
pretty trivial, loop through the urls, make an http request with curl
or wget or something for each of them, and scrub the response for the
HTTP status code.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org