From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?Przemys=c5=82aw_Wojnowski?= Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] CONTRIBUTE - writing tests for understanding internals Date: Wed, 11 Nov 2015 22:08:49 +0100 Message-ID: <5643AE61.1070503@cumego.com> References: <87twotqxme.fsf@cumego.com> <83a8qlky1c.fsf@gnu.org> <874mgtgess.fsf@cumego.com> <834mgslf34.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1447276208 24482 80.91.229.3 (11 Nov 2015 21:10:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 11 Nov 2015 21:10:08 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 11 22:09:58 2015 Return-path: Envelope-to: ged-emacs-devel@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 1ZwceR-0002Qh-Iu for ged-emacs-devel@m.gmane.org; Wed, 11 Nov 2015 22:09:56 +0100 Original-Received: from localhost ([::1]:42991 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwceR-0006FA-Sa for ged-emacs-devel@m.gmane.org; Wed, 11 Nov 2015 16:09:55 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36153) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zwcdq-0005jw-MR for emacs-devel@gnu.org; Wed, 11 Nov 2015 16:09:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZwcdW-0002nL-IU for emacs-devel@gnu.org; Wed, 11 Nov 2015 16:09:18 -0500 Original-Received: from smtp23.iq.pl ([86.111.242.228]:39502) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwcdW-0002jd-9F for emacs-devel@gnu.org; Wed, 11 Nov 2015 16:08:58 -0500 Original-Received: (qmail 24699 invoked from network); 11 Nov 2015 21:08:50 -0000 Original-Received: from unknown (HELO [192.168.0.101]) (esperanto@cumego.com@[46.186.59.37]) (envelope-sender ) by smtp22.iq.pl with AES128-SHA encrypted SMTP for ; 11 Nov 2015 21:08:50 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 In-Reply-To: <834mgslf34.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 86.111.242.228 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:194144 Archived-At: W dniu 11.11.2015 o 16:40, Eli Zaretskii pisze: >> From: Przemysław Wojnowski >> Cc: emacs-devel@gnu.org >> Date: Wed, 11 Nov 2015 08:45:23 +0100 >> >>> Thanks, but I don't think CONTRIBUTE is the right place for >>> motivation-related text. We should find some other place for that. >> >> This was not for motivational purposes, but to tell how to learn about >> Emacs Internals - like the old part. > > The style is quite different: where CONTRIBUTE is about information > for contributors, the suggested change, with the exception of its > first sentence, is a motivational text that has no informational value > for contributors. I tend to agree that my style of writing is different than the rest of the document and is a place to improve. That's why I've sent it here. > More importantly, I disagree with your posit that writing tests is a > good way of learning about Emacs internals. Did you write this based on your experience? I did. It *is* very good way to learn about a project and, in many companies, is used to introduce new developers. (I do that every time and after sometime devs tell me that it is a good introduction, because project at the beginning were to big and overwhelming to them.) It's very easy to verify this by writing a few tests to a project you don't know. > Best tests are written by looking at the spec alone, > because looking at the implementation will bias you when > you write the test. That's why tests should ideally be > written by someone who is not the implementor. Ideally yes. And new contributors are very close to this ideal, because they didn't implement the code and have docs as specs. I submitted a couple of tests to Emacs packages and was writing them based on available docs (even CLTL2, in case of cl-lib) and I've learned a lot about those parts. > I'm sure you are > familiar with the TDD methodology, whose strong point is precisely > that you write tests before implementing anything. "Reality check:" we already have code base. ;-) Cheers, Przemysław