[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TDD and BDD for emacs-lisp

From: Pascal J. Bourguignon
Subject: Re: TDD and BDD for emacs-lisp
Date: Thu, 02 Jun 2016 15:20:42 -0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Xavier Maillard <address@hidden> writes:

> Hello,
> for my next project (an IM tool), I would like to try to embrace TDD/BDD
> methodology. I have never done this before and I even do not know the way I
> will have to change my coding habits.

For unit tests, there are various emacs lisp test frameworks.  It's
rather easy to write your own too.

However, if you want to perform integration tests, since you are
implementing a communication tool, you will have to send data from one
end, and receive it on another end, so, in another process, and check
that it has been correctly received, etc.

Once I had to test a MTA (SMTP filter), and I was in that situation,
with messages composed and sent from emacs, and received in another
process.  You may want to filter and test the logs too (check for error
messages or other events).

In this situation, I know of no test framework helping, and therefore I
tend to write my own test modules or tools, specific to each situation.

Sorry, I cannot help you with code, it was a long time ago, wikis, DCVS
and things like elpa didn't exist yet!

Reusable frameworks are nice when you are doing repeatitively the same
kind of work…

> I have looked here and there to see if it is something emacs-lisp hackers
> do, it seems that it has not spread much.
> So, what tool(s) do you use if you do your devs using TDD/BDD ? Do you have
> simple examples to share ? Is it recommended to do both ? Where does one
> shine more than another ? etc. (I will probably have to read tons of
> documentation but that's fine).
> With ERT shipped with GNU emacs >= 24, there is no reason not to use it but
> for BDD, I can see at least 2 (good) tools: ecukes and buttercup. Is there
> any comparison chart somewhere ? 

ERT is made to unit test emacs lisp code. I doubt it would be convenient
to use when you have asynchronous and communicating processes. So it
will be applicable only partially (on small local unit tests).

> Any help would be appreciated to start using TDD/BDD.

__Pascal Bourguignon__       
“The factory of the future will have only two employees, a man and a
dog. The man will be there to feed the dog. The dog will be there to
keep the man from touching the equipment.” -- Carl Bass CEO Autodesk

reply via email to

[Prev in Thread] Current Thread [Next in Thread]