from anywhere in your code: puts(msg)
from your ruby stepdefs: announce(msg) or puts(msg)
If you need more fancy logging than that you're doing it wrong IMO. I
use puts and just remove them when I have solved my problem (before I
commit the code).
> Specifically, I should like to
> debug my steps by logging their execution.
http://technicalpickles.com/posts/debugging-cucumber/
HTH,
Aslak
> Thanks,
> Arve
>
> --
> You received this message because you are subscribed to the Google Groups
> "Cukes" group.
> To post to this group, send email to cu...@googlegroups.com.
> To unsubscribe from this group, send email to
> cukes+un...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/cukes?hl=en.
>
On Mon, Jul 5, 2010 at 1:30 PM, Arve Knudsen <arve.k...@gmail.com> wrote:from anywhere in your code: puts(msg)
> Hi
> Are there any logging facilities in Cucumber?
from your ruby stepdefs: announce(msg) or puts(msg)
If you need more fancy logging than that you're doing it wrong IMO. I
use puts and just remove them when I have solved my problem (before I
commit the code).
> Specifically, I should like tohttp://technicalpickles.com/posts/debugging-cucumber/
> debug my steps by logging their execution.
Let me elaborate on why I think it's a bad idea:
1) Feature creep. You can use any of the many available logging
frameworks for Ruby. Cucumber doesn't have to set one up for you.
2) Encouraging what I think is a dubious practice in BDD/TDD. Logging
is a technique people use when they don't know what's going on. A
better approach is to drop down to more focussed unit testing. That
automates the validation of your logic and fails when things don't
work right. Logging requires manual eye-balling to verify that
something is not working right and slows you down. It also pollutes
your code.
Aslak
On Mon, Jul 5, 2010 at 4:43 PM, Arve Knudsen <arve.k...@gmail.com> wrote:Let me elaborate on why I think it's a bad idea:
> On Mon, Jul 5, 2010 at 1:48 PM, aslak hellesoy <aslak.h...@gmail.com>
> wrote:
>>
>> On Mon, Jul 5, 2010 at 1:30 PM, Arve Knudsen <arve.k...@gmail.com>
>> wrote:
>> > Hi
>> > Are there any logging facilities in Cucumber?
>>
>> from anywhere in your code: puts(msg)
>> from your ruby stepdefs: announce(msg) or puts(msg)
>>
>> If you need more fancy logging than that you're doing it wrong IMO. I
>> use puts and just remove them when I have solved my problem (before I
>> commit the code).
>
> I can't automatically see why dedicated logging facilities is a bad idea.
1) Feature creep. You can use any of the many available logging
frameworks for Ruby. Cucumber doesn't have to set one up for you.
2) Encouraging what I think is a dubious practice in BDD/TDD. Logging
is a technique people use when they don't know what's going on. A
better approach is to drop down to more focussed unit testing. That
automates the validation of your logic and fails when things don't
work right. Logging requires manual eye-balling to verify that
something is not working right and slows you down. It also pollutes
your code.
So the question is NOT are my scenarios right, or succeed/fail; the question is: “did my scenarios run or not run”?
Seems to me that a software tool is in order: Have cucumber output the names of the scenarios that ran to stdout; you can redirect that to a file (or maybe there is a more elegant way of doing this?)
Then write a tool in ruby or whatever, that scans the scenario files and pulls out the names of all the scenarios. Then the software can compare the two lists. This will work if you’re not using tags; and scenario outlines present a challenge, but should be workable.
Or is there more to this question?
--
So the question is NOT are my scenarios right, or succeed/fail; the question is: “did my scenarios run or not run”?
Seems to me that a software tool is in order: Have cucumber output the names of the scenarios that ran to stdout; you can redirect that to a file (or maybe there is a more elegant way of doing this?)
Oh, ok. The question is then: Am I testing what I think I’m testing, or am I getting a false positive?
Sort of like this, but for acceptance tests http://thedailywtf.com/articles/unit-tested.aspx
Seriously, this is an area of concern for me as well. Suppose that you have a set of acceptance tests that provide adequate coverage. Now the product owner changes a requirement that cuts across several stories; how do you verify that ALL the scenarios that need to change have changed? I think that type of thing can’t be automated. You need to audit your scenarios to ensure that they’re right.
I’d hope that the scenarios are written to make that auditing easier to do, so that you can review the scenarios rather than the log files. After all, the scenarios are supposed to be a communication tool between the engineers and the stakeholders. If you have to look at the log files to see if a scenario is doing what it is supposed to, then the scenarios aren’t serving that purpose.
Oh, ok. The question is then: Am I testing what I think I’m testing, or am I getting a false positive?
Sort of like this, but for acceptance tests http://thedailywtf.com/articles/unit-tested.aspx
Seriously, this is an area of concern for me as well. Suppose that you have a set of acceptance tests that provide adequate coverage. Now the product owner changes a requirement that cuts across several stories; how do you verify that ALL the scenarios that need to change have changed? I think that type of thing can’t be automated. You need to audit your scenarios to ensure that they’re right.
I’d hope that the scenarios are written to make that auditing easier to do, so that you can review the scenarios rather than the log files. After all, the scenarios are supposed to be a communication tool between the engineers and the stakeholders. If you have to look at the log files to see if a scenario is doing what it is supposed to, then the scenarios aren’t serving that purpose.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.