From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Avdi Grimm" Subject: Re: How you can help Date: Thu, 23 Oct 2008 15:10:42 -0400 Message-ID: References: <967CE7ED-05E9-4031-9F3B-CFB826511554@alexanderonline.org> <87ljwfbdga.fsf@kassiopeya.MSHEIMNETZ> <752DA813-1B66-4FD1-B28E-3C23176BA13D@alexanderonline.org> <87r6679t1t.fsf@kassiopeya.MSHEIMNETZ> <877i7z9px8.fsf@kassiopeya.MSHEIMNETZ> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kt5a1-0007gg-55 for emacs-orgmode@gnu.org; Thu, 23 Oct 2008 15:10:45 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kt5Zz-0007gU-S8 for emacs-orgmode@gnu.org; Thu, 23 Oct 2008 15:10:44 -0400 Received: from [199.232.76.173] (port=39483 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kt5Zz-0007gR-Mv for emacs-orgmode@gnu.org; Thu, 23 Oct 2008 15:10:43 -0400 Received: from wf-out-1314.google.com ([209.85.200.170]:12051) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kt5Zz-0008Ea-LK for emacs-orgmode@gnu.org; Thu, 23 Oct 2008 15:10:43 -0400 Received: by wf-out-1314.google.com with SMTP id 28so488516wfc.24 for ; Thu, 23 Oct 2008 12:10:42 -0700 (PDT) In-Reply-To: <877i7z9px8.fsf@kassiopeya.MSHEIMNETZ> Content-Disposition: inline List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Sebastian Rose Cc: emacs-orgmode Org-Mode On Thu, Oct 23, 2008 at 1:33 PM, Sebastian Rose wrote: > Hm - how about: > > 1. A not yet existent elisp file test-worg.el, that defines a function > hello-worg, and a variable lang, and simply puts "Hello Worg"into the > minibuffer (if (string= lang "en")) and "Hallo Worg" (if (string= lang > "de")) ? I'd prefer something that would be of concrete value to someone in using org-mode - made-up scenarios tend to lead to unrealistic tests. > Did you work with unit-testing frameworks for elisp already? > Which one? I have not. I've done test-driven development in Java, C#, Ruby, and C++(!) though, and if I can do it in C++ I think I can get up to speed in any language pretty quickly ;-) > Recommendations? As I said in another comment, I'm liking the look of Emacs Lisp Expectations a *lot*. Partly because I think Jay Fields is bang on the money for how maintain good habits in your tests, and partly because it has a mocking framework to go with it. Testing without a mocking framework is less fun than testing with. However, I haven't actually used it yet, so I can't responsibly recommend it. Let's just say that the discovery of it recently was the thing that got me excited about doing some serious ELisp development. > Could say something about the effort to get started with such a > framework? I think if you have some *running* examples to crib from it shouldn't take someone who is already ELisp-savvy more than a few hours to get the hang of it. > > Can we add it without changing Org's code? If understand 2. correctly - yes? In a dynamic language like ELisp, any testing framework that requires you to change the code just to get it under test isn't worth using. No, you should not have to change org-mode's code to get started with tests. That said, developing in concert with a test suite will definitely tend to influence how you write the code. Generally speaking, developing with tests encourages smaller functions which do one thing and one thing alone and don't have a lot of non-obvious inputs and outputs. Since this is usually the direction you *want* your code to go in anyway, it's a virtuous cycle. -- Avdi Home: http://avdi.org Developer Blog: http://avdi.org/devblog/ Twitter: http://twitter.com/avdi Journal: http://avdi.livejournal.com