From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Pascal J. Bourguignon" Newsgroups: gmane.emacs.help Subject: Re: TDD and BDD for emacs-lisp Date: Thu, 28 Apr 2016 19:59:54 +0200 Organization: Informatimago Message-ID: <877ffh7gx1.fsf@kuiper.lan.informatimago.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1464880998 6385 80.91.229.3 (2 Jun 2016 15:23:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 2 Jun 2016 15:23:18 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jun 02 17:23:11 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1b8USk-00060a-RM for geh-help-gnu-emacs@m.gmane.org; Thu, 02 Jun 2016 17:23:10 +0200 Original-Received: from localhost ([::1]:48004 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8USj-0004HB-Uq for geh-help-gnu-emacs@m.gmane.org; Thu, 02 Jun 2016 11:23:10 -0400 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 60 Original-X-Trace: individual.net XQ/hq715FEFI6oFGN4bx2AGIJkBmIgEsuqe6pqhhmYX9dJtmnr Cancel-Lock: sha1:MjEzNDY5M2I3NDJhZmE3NDdhYWJjYzliNjgzYWY1OWYxYTEzNjViYw== sha1:HUDhf7eM0onnaqQzpqTGiIt7qXw= Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Original-Xref: usenet.stanford.edu gnu.emacs.help:217541 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:110166 Archived-At: Xavier Maillard 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. https://www.emacswiki.org/emacs/UnitTesting 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__ http://www.informatimago.com/ “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