2009/11/15 Steve Conover <
scon...@gmail.com>:
> - I'm wondering who this new team member is...are you imagining that
> this person is not either ops or dev?
They could be dev, ops, a new hire, someone from the business - it
doesn't really matter.
The self documenting nature of the Cucumber steps makes it immediately
obvious what the check is doing, without prior knowledge of the
programming language. Technical users (dev or ops) can drill down
further into the implementation of the check, and people from the
business can be content with a high-level understanding.
>
> - Regarding teaching your sysads to refactor and reuse - you could
> just do that directly. "People, we're going to build a library. And
> write tests.". One could imagine picking bash or ruby and building up
> a library of unit-tested nagios check support.
There's a big difference between encouraging a culture of code sharing
and reuse, and using a tool that actively promotes it. With Cucumber
you really have no choice but to write reusable steps, whereas it
takes a lot of discipline to do it by yourself, and even more across a
team.
If you have high quality sysadmins who are also knowledgeable and
disciplined developers on your team you can probably pull it off, but
a lot of us aren't that blessed.
I hold no illusions that cucumber-nagios is the only way of doing
this. If you manage to build or find another tool that promotes that
disciplined workflow without the use of the Cucumber language, that
would be awesome too.
>
> In addition, I kind of see cucumber as an unnecessary level of
> abstraction away from where you want to be. I don't doubt that it
> could be made to work by someone determined enough. But if you're
> going to check return codes from commands, and mess with /proc or kill
> -3 or curl localhost, why not use something like bash/perl/ruby (some
> combo, even)? That environment seems to me to be most appropriate to
> the "domain" - making assertions about the state of a system - where
> by contrast cucumber (I would argue) is most appropriate for
> expressing acceptance tests for a web application that someone less
> technical might want to read.
To your first point, you are just writing Ruby. Just think of a step
as a Ruby method or a Python function, with Cucumber as pattern
matching thrown on top.
You're not writing your checks in some crazy meta-language - you're
constructing checks by stringing Ruby methods together.
Secondly, there's no denying Cucumber is a great fit for acceptance
testing of web applications, but I think the Gherkin language (what
you're writing your Cucumber features/scenarios in) has suitably
evolved to be useful in a lot of other situations (monitoring checks
come to mind :-).
>
> I'm guessing we simply disagree about that last part. It's an
> interesting concept nonetheless.
Cucumber is definitely *not* a silver bullet. There are plenty of
reasons why you wouldn't use it, which you have enumerated well.
Talking about it teases out the pros and cons of both approaches,
which is a good thing.
Lindsay